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