summaryrefslogtreecommitdiff
path: root/doc/examples/WWW/m4lib/visions.m4
blob: ba238ca9a111c6c7bd5fee3870758ad1f1c333ef (plain)
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
include(`setup.m4')

\set_author([René Seindal])
\set_title([The Road Ahead])

\define([originator],
[\p([Idea contributed by [$1]]\ifelse($#, 2, [ (\mailto([$2]))])[.])])

\define([noone], [\p([There is no-one working on this now.  Do you want
to <A HREF="mailto:m4-feedback@seindal.dk?subject=GNU m4: \defn([_item])" >volunteer</A>?])])


\define([done], [\p([Done in version 1.4$1])])


\divert(1)
\h2([Ideas for future versions of GNU m4])

\p([Here are some ideas and suggestion for the future of GNU m4, large
and small.  The order here is fairly random.])

\ul([

\item([guile], [Guile as an extension language],

[\p([\link([http://www.red-bean.com/guile/], [Guile]) can be used as an
extension language so complicated macros can be written in Scheme while
still maintaining the m4 interface.  It will require some changes to the
base code, as guile cannot be used from a module.])

\noone <!-- \originator([René Seindal], [rene@seindal]) -->
])


\item([utf8], [UTF-8 or wide characters],

[\p([GNU m4 should be able to handle UTF-8 input or wide characters so
it can be more usable for different environments.])

\noone <!-- \originator([François Pinard]) -->
])


\item([pquote], [Syntax: persistent quotes],

[\p([Persistent quotes is a way of getting text unharmed through m4's
processing.  While normal quotes are stripped when a quoted string is
read, the persistent quotes are removed just before being output.  This
will ensure that the quoted text is always output verbatim.])

\p([The bulk of the changes will be in the parser (in input.c function
next_token).  Persistent quotes cannot be nested, they must balance
within a normally quoted string, but normal quotes need not balance
within persistent quotes (neither within persistent quotes within normal
quotes).  The quotes should be removed before being shipped out (in
macro.c).])

\noone <!-- \originator([Keith Bostic]) -->
])




\item([comment2], [Syntax: removable comments],

[\p([With the syntax table a category for discardable comments can be
defined, causing that type of comments to be discarded.])

\noone
])




\item([comment1], [Option:  remove comments],

[\p([There should be an option (--discard-comments) to get m4 to discard
comments instead of passing them to the output.])

\done(n)
])



\item([deps], [Option: show dependencies],

[\p([There should be an options to generate makefile dependencies for an
M4 input file.])

\p([It is not enough to scan the files for includes, as file names can
be generated and builtins renamed.  To make it work, m4 will have to do
a complete run of the input file, discard the output and print the
dependencies instead.])

\p([It cannot be made to work in all cases when input file names are
generated on the fly.])

\noone  <!-- \originator([Erick Branderhorst]) -->
])


\item([safer], [Option: render GNU m4 safer],

[\p([There should be a --safer option that disables all functions, that
could compromise system security if used by root.  It will have to
include various functions, such as file inclusion, sub shells, module
loading, ...])

\noone  <!-- \originator([Santiago Vila]) -->
])



\item([import], [Option: import environment],

[\p([An option to defined each environment variable as a macro on
startup would be useful in many cases.])

\done(n)  <!-- \originator([René Seindal]) -->
])



\item([m4expand], [Builtin: quote expanded text],

[\p([A builtin to quote expanded text would be useful.  Now it is not
possible to quote the expansion of a macro; the macro itself has to
provide the quotes.  Some builtins return quoted strings, others
don't.])

\p([A possible solution is a build in macro that takes one argument.  It
expands this argument fully and returns the quoted expansion.])

\p([It will require changes to input handling and macro expansion code.])

\noone  <!-- \originator([Axel Boldt]) -->
])



\item([perl], [Module: embedded perl],

[\p([Perl could be embedded in m4, giving users a powerful programming
language for writing macros.  A single builtin "perleval" could do the
job.  First argument could be a perl function and the rest arguments.
The return value of the function as a string would be the expansion.])

\p([The perl interpreter should be set up when the module is loaded and
closed down before m4 exits, using the appropriate hooks in the module
interface.])

\p([A perl module could potentially give users access to any facility
perl has access to, such as databases.])

\p([On systems with perl compiled as a shared library the size penalty
would be minimal.])

\p([(It might not be workable as a module, as it will need to link with non-shared libraries.  Don't know how it can be fixed.  (RS))])

\noone <!-- \originator([René Seindal]) -->
])



\item([output], [Module: better output control],

[\p([It has been suggested a couple of times that it should be possible
to divert to named files, in order to create several output files.])

\p([I think this a bit a misunderstanding.  Diversion are inteded to be
brought back later, ie, they are temporary and recoverable.  Output
text, on the other hand, once output it is lost (for m4).  Therefore
better output control should be made in a different way.])

\p([My suggestion is a set of builtins defined by a module:])

\pre([setoutput(file)
appendoutput(file)
pipeoutput(command)])

\p([With these output can be directed better, diversion can be sent to
different files, and groups of files can be built by a single m4 run.
Calling \tt(setoutput) without arguments should resume output to
standard output.])

\p([(Admittedly, diversion 0 (standard output) has always been
different, as it cannot be undiverted.)])

\noone <!-- \originator([René Seindal]) -->
])



\item([require], [Module: require/provide functionality],

[\p([Two new builtins \tt(require) and \tt(provide) could provide a
handy interface to include.  It has proven difficult to write these
robustly as normal macros.  As an example, the files \tt(test.m4) and
\tt(../test.m4) could be the same file or different files depending on
the search path.])

\noone <!-- \originator([Terry Jones]) -->
])


])



\p([See also the \link(todo.htm, TODO) file.])

\print_items



\divert(0)\dnl
\DO_LAYOUT([\undivert(1)])
\divert(-1)

\divert(3)saljdfnaskdjfndsa\divert(-1)




\item([], [],

[\p([])

\noone
])

\undivert