summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog18
-rw-r--r--NEWS8
-rw-r--r--doc/groff.texinfo14
-rw-r--r--font/devps/Makefile.sub4
-rw-r--r--man/groff.man2
-rw-r--r--man/roff.man12
-rw-r--r--src/roff/groff/groff.man2
-rw-r--r--src/roff/nroff/nroff.man4
-rw-r--r--src/roff/troff/input.cc42
-rw-r--r--src/roff/troff/troff.man16
-rw-r--r--test-groff2
-rwxr-xr-xtmac/groff_tmac.man25
12 files changed, 91 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index 2aa18bbe..fbf3387a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2000-10-25 Werner LEMBERG <wl@gnu.org>
+
+ Invert current behaviour: Search first FOOBAR.tmac, then
+ tmac.FOOBAR.
+
+ * src/roff/troff/input.cc: Introduce MACRO_POSTFIX.
+ (open_mac_file, macro_source): Implement it.
+ * src/roff/troff/troff.man, tmac/groff_tmac.man, man/roff.man,
+ doc/groff.texinfo, NEWS: Document it.
+
+ * src/roff/nroff/nroff.man, src/roff/groff/groff.man, man/groff.man:
+ Small documentation improvements.
+
+ * test-groff: Fix GROFF_TMAC_PATH (hyphen.us is now in the tmac
+ subdirectory also).
+
+ * font/devps/Makefile.sub: Fix rules for dingbats.*map.
+
2000-10-24 Werner LEMBERG <wl@gnu.org>
Add local tmac directory (groff/site-tmac).
diff --git a/NEWS b/NEWS
index 860b6b0a..6458141e 100644
--- a/NEWS
+++ b/NEWS
@@ -4,9 +4,11 @@ are not described. There are more details in the man pages.
Groff
-----
-To support platforms with 8+3 filenames, `-mFOO' will now search first for
-tmac.FOO and then for FOO.tmac. Additionally, some macro files have been
-renamed using the latter scheme to avoid 8+3 name clashes.
+`-mFOO' will now search first for `FOO.tmac' and then for `tmac.FOO'. The
+old behaviour has been changed to overcome problems with platforms which
+have an 8+3 file name limit, and platforms which have other versions of
+troff installed also. Additionally, some macro files have been renamed
+using the latter scheme to avoid 8+3 name clashes.
The new environment variable GROFF_BIN_PATH will be checked for programs
groff is calling (preprocessors, troff, and output devices). If not set,
diff --git a/doc/groff.texinfo b/doc/groff.texinfo
index 386c4d9a..d72d3ec5 100644
--- a/doc/groff.texinfo
+++ b/doc/groff.texinfo
@@ -1233,9 +1233,9 @@ one-letter name; @var{name} can be of arbitrary length.
Use @var{fam} as the default font family.
@item -m@var{name}
-Read in the file @file{tmac.@var{name}}. Normally this will be searched
+Read in the file @file{@var{name}.tmac}. Normally this will be searched
for in the macro directories of @code{groff}. If it isn't found,
-@file{@var{name}.tmac} will be tried (and searched in the same
+@file{tmac.@var{name}} will be tried (and searched in the same
directories).
@item -n@var{num}
@@ -4115,8 +4115,8 @@ The hyphenation character is associated with the current environment
@cindex patterns for hyphenation
@Deffn{Request, hpf, pattern_file}
Read in a file of hyphenation patterns. This file will be searched for
-in the same way as @file{tmac.@var{name}} (resp.@:
-@file{@var{name}.tmac}) is searched for if the @option{-m@var{name}}
+in the same way as @file{@var{name}.tmac} (resp.@:
+@file{tmac.@var{name}}) is searched for if the @option{-m@var{name}}
option is specified.
It should have the same format as the argument to the @code{\patterns}
@@ -6344,7 +6344,7 @@ name.
This would be called as
@example
-.vl $Id: groff.texinfo,v 1.48 2000/10/24 20:39:01 wlemb Exp $
+.vl $Id: groff.texinfo,v 1.49 2000/10/25 21:06:42 wlemb Exp $
@end example
@xref{Request Arguments}.
@@ -7151,8 +7151,8 @@ large documents, i.e.@: keeping each chapter in a separate file.
The @code{mso} request is the same as the @code{so} request except that
the file is searched for in the same directories as macro files for the
the @option{-m} command line option. If the file name to be included
-has the form @file{tmac.@var{name}} and it isn't found, @code{mso} tries
-to include @file{@var{name}.tmac}.
+has the form @file{@var{name}.tmac} and it isn't found, @code{mso} tries
+to include @file{tmac.@var{name}} and vice versa.
@findex cf
@cindex transparent output
diff --git a/font/devps/Makefile.sub b/font/devps/Makefile.sub
index a40f63f7..08b61e27 100644
--- a/font/devps/Makefile.sub
+++ b/font/devps/Makefile.sub
@@ -4,8 +4,8 @@ DISTFILES=text.enc download \
CB CBI CI CR HB HBI HI HR HNB HNBI HNI HNR \
NB NBI NI NR PB PBI PI PR TB TBI TI TR ZCMI
PSFILES=prologue symbolsl.pfa zapfdr.pfa
-DEVGENFILES=generate/Makefile generate/afmname generate/dingbatsmap \
- generate/dingbatsrmap generate/lgreekmap generate/symbol.sed \
+DEVGENFILES=generate/Makefile generate/afmname generate/dingbats.map \
+ generate/dingbats.rmap generate/lgreekmap generate/symbol.sed \
generate/symbolchars generate/symbolsl.afm generate/textmap
DEVFILES=DESC $(PSFILES) $(DISTFILES) $(DEVGENFILES)
diff --git a/man/groff.man b/man/groff.man
index 09b4f6ea..b5fb7fa2 100644
--- a/man/groff.man
+++ b/man/groff.man
@@ -1322,7 +1322,7 @@ Mark current vertical position in
.REQ .mso file
The same as the .so request except that
.I file
-is also searched in the tmac directories.
+is searched in the tmac directories.
.
.REQ .na
No output-line adjusting.
diff --git a/man/roff.man b/man/roff.man
index b2b2bbfb..09b95198 100644
--- a/man/roff.man
+++ b/man/roff.man
@@ -282,9 +282,9 @@ Macro packages are collections of macros that are suitable to format a
special kind of documents in a convenient way.
This greatly eases the usage of roff.
The macro definitions of a package are kept in a file called
-.BI tmac. name
+.IB name .tmac
(or
-.IR name .tmac\c
+.BI tmac. name\c
) where
.I name
is the internal roff name for this package.
@@ -302,7 +302,7 @@ or
.argname name .
General details on the naming of macro packages and their placement is
found in
-.BR tmac (@MAN5EXT@).
+.BR groff_tmac (@MAN5EXT@).
.LP
Famous classical macro packages are
.IR man ,
@@ -379,7 +379,7 @@ in all flavors of the Emacs editor.
.B GROFF_TMAC_PATH
A colon separated list of directories in which to search for
macro files, see
-.BR tmac (@MAN5EXT@).
+.BR groff_tmac (@MAN5EXT@).
.TP
.SM
.B GROFF_TYPESETTER
@@ -415,9 +415,9 @@ the latter as
.IB <groff_macro_dir> /troffrc
Initialization file for troff.
.TP
-.IB <groff_macro_dir> /tmac. name
-.TQ
.IB <groff_macro_dir> / name .tmac
+.TQ
+.IB <groff_macro_dir> /tmac. name
Macro files.
.TP
.IB <groff_font_dir> /dev name /DESC
diff --git a/src/roff/groff/groff.man b/src/roff/groff/groff.man
index c4f7b36e..d1f3efd0 100644
--- a/src/roff/groff/groff.man
+++ b/src/roff/groff/groff.man
@@ -78,7 +78,7 @@ For PostScript printers and previewers
For TeX dvi format.
.TP
.B X75
-For a 75 dpi X11 previewer.
+For a 75dpi X11 previewer.
.TP
.B X100
For a 100dpi X11 previewer.
diff --git a/src/roff/nroff/nroff.man b/src/roff/nroff/nroff.man
index eac88e4b..6522c2b4 100644
--- a/src/roff/nroff/nroff.man
+++ b/src/roff/nroff/nroff.man
@@ -54,7 +54,9 @@ option with an argument other than
.BR utf8 ,
or
.B cp1047
-will be ignored.
+will be ignored (and
+.B \-Tascii
+will be used).
The
.B \-h
option
diff --git a/src/roff/troff/input.cc b/src/roff/troff/input.cc
index 9a10d7db..125b3272 100644
--- a/src/roff/troff/input.cc
+++ b/src/roff/troff/input.cc
@@ -59,6 +59,7 @@ extern "C" {
#define USAGE_EXIT_CODE 1
#define MACRO_PREFIX "tmac."
+#define MACRO_POSTFIX ".tmac"
#define INITIAL_STARTUP_FILE "troffrc"
#define FINAL_STARTUP_FILE "troffrc-end"
#define DEFAULT_INPUT_STACK_LIMIT 1000
@@ -5636,20 +5637,19 @@ static void parse_output_page_list(char *p)
static FILE *open_mac_file(const char *mac, char **path)
{
- char *s = new char[strlen(mac)+strlen(MACRO_PREFIX)+1];
- strcpy(s, MACRO_PREFIX);
- strcat(s, mac);
- FILE *fp = macro_path.open_file(s, path);
- // Try FOOBAR.tmac if tmac.FOOBAR failed. Some tmac.* file names
- // clash after truncation to 8+3 DOS limits, so this allows to
- // rename them to *.tmac instead.
+ // Try first FOOBAR.tmac, then tmac.FOOBAR
+ char *s1 = new char[strlen(mac)+strlen(MACRO_POSTFIX)+1];
+ strcpy(s1, mac);
+ strcat(s1, MACRO_POSTFIX);
+ FILE *fp = macro_path.open_file(s1, path);
+ a_delete s1;
if (!fp) {
- strcpy(s, mac);
- strcat(s, ".");
- strncat(s, MACRO_PREFIX, strcspn(MACRO_PREFIX, "."));
- fp = macro_path.open_file(s, path);
+ char *s2 = new char[strlen(mac)+strlen(MACRO_PREFIX)+1];
+ strcpy(s2, MACRO_PREFIX);
+ strcat(s2, mac);
+ fp = macro_path.open_file(s2, path);
+ a_delete s2;
}
- a_delete s;
return fp;
}
@@ -5689,17 +5689,27 @@ void macro_source()
char *path;
FILE *fp = macro_path.open_file(nm.contents(), &path);
// .mso doesn't (and cannot) go through open_mac_file, so we
- // need to do it here manually...
+ // need to do it here manually: If we have tmac.FOOBAR, try
+ // FOOBAR.tmac and vice versa
if (!fp) {
const char *fn = nm.contents();
if (strncasecmp(fn, MACRO_PREFIX, sizeof(MACRO_PREFIX) - 1) == 0) {
- char *s = new char[strlen(fn) + 1];
+ char *s = new char[strlen(fn) + sizeof(MACRO_POSTFIX)];
strcpy(s, fn + sizeof(MACRO_PREFIX) - 1);
- strcat(s, ".");
- strncat(s, MACRO_PREFIX, strcspn(MACRO_PREFIX, "."));
+ strcat(s, MACRO_POSTFIX);
fp = macro_path.open_file(s, &path);
a_delete s;
}
+ if (!fp) {
+ if (strncasecmp(fn + strlen(fn) - sizeof(MACRO_POSTFIX) + 1,
+ MACRO_POSTFIX, sizeof(MACRO_POSTFIX) - 1) == 0) {
+ char *s = new char[strlen(fn) + sizeof(MACRO_PREFIX)];
+ strcpy(s, MACRO_PREFIX);
+ strncat(s, fn, strlen(fn) - sizeof(MACRO_POSTFIX) + 1);
+ fp = macro_path.open_file(s, &path);
+ a_delete s;
+ }
+ }
}
if (fp) {
input_stack::push(new file_iterator(fp, symbol(path).contents()));
diff --git a/src/roff/troff/troff.man b/src/roff/troff/troff.man
index ef25e127..ba1addcf 100644
--- a/src/roff/troff/troff.man
+++ b/src/roff/troff/troff.man
@@ -143,9 +143,9 @@ as the default font family.
.TP
.BI \-m name
Read in the file
-.BI tmac. name\fR.
+.IB name .tmac\fR.
If it isn't found, try
-.IB name .tmac
+.BI tmac. name
instead.
Normally this will be searched for in @LOCALMACRODIR@ or @MACRODIR@.
.TP
@@ -1049,7 +1049,7 @@ are counted; explicit hyphens are not.
Read hyphenation patterns from
.IR file ;
this will be searched for in the same way that
-.BI tmac. name
+.IB name .tmac
is searched for when the
.BI \-m name
option is specified.
@@ -1131,12 +1131,12 @@ the
command line option.
If the file name to be included
has the form
-.BI tmac. name
+.IB name .tmac
and it isn't found,
.B mso
tries to include
-.IB name .tmac
-instead.
+.BI tmac. name
+instead and vice versa.
.TP
.BI .nop \ anything
Execute
@@ -2215,9 +2215,9 @@ Initialization file (called before any other macro package).
.B @MACRODIR@/troffrc-end
Initialization file (called after any other macro package).
.TP
-.BI @MACRODIR@/tmac. name
-.TQ
.BI @MACRODIR@/ name .tmac
+.TQ
+.BI @MACRODIR@/tmac. name
Macro files
.TP
.BI @FONTDIR@/dev name /DESC
diff --git a/test-groff b/test-groff
index 21567e40..88ee77bc 100644
--- a/test-groff
+++ b/test-groff
@@ -37,7 +37,7 @@ export XENVIRONMENT
GROFF_COMMAND_PREFIX=
GROFF_FONT_PATH=$builddir:$srcdir/font
-GROFF_TMAC_PATH=$srcdir/tmac:$srcdir/src/roff/troff
+GROFF_TMAC_PATH=$srcdir/tmac
export PATH GROFF_COMMAND_PREFIX GROFF_FONT_PATH GROFF_TMAC_PATH
exec $builddir/roff/groff/groff ${1+"$@"}
diff --git a/tmac/groff_tmac.man b/tmac/groff_tmac.man
index 70a3b3ae..a52beef9 100755
--- a/tmac/groff_tmac.man
+++ b/tmac/groff_tmac.man
@@ -172,11 +172,11 @@ run-time, the groff option
.option \-m \ \c
.argument name
makes the definitions in the macro file
-.BI tmac. name
+.IB name .tmac
available as described in the section
.BR NAMING .
If this file isn't found,
-.IB name .tmac
+.BI tmac. name
will be searched.
.LP
It is also possible to include the macro file into the document by using
@@ -193,12 +193,12 @@ convenient to use
.request .mso
instead because it searches the tmac path for the filename.
Additionally, if the file name to be included has the form
-.BI tmac. name
+.IB name .tmac
and it isn't found,
.request .mso
will try to open
-.IB name .tmac
-instead.
+.BI tmac. name
+instead and vice versa.
.LP
Note that in order to resolve the
.request .so
@@ -206,8 +206,9 @@ and
.request .mso
requests the roff preprocessor
.shellcommand soelim
-must be called. This can be done either directly by a pipeline on the
-command line or by using the
+must be called if the files to be included needs preprocessing.
+This can be done either directly by a pipeline on the command line or by
+using the
.option \-s
option of
.shellcommand groff .
@@ -295,9 +296,9 @@ request as described in the
section.
.LP
To use the tmac functionality, call the macro file
-.BI tmac. whatever
+.IB whatever .tmac
(or
-.IB whatever .tmac\c
+.BI tmac. whatever\c
) and put it in some directory of the tmac path, cf. section
.BR FILES .
Then documents can include it with the
@@ -346,15 +347,15 @@ and
.SH FILES
.\" --------------------------------------------------------------------
All macro names must be named
-.BI tmac. name
-or
.IB name .tmac
+or
+.BI tmac. name
to use the tmac mechanism.
.LP
The macro files are kept in the
.B tmac
.BR directories ,
-all of which constitue the
+all of which constitute the
.B tmac
.BR path.
In accordance with the Filesystem Hierarchy Standard (FHS), the standard