URL:
<https://savannah.gnu.org/bugs/?59973>
Summary: [PATCH] implement .soquiet and .msoquiet requests
Project: GNU troff
Submitted by: gbranden
Submitted on: Sat 30 Jan 2021 06:42:25 AM UTC
Category: Core
Severity: 1 - Wish
Item Group: New feature
Status: In Progress
Privacy: Public
Assigned to: gbranden
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
Use case #1: The internationalization patch in bug #59814 could use this to
_quietly_ attempt to open a localization file. groff only supports a few
locales, so people with LANG=es_ES, for instance would ordinarily see warning
diagnostics on every groff startup if file warnings are enabled.
Use case #2: Support of user-specific troffrc or man.local files, gracefully
failing if they don't exist or if there is a permissions problem. Imagine:
.soquiet \v[XDG_DATA_HOME]/man.local
Yes, .msoquiet could be aped with *roff arithmetic to effectively mask off the
warning type and then restoring it. This is incredibly tedious. It is also
fragile, being subject to breakage if a new warning category is ever added;
see bug #52990.
Attaching straw-man implementation. Includes test, does not yet include
updates to documentation.
The `while (1)` may look weird. I judged it better than complicating the
boolean conditional afterward (indeed, I managed to mess it up when I tried),
and it avoids using goto. In my opinion it's easier to understand than
golfier alternatives I can imagine.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sat 30 Jan 2021 06:42:25 AM UTC Name: soquiet.diff Size: 6KiB By:
gbranden
<http://savannah.gnu.org/bugs/download.php?file_id=50807>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59973>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/