-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgloss.m4
83 lines (78 loc) · 1.94 KB
/
gloss.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
dnl Copyright(2000): Albert van der Horst, HCC FIG Holland by GNU Public License
dnl $Id: gloss.m4,v 5.5 2012/09/25 19:08:33 albert Exp $
dnl NOTE IT DOESN'T WORK WITHOUT THE NEW LINE FOR THE RECURSIVE CALL
dnl TO FORALL. THIS IS RATHER MYSTERIOUS.
changequote({,})dnl
undefine({shift})dnl
define({forall}, {ifelse(len({$2}),0,,
{$1}({{{{{{$2}}}}}})
{forall({$1},{$3},{$4},{$5},{$6},{$7},{$8},{$9},{$10})}
)})dnl
dnl Define a word definition on channel 9
dnl the corresponding menu item on channel 6
dnl and the content including a definition for the second pass on channel 1
define({quote},{{{$1}}})
define({worddoccommon},{
divert(9)dnl
@node $8, _next$3(), _prev(), MyTop()
@subsection {$2}ifelse({$2},{'},{ (This addition because texinfo won't accept a single {quote}) })
@pindex $2
@findex $2
@noindent
Name: @code{{{{{{$2}}}}}}
@noindent
ifelse($4,,
{No stackeffect},
{Stackeffect: $4})
@noindent
Attributes: $5
@noindent
Description:
$6
ifelse(len({$7}),0,, {@noindent
See also: forall({forthsamp},$7)})dnl
{define({_prev},{$8})dnl}
divert(1)dnl
{{{$8}})dnl
define({_next$3},}dnl
divert(6)dnl
* $2 :ifelse($9,,:,$9)
divert(9)dnl
})dnl
define({worddocchapter},
dnl Another macro call, resolved at yet a higher level
wordsetnode_$1()
{$2}
{$3}
{$4}
{{define({MyTop},{{$1}})dnl}}
dnl Leave the first half of the first definition (unused)
{divert(1)dnl}
{{
define({{_dummy_}},dnl}}
dnl Initialise menu channel
dnl Normal description comes after the definitions but before the menu's
dnl and contents.
{divert(6)dnl}
{{dnl
define({_prev},{{$1}})dnl}}
{
@menu}
)
define({worddoc},
{worddoccommon({$1},{$2},{$3},{$4},{$5},{$6},{$7},{$2},)}
)dnl
define({worddocsafe},
{worddoccommon({$1},{$2},{$3},{$4},{$5},{$6},{$7},{$3},{$3})}
)dnl
define({worddocchapterend},
dnl Complete the last half of the last definition empty
{divert(1)dnl}
{{)dnl}}
dnl Close menu channel
{divert(6)dnl}
{{@end menu}}
{divert}
{undivert}
)
{define({MyTop},{Glossary})dnl}