gbranden pushed a commit to branch master
in repository groff.
commit 372c7fab93e7d263ae0210e0f40fbfc85fd1e691
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Nov 15 17:12:21 2026 -0600
[troff]: Drop $HOME from default tmac path.
* src/libs/libgroff/macropath.cpp: Drop inclusion of user's home
directory from initialization of `macro_path` and `safer_macro_path`.
* doc/groff.texi.in (Macro Directories):
* src/roff/troff/troff.1.man (Environment): Drop notice of the
aforementioned inclusion.
Fixes <https://savannah.gnu.org/bugs/?68890>. Thanks to Morten Bo
Johansen for the report; to him and Deri James, Peter Schaffter, Larry
Kollar, and Doug McIlroy for input; and to Dave Kemper for corralling
feedback.
NEWS: Add item.
ANNOUNCE: Acknowledge discussants.
Before:
$ GROFF_BIN_PATH=./build ./build/groff -F build/font --version 2>&1 \
| grep macro
macro search path:
/home/branden:/home/branden/groff-HEAD/lib/groff/site-tmac:/home/branden/groff-HEAD/share/groff/site-tmac:/home/branden/groff-HEAD/share/groff/1.25.0/tmac
Now:
$ GROFF_BIN_PATH=./build ./build/groff -F build/font --version 2>&1 \
| grep macro
macro search path:
/home/branden/groff-HEAD/lib/groff/site-tmac:/home/branden/groff-HEAD/share/groff/site-tmac:/home/branden/groff-HEAD/share/groff/1.25.0/tmac
---
ANNOUNCE | 5 +++++
ChangeLog | 14 ++++++++++++++
NEWS | 7 +++++++
doc/groff.texi.in | 5 -----
src/libs/libgroff/macropath.cpp | 4 ++--
src/roff/troff/troff.1.man | 1 -
6 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/ANNOUNCE b/ANNOUNCE
index 2cc4badec..4e1136a72 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -229,6 +229,11 @@ of this release.
instance with "grep -i -A1 thanks ChangeLog". A manual merge of
similar from the contrib/ change log files may also be necessary. ]]
+Dave Kemper
+Deri James
Dickson Wu
+Doug McIlroy
+Larry Kollar
Morten Bo Johansen
+Peter Schaffter
Stefan Möding
diff --git a/ChangeLog b/ChangeLog
index 40cdd5a66..4afb9081b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2026-11-15 G. Branden Robinson <[email protected]>
+
+ * src/libs/libgroff/macropath.cpp: Drop inclusion of user's home
+ directory from initialization of `macro_path` and
+ `safer_macro_path`.
+ * doc/groff.texi.in (Macro Directories):
+ * src/roff/troff/troff.1.man (Environment): Drop notice of the
+ aforementioned inclusion.
+
+ Fixes <https://savannah.gnu.org/bugs/?68890>. Thanks to Morten
+ Bo Johansen for the report; to him and Deri James, Peter
+ Schaffter, Larry Kollar, and Doug McIlroy for input; and to Dave
+ Kemper for corralling feedback.
+
2026-11-14 G. Branden Robinson <[email protected]>
* m4/groff.m4 (GROFF_G): Report value of `.g` register alongside
diff --git a/NEWS b/NEWS
index 14847507b..8e5f730fd 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,13 @@ VERSION next
troff
-----
+* The user's home directory is no longer present in the default macro
+ file search path. To restore GNU troff's former behavior in this
+ respect, use a command-line option or environment variable.
+
+ $ groff -M "$HOME"
+ $ GROFF_TMAC_PATH="$HOME" groff
+
* The `ne` request no longer performs an operation if it is given an
invalid argument. This change is inconsistent with AT&T troff but
more consistent with general *roff syntax.
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 64c3974b6..84baf3172 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -1912,11 +1912,6 @@ Directories listed in the @env{GROFF_TMAC_PATH}
environment variable.
The current working directory (only if in unsafe mode using the
@option{-U} command-line option).
-@item
-@cindex home directory
-@cindex directory, home
-The user's home directory, found in the @env{HOME} environment variable.
-
@item
@cindex site-local directory
@cindex directory, site-local
diff --git a/src/libs/libgroff/macropath.cpp b/src/libs/libgroff/macropath.cpp
index 86ace5e66..ccb929dda 100644
--- a/src/libs/libgroff/macropath.cpp
+++ b/src/libs/libgroff/macropath.cpp
@@ -30,8 +30,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#define MACROPATH_ENVVAR "GROFF_TMAC_PATH"
// TODO: Boolify 3rd and 4th arguments.
-search_path macro_path(MACROPATH_ENVVAR, MACROPATH, 1, 1);
-search_path safer_macro_path(MACROPATH_ENVVAR, MACROPATH, 1, 0);
+search_path macro_path(MACROPATH_ENVVAR, MACROPATH, 0, 1);
+search_path safer_macro_path(MACROPATH_ENVVAR, MACROPATH, 0, 0);
search_path config_macro_path(MACROPATH_ENVVAR, MACROPATH, 0, 0);
// Local Variables:
diff --git a/src/roff/troff/troff.1.man b/src/roff/troff/troff.1.man
index 1b3888ab5..8e05ad2f9 100644
--- a/src/roff/troff/troff.1.man
+++ b/src/roff/troff/troff.1.man
@@ -992,7 +992,6 @@ will scan directories given as arguments to any specified
options before these,
then the current directory
(only if in unsafe mode),
-the user's home directory,
.if !'@COMPATIBILITY_WRAPPERS@'no' \{\
a platform-specific directory
.RI ( @SYSTEMMACRODIR@ ),
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit