comparison man/autotype.texi @ 88155:d7ddb3e565de

sync with trunk
author Henrik Enberg <henrik.enberg@telia.com>
date Mon, 16 Jan 2006 00:03:54 +0000
parents 0a70200bde27
children
comparison
equal deleted inserted replaced
88154:8ce476d3ba36 88155:d7ddb3e565de
1 \input texinfo 1 \input texinfo
2 @c This is an annex of the Emacs manual. 2 @c This is an annex of the Emacs manual.
3 @c Copyright (C) 1994, 1995, 2002 Free Software Foundation, Inc. 3 @c Copyright (C) 1994, 1995, 2002, 2003, 2004,
4 @c 2005 Free Software Foundation, Inc.
4 @c Author: Daniel.Pfeiffer@Informatik.START.dbp.de, fax (+49 69) 7588-2389 5 @c Author: Daniel.Pfeiffer@Informatik.START.dbp.de, fax (+49 69) 7588-2389
5 @setfilename ../info/autotype 6 @setfilename ../info/autotype
6 @c @node Autotypist, Picture, Abbrevs, Top 7 @c @node Autotypist, Picture, Abbrevs, Top
7 @c @chapter Features for Automatic Typing 8 @c @chapter Features for Automatic Typing
8 @settitle Features for Automatic Typing 9 @settitle Features for Automatic Typing
9 @c @cindex text 10 @c @cindex text
10 @c @cindex selfinserting text 11 @c @cindex selfinserting text
11 @c @cindex autotypist 12 @c @cindex autotypist
12 13
13 @copying 14 @copying
14 Copyright @copyright{} 1994, 1995, 1999 Free Software Foundation, Inc. 15 Copyright @copyright{} 1994, 1995, 1999, 2002, 2003, 2004,
16 2005 Free Software Foundation, Inc.
15 17
16 @quotation 18 @quotation
17 Permission is granted to copy, distribute and/or modify this document 19 Permission is granted to copy, distribute and/or modify this document
18 under the terms of the GNU Free Documentation License, Version 1.1 or 20 under the terms of the GNU Free Documentation License, Version 1.2 or
19 any later version published by the Free Software Foundation; with the 21 any later version published by the Free Software Foundation; with the
20 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and 22 Invariant Sections being ``The GNU Manifesto'', ``Distribution'' and
21 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU 23 ``GNU GENERAL PUBLIC LICENSE'', with the Front-Cover texts being ``A GNU
22 Manual'', and with the Back-Cover Texts as in (a) below. A copy of the 24 Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
23 license is included in the section entitled ``GNU Free Documentation 25 license is included in the section entitled ``GNU Free Documentation
194 define an abbreviation (@pxref{(emacs)Defining Abbrevs}) that will expand 196 define an abbreviation (@pxref{(emacs)Defining Abbrevs}) that will expand
195 (@pxref{(emacs)Expanding Abbrevs}) into the skeleton. 197 (@pxref{(emacs)Expanding Abbrevs}) into the skeleton.
196 198
197 Say you want @samp{ifst} to be an abbreviation for the C language if 199 Say you want @samp{ifst} to be an abbreviation for the C language if
198 statement. You will tell Emacs that @samp{ifst} expands to the empty string 200 statement. You will tell Emacs that @samp{ifst} expands to the empty string
199 and then calls the skeleton command. In Emacs-lisp you can say something like 201 and then calls the skeleton command. In Emacs Lisp you can say something like
200 @code{(define-abbrev c-mode-abbrev-table "ifst" "" 'c-if)}. Or you can edit 202 @code{(define-abbrev c-mode-abbrev-table "ifst" "" 'c-if)}. Or you can edit
201 the output from @kbd{M-x list-abbrevs} to make it look like this: 203 the output from @kbd{M-x list-abbrevs} to make it look like this:
202 204
203 @example 205 @example
204 (c-mode-abbrev-table) 206 (c-mode-abbrev-table)
261 return value resulting from the interactor. Each subskeleton has its local 263 return value resulting from the interactor. Each subskeleton has its local
262 copy of this variable. 264 copy of this variable.
263 @item @code{v1}, @code{v2} 265 @item @code{v1}, @code{v2}
264 Skeleton-local user variables. 266 Skeleton-local user variables.
265 @item @code{'@var{expression}} 267 @item @code{'@var{expression}}
266 Evaluate following lisp expression for its side-effect, but prevent it from 268 Evaluate following Lisp expression for its side-effect, but prevent it from
267 being interpreted as a skeleton element. 269 being interpreted as a skeleton element.
268 @item @var{skeleton} 270 @item @var{skeleton}
269 Subskeletons are inserted recursively, not once, but as often as the user 271 Subskeletons are inserted recursively, not once, but as often as the user
270 enters something at the subskeletons interactor. Thus there must be a 272 enters something at the subskeletons interactor. Thus there must be a
271 @code{str} in the subskeleton. They can also be used non-interactively, when 273 @code{str} in the subskeleton. They can also be used non-interactively, when
398 400
399 @findex define-auto-insert 401 @findex define-auto-insert
400 In Lisp (@pxref{(emacs)Init File}) you can use the function 402 In Lisp (@pxref{(emacs)Init File}) you can use the function
401 @code{define-auto-insert} to add to or modify 403 @code{define-auto-insert} to add to or modify
402 @code{auto-insert-alist}. See its documentation with @kbd{C-h f 404 @code{auto-insert-alist}. See its documentation with @kbd{C-h f
403 auto-insert-alist}. 405 define-auto-insert}.
404 406
405 @vindex auto-insert 407 @vindex auto-insert
406 The variable @code{auto-insert} says what to do when @code{auto-insert} is 408 The variable @code{auto-insert} says what to do when @code{auto-insert} is
407 called non-interactively, e.g. when a newly found file is empty (see above): 409 called non-interactively, e.g. when a newly found file is empty (see above):
408 @table @asis 410 @table @asis
454 them when this is called with a prefix argument. If a header referring to a 456 them when this is called with a prefix argument. If a header referring to a
455 wrong version of the GNU General Public License (@pxref{(emacs)Copying}) is found, 457 wrong version of the GNU General Public License (@pxref{(emacs)Copying}) is found,
456 that is updated too. 458 that is updated too.
457 459
458 An interesting application for this function is to have it be called 460 An interesting application for this function is to have it be called
459 automatically every time a file is saved. This is accomplished by putting 461 automatically every time a file is saved. This is accomplished by
460 @code{(add-hook 'write-file-functions 'copyright-update)} into your @file{~/.emacs} 462 putting @code{(add-hook 'before-save-hook 'copyright-update)} into
461 file (@pxref{(emacs)Init File}). 463 your @file{~/.emacs} file (@pxref{(emacs)Init File}). Alternative,
464 you can do @kbd{M-x customize-variable @key{RET} before-save-hook
465 @key{RET}}. @code{copyright-update} is conveniently listed as an
466 option in the customization buffer.
462 467
463 @vindex copyright-query 468 @vindex copyright-query
464 The variable @code{copyright-query} controls whether to update the 469 The variable @code{copyright-query} controls whether to update the
465 copyright or whether to ask about it. When this is @code{nil} updating is 470 copyright or whether to ask about it. When this is @code{nil} updating is
466 only done with @kbd{M-x copyright-update}. When this is @code{function} 471 only done with @kbd{M-x copyright-update}. When this is @code{function}
467 you are queried whenever @code{copyright-update} is called as a function, 472 you are queried whenever @code{copyright-update} is called as a function,
468 such as in the @code{write-file-functions} feature mentioned above. Otherwise 473 such as in the @code{before-save-hook} feature mentioned above. Otherwise
469 you are always queried. 474 you are always queried.
470 475
471 476
472 477
473 @node Executables 478 @node Executables
520 @node Timestamps 525 @node Timestamps
521 @chapter Maintaining Timestamps in Modified Files 526 @chapter Maintaining Timestamps in Modified Files
522 @cindex timestamps 527 @cindex timestamps
523 528
524 @findex time-stamp 529 @findex time-stamp
525 @vindex write-file-functions 530 @vindex before-save-hook
526 The @code{time-stamp} command can be used to update automatically a 531 The @code{time-stamp} command can be used to update automatically a
527 template in a file with a new time stamp every time you save the file. 532 template in a file with a new time stamp every time you save the file.
528 Customize the hook @code{write-file-functions} to add the function 533 Customize the hook @code{before-save-hook} to add the function
529 @code{time-stamp} to arrange this. 534 @code{time-stamp} to arrange this. It you use Custom to do this,
535 then @code{time-stamp} is conveniently listed as an option in the
536 customization buffer.
530 537
531 @vindex time-stamp-active 538 @vindex time-stamp-active
532 @vindex time-stamp-format 539 @vindex time-stamp-format
533 @vindex time-stamp-start 540 @vindex time-stamp-start
534 The time stamp is updated only if the customizable variable 541 The time stamp is updated only if the customizable variable
603 buffer at point. Some can be simple strings, while others can control 610 buffer at point. Some can be simple strings, while others can control
604 formatting or define special points of interest in the inserted text. 611 formatting or define special points of interest in the inserted text.
605 @kbd{M-x tempo-backward-mark} and @kbd{M-x tempo-forward-mark} can be 612 @kbd{M-x tempo-backward-mark} and @kbd{M-x tempo-forward-mark} can be
606 used to jump between such points. 613 used to jump between such points.
607 614
608 More flexible templates can be created by including lisp symbols, which 615 More flexible templates can be created by including Lisp symbols, which
609 will be evaluated as variables, or lists, which will be evaluated 616 will be evaluated as variables, or lists, which will be evaluated
610 as lisp expressions. Automatic completion of specified tags to expanded 617 as Lisp expressions. Automatic completion of specified tags to expanded
611 templates can be provided. 618 templates can be provided.
612 619
613 @findex tempo-define-template 620 @findex tempo-define-template
614 See the documentation for @code{tempo-define-template} for the different 621 See the documentation for @code{tempo-define-template} for the different
615 items that can be used to define a tempo template with a command for 622 items that can be used to define a tempo template with a command for
657 @printindex vr 664 @printindex vr
658 665
659 @setchapternewpage odd 666 @setchapternewpage odd
660 @contents 667 @contents
661 @bye 668 @bye
669
670 @ignore
671 arch-tag: 54001b27-5ef8-4a9d-a199-905d650fafba
672 @end ignore