Add support for auto-generating info/dir
[bpt/emacs.git] / doc / misc / autotype.texi
CommitLineData
4009494e
GM
1\input texinfo
2@c This is an annex of the Emacs manual.
4009494e 3@c Author: Daniel.Pfeiffer@Informatik.START.dbp.de, fax (+49 69) 7588-2389
db78a8cb 4@setfilename ../../info/autotype
4009494e
GM
5@c @node Autotypist, Picture, Abbrevs, Top
6@c @chapter Features for Automatic Typing
7@settitle Features for Automatic Typing
8@c @cindex text
9@c @cindex selfinserting text
10@c @cindex autotypist
11
12@copying
ab422c4d 13Copyright @copyright{} 1994--1995, 1999, 2001--2013
6bf430d1 14Free Software Foundation, Inc.
4009494e
GM
15
16@quotation
17Permission is granted to copy, distribute and/or modify this document
6a2c4aec 18under the terms of the GNU Free Documentation License, Version 1.3 or
7b2d06e1
GM
19any later version published by the Free Software Foundation; with no
20Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
21and with the Back-Cover Texts as in (a) below. A copy of the license
22is included in the section entitled ``GNU Free Documentation License''.
4009494e 23
6f093307 24(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
6bf430d1 25modify this GNU manual.''
4009494e
GM
26@end quotation
27@end copying
28
0c973505 29@dircategory Emacs misc features
4009494e 30@direntry
f9405d87
GM
31* Autotype: (autotype). Convenient features for text that you enter
32 frequently in Emacs.
4009494e
GM
33@end direntry
34
35@titlepage
36@sp 10
37
38@center @titlefont{Autotyping}
39@sp 2
605f02ee 40@center Convenient features for text that you enter frequently in Emacs
4009494e
GM
41@sp 2
42@center Daniel Pfeiffer
43@center additions by Dave Love
44
45@page
46@vskip 0pt plus 1filll
47@insertcopying
48@end titlepage
49
5dc584b5
KB
50@contents
51
4009494e
GM
52@node Top
53@top Autotyping
54
55 Under certain circumstances you will find yourself typing similar things
56over and over again. This is especially true of form letters and programming
57language constructs. Project-specific header comments, flow-control
58constructs or magic numbers are essentially the same every time. Emacs has
59various features for doing tedious and repetitive typing chores for you
88edc57f 60in addition to the Abbrev features (@pxref{Abbrevs,,, emacs, The GNU Emacs Manual}).
4009494e
GM
61
62 One solution is using skeletons, flexible rules that say what to
63insert, and how to do it. Various programming language modes offer some
64ready-to-use skeletons, and you can adapt them to suit your needs or
65taste, or define new ones.
66
67 Another feature is automatic insertion of what you want into empty files,
68depending on the file-name or the mode as appropriate. You can have a file or
69a skeleton inserted, or you can call a function. Then there is the
70possibility to have Un*x interpreter scripts automatically take on a magic
71number and be executable as soon as they are saved. Or you can have a
72copyright notice's year updated, if necessary, every time you save a
73file. Similarly for time stamps in the file.
74
75 URLs can be inserted based on a word at point. Flexible templates can
76be defined for inserting and navigating between text more generally. A
77sort of meta-expansion facility can be used to try a set of alternative
78completions and expansions of text at point.
79
5dc584b5
KB
80@ifnottex
81@insertcopying
82@end ifnottex
83
4009494e
GM
84@menu
85* Using Skeletons:: How to insert a skeleton into your text.
86* Wrapping Skeletons:: Putting existing text within a skeleton.
87* Skeletons as Abbrevs:: An alternative for issuing skeleton commands.
88* Skeleton Language:: Making skeleton commands insert what you want.
89* Inserting Pairs:: Typing one character and getting another
90 after point.
91* Autoinserting:: Filling up empty files as soon as you visit them.
92* Copyrights:: Inserting and updating copyrights.
9360256a 93* Executables:: Turning interpreter scripts into executables.
4009494e
GM
94* Timestamps:: Updating dates and times in modified files.
95* QuickURL:: Inserting URLs based on text at point.
96* Tempo:: Flexible template insertion.
97* Hippie Expand:: Expansion of text trying various methods.
98
99* GNU Free Documentation License:: The license for this documentation.
100* Concept Index::
101* Command Index::
102* Variable Index::
103@end menu
104
105
4009494e
GM
106@node Using Skeletons
107@chapter Using Skeletons
108@cindex skeletons
109@cindex using skeletons
110
111 When you want Emacs to insert a form letter or a typical construct of the
112programming language you are using, skeletons are a means of accomplishing
113this. Normally skeletons each have a command of their own, that, when called,
114will insert the skeleton. These commands can be issued in the usual ways
88edc57f 115(@pxref{Commands,,, emacs, The GNU Emacs Manual}). Modes that offer various skeletons will often
4009494e
GM
116bind these to key-sequences on the @kbd{C-c} prefix, as well as having
117an @cite{Insert} menu and maybe even predefined abbrevs for them
118(@pxref{Skeletons as Abbrevs}).
119
120 The simplest kind of skeleton will simply insert some text indented
121according to the major mode and leave the cursor at a likely place in the
122middle. Interactive skeletons may prompt you for a string that will be part
123of the inserted text.
124
125 Skeletons may ask for input several times. They even have a looping
126mechanism in which you will be asked for input as long as you are willing to
127furnish it. An example would be multiple ``else if'' conditions. You can
128recognize this situation by a prompt ending in @key{RET}, @kbd{C-g}
129or @kbd{C-h}. This
130means that entering an empty string will simply assume that you are finished.
131Typing quit on the other hand terminates the loop but also the rest of the
1df7defd 132skeleton, e.g., an ``else'' clause is skipped. Only a syntactically necessary
4009494e
GM
133termination still gets inserted.
134
135
136
137@node Wrapping Skeletons
138@chapter Wrapping Skeletons Around Existing Text
139@cindex wrapping skeletons
140
141 Often you will find yourself with some code that for whatever reason
142suddenly becomes conditional. Or you have written a bit of text and want to
143put it in the middle of a form letter. Skeletons provide a means for
144accomplishing this, and can even, in the case of programming languages,
145reindent the wrapped code for you.
146
147 Skeleton commands take an optional numeric prefix argument
88edc57f 148(@pxref{Arguments,,, emacs, The GNU Emacs Manual}). This is interpreted in two different ways depending
1df7defd
PE
149on whether the prefix is positive, i.e., forwards oriented, or negative,
150i.e., backwards oriented.
4009494e
GM
151
152 A positive prefix means to wrap the skeleton around that many
153following words. This is accomplished by putting the words there where
154the point is normally left after that skeleton is inserted (@pxref{Using
88edc57f 155Skeletons}). The point (@pxref{Point,,, emacs, The GNU Emacs Manual}) is left at the next
4009494e
GM
156interesting spot in the skeleton instead.
157
e1dbe924 158 A negative prefix means to do something similar with that many previously
88edc57f 159marked interregions (@pxref{Mark,,, emacs, The GNU Emacs Manual}). In the simplest case, if you type
4009494e
GM
160@kbd{M--} just before issuing the skeleton command, that will wrap the
161skeleton around the current region, just like a positive argument would have
162wrapped it around a number of words.
163
164 Smaller negative arguments will wrap that many interregions into successive
165interesting spots within the skeleton, again leaving the point at the next one.
166We speak about interregions rather than regions here, because we treat them in
167the order they appear in the buffer, which coincides with successive regions
168only if they were marked in order.
169
170 That is, if you marked in alphabetical order the points A B C [] (where []
171represents the point) and call a skeleton command with @kbd{M-- 3}, you will
172wrap the text from A to B into the first interesting spot of the skeleton, the
173text from B to C into the next one, the text from C to the point into the
174third one, and leave the point in the fourth one. If there are less marks in
175the buffer, or if the skeleton defines less interesting points, the surplus is
176ignored.
177
178 If, on the other hand, you marked in alphabetical order the points [] A C B,
179and call a skeleton command with @kbd{M-- 3}, you will wrap the text from
1df7defd 180point to A, then the text from A to C and finally the text from C to B@. This
4009494e
GM
181is done because the regions overlap and Emacs would be helplessly lost if it
182tried to follow the order in which you marked these points.
183
184
185
186@node Skeletons as Abbrevs
187@chapter Skeletons as Abbrev Expansions
188@cindex skeletons as abbrevs
189
190 Rather than use a key binding for every skeleton command, you can also
88edc57f
GM
191define an abbreviation (@pxref{Defining Abbrevs,,, emacs, The GNU Emacs Manual}) that will expand
192(@pxref{Expanding Abbrevs,,, emacs, The GNU Emacs Manual}) into the skeleton.
4009494e
GM
193
194 Say you want @samp{ifst} to be an abbreviation for the C language if
195statement. You will tell Emacs that @samp{ifst} expands to the empty string
196and then calls the skeleton command. In Emacs Lisp you can say something like
197@code{(define-abbrev c-mode-abbrev-table "ifst" "" 'c-if)}. Or you can edit
198the output from @kbd{M-x list-abbrevs} to make it look like this:
199
200@example
201(c-mode-abbrev-table)
9360256a 202"if" 0 "" c-if
4009494e
GM
203@end example
204
205@noindent
206(Some blank lines of no semantic significance, and other abbrev tables,
207have been omitted.)
208
209
210
211@node Skeleton Language
212@chapter Skeleton Language
213@cindex skeleton language
214
215@findex skeleton-insert
216 Skeletons are an shorthand extension to the Lisp language, where various
217atoms directly perform either actions on the current buffer or rudimentary
218flow control mechanisms. Skeletons are interpreted by the function
219@code{skeleton-insert}.
220
221 A skeleton is a list starting with an interactor, which is usually a
222prompt-string, or @code{nil} when not needed, but can also be a Lisp
223expression for complex read functions or for returning some calculated value.
224The rest of the list are any number of elements as described in the following
225table:
226
227@table @asis
228@item @code{"@var{string}"}, @code{?@var{c}}, @code{?\@var{c}}
229@vindex skeleton-transformation
230Insert string or character. Literal strings and characters are passed through
231@code{skeleton-transformation} when that is non-@code{nil}.
232@item @code{?\n}
233@c ??? something seems very wrong here.
234Insert a newline and align under current line. Use newline character
235@code{?\n} to prevent alignment.
236@item @code{_}
237Interesting point. When wrapping skeletons around successive regions, they are
238put at these places. Point is left at first @code{_} where nothing is wrapped.
239@item @code{>}
240Indent line according to major mode. When following element is @code{_}, and
241there is a interregion that will be wrapped here, indent that interregion.
242@item @code{&}
1df7defd 243Logical and. Iff preceding element moved point, i.e., usually inserted
4009494e
GM
244something, do following element.
245@item @code{|}
1df7defd 246Logical xor. Iff preceding element didn't move point, i.e., usually inserted
4009494e
GM
247nothing, do following element.
248@item @code{-@var{number}}
249Delete preceding number characters. Depends on value of
250@code{skeleton-untabify}.
251@item @code{()} or @code{nil}
252Ignored.
253@item @var{lisp-expression}
254Evaluated, and the return value is again interpreted as a skeleton element.
255@item @code{str}
256A special variable that, when evaluated the first time, usually prompts
257for input according to the skeleton's interactor. It is then set to the
258return value resulting from the interactor. Each subskeleton has its local
259copy of this variable.
260@item @code{v1}, @code{v2}
261Skeleton-local user variables.
262@item @code{'@var{expression}}
263Evaluate following Lisp expression for its side-effect, but prevent it from
264being interpreted as a skeleton element.
265@item @var{skeleton}
266Subskeletons are inserted recursively, not once, but as often as the user
267enters something at the subskeletons interactor. Thus there must be a
268@code{str} in the subskeleton. They can also be used non-interactively, when
269prompt is a lisp-expression that returns successive list-elements.
270@item @code{resume:}
271Ignored. Execution resumes here if the user quits during skeleton
272interpretation.
273@item @code{quit}
274A constant which is non-@code{nil} when the @code{resume:} section was entered
275because the user quit.
276@end table
277
278@findex skeleton-further-elements
279 Some modes also use other skeleton elements they themselves defined. For
280example in shell script mode's skeletons you will find @code{<} which does a
281rigid indentation backwards, or in CC mode's skeletons you find the
282self-inserting elements @code{@{} and @code{@}}. These are defined by the
283buffer-local variable @code{skeleton-further-elements} which is a list of
284variables bound while interpreting a skeleton.
285
286@findex define-skeleton
287 The macro @code{define-skeleton} defines a command for interpreting a
288skeleton. The first argument is the command name, the second is a
289documentation string, and the rest is an interactor and any number of skeleton
290elements together forming a skeleton. This skeleton is assigned to a variable
291of the same name as the command and can thus be overridden from your
88edc57f 292@file{~/.emacs} file (@pxref{Init File,,, emacs, The GNU Emacs Manual}).
4009494e
GM
293
294
295
296@node Inserting Pairs
297@chapter Inserting Matching Pairs of Characters
298@cindex inserting pairs
299@cindex pairs
300
301 Various characters usually appear in pairs. When, for example, you insert
302an open parenthesis, no matter whether you are programming or writing prose,
303you will surely enter a closing one later. By entering both at the same time
304and leaving the cursor inbetween, Emacs can guarantee you that such
305parentheses are always balanced. And if you have a non-qwerty keyboard, where
306typing some of the stranger programming language symbols makes you bend your
307fingers backwards, this can be quite relieving too.
308
309@findex skeleton-pair-insert-maybe
310@vindex skeleton-pair
88edc57f 311 This is done by binding the first key (@pxref{Rebinding,,, emacs, The GNU Emacs Manual}) of
4009494e
GM
312the pair to @code{skeleton-pair-insert-maybe} instead of
313@code{self-insert-command}. The ``maybe'' comes from the fact that
314this at-first surprising behavior is initially turned off. To enable
315it, you must set @code{skeleton-pair} to some non-@code{nil} value.
88edc57f 316And even then, a positive argument (@pxref{Arguments,,, emacs, The GNU Emacs Manual}) will
4009494e 317make this key behave like a self-inserting key
88edc57f 318(@pxref{Inserting Text,,, emacs, The GNU Emacs Manual}).
4009494e
GM
319
320@vindex skeleton-pair-on-word
321 While this breaks with the stated intention of always balancing pairs, it
322turns out that one often doesn't want pairing to occur, when the following
323character is part of a word. If you want pairing to occur even then, set
324@code{skeleton-pair-on-word} to some non-@code{nil} value.
325
326@vindex skeleton-pair-alist
327 Pairing is possible for all visible characters. By default the
328parenthesis @samp{(}, the square bracket @samp{[}, the brace
329@samp{@{}, the pointed bracket @samp{<} and the backquote @samp{`} all
330pair with the symmetrical character. All other characters pair
331themselves. This behavior can be modified by the variable
332@code{skeleton-pair-alist}. This is in fact an alist of skeletons
333(@pxref{Skeleton Language}), with the first part of each sublist
334matching the typed character. This is the position of the interactor,
335but since pairs don't need the @code{str} element, this is ignored.
336
337 Some modes have bound the command @code{skeleton-pair-insert-maybe}
338to relevant keys. These modes also configure the pairs as
339appropriate. For example, when typing english prose, you'd expect the
340backquote (@samp{`}) to pair with the quote (@samp{'}), while in Shell
341script mode it must pair to itself. They can also inhibit pairing in
342certain contexts. For example an escaped character stands for itself.
343
344
345
346@node Autoinserting
347@chapter Autoinserting Text in Empty Files
348@cindex autoinserting
349
350@findex auto-insert
351 @kbd{M-x auto-insert} will put some predefined text at the beginning of
352the buffer. The main application for this function, as its name suggests,
353is to have it be called automatically every time an empty, and only an
354empty file is visited. This is accomplished by putting @code{(add-hook
355'find-file-hook 'auto-insert)} into your @file{~/.emacs} file
88edc57f 356(@pxref{Init File,,, emacs, The GNU Emacs Manual}).
4009494e
GM
357
358@vindex auto-insert-alist
359 What gets inserted, if anything, is determined by the variable
360@code{auto-insert-alist}. The @sc{car}s of this list are each either
361a mode name, making an element applicable when a buffer is in that
362mode. Or they can be a string, which is a regexp matched against the
363buffer's file name. In that way different kinds of files that have
364the same mode in Emacs can be distinguished. The @sc{car}s may also
365be cons cells consisting of mode name or regexp as above and an
366additional descriptive string.
367
368 When a matching element is found, the @sc{cdr} says what to do. It may
369be a string, which is a file name, whose contents are to be inserted, if
370that file is found in the directory @code{auto-insert-directory} or under a
371absolute file name. Or it can be a skeleton (@pxref{Skeleton Language}) to
372be inserted.
373
374 It can also be a function, which allows doing various things. The function
375can simply insert some text, indeed, it can be skeleton command (@pxref{Using
376Skeletons}). It can be a lambda function which will for example conditionally
377call another function. Or it can even reset the mode for the buffer. If you
1df7defd 378want to perform several such actions in order, you use a vector, i.e., several
4009494e
GM
379of the above elements between square brackets (@samp{[@r{@dots{}}]}).
380
381 By default C and C++ headers insert a definition of a symbol derived from
382the filename to prevent multiple inclusions. C and C++ sources insert an
383include of the header. Makefiles insert the file makefile.inc if it exists.
384
385 TeX and bibTeX mode files insert the file tex-insert.tex if it exists, while
386LaTeX mode files insert a typical @code{\documentclass} frame. Html
387files insert a skeleton with the usual frame.
388
389 Ada mode files call the Ada header skeleton command. Emacs lisp
390source files insert the usual header, with a copyright of your
391environment variable @env{$ORGANIZATION} or else the FSF, and prompt
392for valid keywords describing the contents. Files in a @file{bin}
393directory for which Emacs could determine no specialized mode
88edc57f 394(@pxref{Choosing Modes,,, emacs, The GNU Emacs Manual}) are set to Shell script mode.
4009494e
GM
395
396@findex define-auto-insert
88edc57f 397 In Lisp (@pxref{Init File,,, emacs, The GNU Emacs Manual}) you can use the function
4009494e
GM
398@code{define-auto-insert} to add to or modify
399@code{auto-insert-alist}. See its documentation with @kbd{C-h f
400define-auto-insert}.
401
402@vindex auto-insert
403 The variable @code{auto-insert} says what to do when @code{auto-insert} is
1df7defd 404called non-interactively, e.g., when a newly found file is empty (see above):
4009494e
GM
405@table @asis
406@item @code{nil}
407Do nothing.
408@item @code{t}
1df7defd 409Insert something if possible, i.e., there is a matching entry in
4009494e
GM
410@code{auto-insert-alist}.
411@item other
412Insert something if possible, but mark as unmodified.
413@end table
414
415@vindex auto-insert-query
416 The variable @code{auto-insert-query} controls whether to ask about
417inserting something. When this is @code{nil}, inserting is only done with
418@kbd{M-x auto-insert}. When this is @code{function}, you are queried
419whenever @code{auto-insert} is called as a function, such as when Emacs
420visits an empty file and you have set the above-mentioned hook. Otherwise
e4920bc9 421you are always queried.
4009494e
GM
422
423@vindex auto-insert-prompt
424 When querying, the variable @code{auto-insert-prompt}'s value is used as a
425prompt for a y-or-n-type question. If this includes a @samp{%s} construct,
426that is replaced by what caused the insertion rule to be chosen. This is
427either a descriptive text, the mode-name of the buffer or the regular
428expression that matched the filename.
429
430
431
432@node Copyrights
433@chapter Inserting and Updating Copyrights
434@cindex copyrights
435
436@findex copyright
437 @kbd{M-x copyright} is a skeleton inserting command, that adds a copyright
438notice at the point. The ``by'' part is taken from your environment variable
439@env{$ORGANIZATION} or if that isn't set you are prompted for it. If the
88edc57f 440buffer has a comment syntax (@pxref{Comments,,, emacs, The GNU Emacs Manual}), this is inserted as a comment.
4009494e
GM
441
442@findex copyright-update
443@vindex copyright-limit
444@vindex copyright-current-year
445 @kbd{M-x copyright-update} looks for a copyright notice in the first
446@code{copyright-limit} characters of the buffer and updates it when necessary.
447The current year (variable @code{copyright-current-year}) is added to the
1df7defd 448existing ones, in the same format as the preceding year, i.e., 1994, '94 or 94.
4009494e
GM
449If a dash-separated year list up to last year is found, that is extended to
450current year, else the year is added separated by a comma. Or it replaces
451them when this is called with a prefix argument. If a header referring to a
88edc57f 452wrong version of the GNU General Public License (@pxref{Copying,,, emacs, The GNU Emacs Manual}) is found,
4009494e
GM
453that is updated too.
454
455 An interesting application for this function is to have it be called
456automatically every time a file is saved. This is accomplished by
457putting @code{(add-hook 'before-save-hook 'copyright-update)} into
88edc57f 458your @file{~/.emacs} file (@pxref{Init File,,, emacs, The GNU Emacs Manual}). Alternative,
4009494e
GM
459you can do @kbd{M-x customize-variable @key{RET} before-save-hook
460@key{RET}}. @code{copyright-update} is conveniently listed as an
461option in the customization buffer.
462
463@vindex copyright-query
464 The variable @code{copyright-query} controls whether to update the
465copyright or whether to ask about it. When this is @code{nil} updating is
466only done with @kbd{M-x copyright-update}. When this is @code{function}
467you are queried whenever @code{copyright-update} is called as a function,
468such as in the @code{before-save-hook} feature mentioned above. Otherwise
469you are always queried.
470
471
472
473@node Executables
474@chapter Making Interpreter Scripts Executable
475@cindex executables
476
477@vindex executable-prefix
478@vindex executable-chmod
479 Various interpreter modes such as Shell script mode or AWK mode will
480automatically insert or update the buffer's magic number, a special
481comment on the first line that makes the @code{exec} systemcall know
482how to execute the script. To this end the script is automatically
483made executable upon saving, with @code{executable-chmod} as argument
484to the system @code{chmod} command. The magic number is prefixed by
485the value of @code{executable-prefix}.
486
487@vindex executable-magicless-file-regexp
488 Any file whose name matches @code{executable-magicless-file-regexp} is not
489furnished with a magic number, nor is it made executable. This is mainly
490intended for resource files, which are only meant to be read in.
491
492@vindex executable-insert
493 The variable @code{executable-insert} says what to do when
1df7defd 494@code{executable-set-magic} is called non-interactively, e.g., when file has no
4009494e
GM
495or the wrong magic number:
496@table @asis
497@item @code{nil}
498Do nothing.
499@item @code{t}
500Insert or update magic number.
501@item other
502Insert or update magic number, but mark as unmodified.
503@end table
504
505@findex executable-set-magic
506@vindex executable-query
507 The variable @code{executable-query} controls whether to ask about
508inserting or updating the magic number. When this is @code{nil} updating
509is only done with @kbd{M-x executable-set-magic}. When this is
510@code{function} you are queried whenever @code{executable-set-magic} is
511called as a function, such as when Emacs puts a buffer in Shell script
e4920bc9 512mode. Otherwise you are always queried.
4009494e
GM
513
514@findex executable-self-display
515 @kbd{M-x executable-self-display} adds a magic number to the buffer, which
516will turn it into a self displaying text file, when called as a Un*x command.
517The ``interpreter'' used is @code{executable-self-display} with argument
518@samp{+2}.
519
520@node Timestamps
521@chapter Maintaining Timestamps in Modified Files
522@cindex timestamps
523
524@findex time-stamp
525@vindex before-save-hook
526The @code{time-stamp} command can be used to update automatically a
527template in a file with a new time stamp every time you save the file.
528Customize the hook @code{before-save-hook} to add the function
529@code{time-stamp} to arrange this. It you use Custom to do this,
530then @code{time-stamp} is conveniently listed as an option in the
531customization buffer.
532
533@vindex time-stamp-active
534@vindex time-stamp-format
535@vindex time-stamp-start
536The time stamp is updated only if the customizable variable
537@code{time-stamp-active} is on, which it is by default; the command
538@code{time-stamp-toggle-active} can be used to toggle it. The format of
539the time stamp is set by the customizable variable
540@code{time-stamp-format}.
541
542@vindex time-stamp-line-limit
543@vindex time-stamp-end
544@vindex time-stamp-count
545@vindex time-stamp-inserts-lines
546The variables @code{time-stamp-line-limit}, @code{time-stamp-start},
547@code{time-stamp-end}, @code{time-stamp-count}, and
548@code{time-stamp-inserts-lines} control finding the template. Do not
549change these in your init file or you will be incompatible with other
550people's files. If you must change them, do so only in the local
551variables section of the file itself.
552
553Normally the template must appear in the first 8 lines of a file and
554look like one of the following:
555
556@example
557Time-stamp: <>
558Time-stamp: " "
559@end example
560
561The time stamp is written between the brackets or quotes:
562
563@example
564Time-stamp: <1998-02-18 10:20:51 gildea>
565@end example
566
567@node QuickURL
568@chapter QuickURL: Inserting URLs Based on Text at Point
569
570@vindex quickurl-url-file
571@findex quickurl
572@cindex URLs
573@kbd{M-x quickurl} can be used to insert a URL into a buffer based on
574the text at point. The URLs are stored in an external file defined by
575the variable @code{quickurl-url-file} as a list of either cons cells of
576the form @code{(@var{key} . @var{URL})} or
577lists of the form @code{(@var{key} @var{URL} @var{comment})}. These
578specify that @kbd{M-x quickurl} should insert @var{URL} if the word
579@var{key} is at point, for example:
580
581@example
582(("FSF" "http://www.fsf.org/" "The Free Software Foundation")
583 ("emacs" . "http://www.emacs.org/")
584 ("hagbard" "http://www.hagbard.demon.co.uk" "Hagbard's World"))
585@end example
586
587@findex quickurl-add-url
588@findex quickurl-list
589@kbd{M-x quickurl-add-url} can be used to add a new @var{key}/@var{URL}
590pair. @kbd{M-x quickurl-list} provides interactive editing of the URL
591list.
592
593@node Tempo
594@chapter Tempo: Flexible Template Insertion
595
596@cindex templates
597The Tempo package provides a simple way to define powerful templates, or
598macros, if you wish. It is mainly intended for, but not limited to,
599programmers to be used for creating shortcuts for editing
600certain kinds of documents.
601
602@findex tempo-backward-mark
603@findex tempo-forward-mark
604A template is defined as a list of items to be inserted in the current
605buffer at point. Some can be simple strings, while others can control
606formatting or define special points of interest in the inserted text.
607@kbd{M-x tempo-backward-mark} and @kbd{M-x tempo-forward-mark} can be
608used to jump between such points.
609
610More flexible templates can be created by including Lisp symbols, which
611will be evaluated as variables, or lists, which will be evaluated
612as Lisp expressions. Automatic completion of specified tags to expanded
613templates can be provided.
614
615@findex tempo-define-template
616See the documentation for @code{tempo-define-template} for the different
617items that can be used to define a tempo template with a command for
618inserting it.
619
620See the commentary in @file{tempo.el} for more information on using the
621Tempo package.
622
623@node Hippie Expand
624@chapter `Hippie' Expansion
625
626@findex hippie-expand
627@kindex M-/
628@vindex hippie-expand-try-functions-list
629@kbd{M-x hippie-expand} is a single command providing a variety of
630completions and expansions. Called repeatedly, it tries all possible
631completions in succession.
632
633Which ones to try, and in which order, is determined by the contents of
634the customizable option @code{hippie-expand-try-functions-list}. Much
635customization of the expansion behavior can be made by changing the
636order of, removing, or inserting new functions in this list. Given a
637positive numeric argument, @kbd{M-x hippie-expand} jumps directly that
638number of functions forward in this list. Given some other argument (a
639negative argument or just @kbd{C-u}) it undoes the tried completion.
640
641See the commentary in @file{hippie-exp.el} for more information on the
642possibilities.
643
644Typically you would bind @code{hippie-expand} to @kbd{M-/} with
645@code{dabbrev-expand}, the standard binding of @kbd{M-/}, providing one
646of the expansion possibilities.
647
648@node GNU Free Documentation License
649@appendix GNU Free Documentation License
650@include doclicense.texi
651
652@node Concept Index
653@unnumbered Concept Index
654@printindex cp
655
656@node Command Index
657@unnumbered Command Index
658@printindex fn
659
660@node Variable Index
661@unnumbered Variable Index
662@printindex vr
663
4009494e 664@bye