DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T a

⟦53ef66e41⟧ TextFile

    Length: 9401 (0x24b9)
    Types: TextFile
    Names: »abbrevs.texinfo«

Derivation

└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89
    └─⟦c06c473ab⟧ »./UNRELEASED/lispref.tar.Z« 
        └─⟦1b57a2ffe⟧ 
            └─⟦this⟧ »abbrevs.texinfo« 

TextFile

@setfilename ../info/abbrevs
@node Abbreviations, Processes, Lisp Expressions, Top
@chapter Abbreviations
@cindex abbrev
@cindex abbrev table

  An abbreviation or @dfn{abbrev} is a string of characters that may be
expanded to a longer string.  If you type a part of an abbreviation,
Emacs replaces the abbreviation with the full string.  This saves typing
and makes life easier.

  The set of abbrevs currently in effect is recorded in an @dfn{abbrev table}.
Each buffer can have its own abbrev table, but normally all buffers in the same
major mode share one abbrev table.

  An abbrev table is represented as an obarray containing non-canonical
symbols, one for each abbreviation.  The symbol's name is the
abbreviation.  Its value is the expression; its function definition is
the hook; its property-list slot contains the number of times the
abbreviation has been expanded.

  Use of all the abbreviation-related commands is described in the GNU
Emacs User Manual @pxref{Abbrev Mode, , Abbrev Mode, emacs, GNU Emacs
User Manual}

@menu
* Abbrev Mode::			Setting up Emacs for abbreviation.
* Tables: Abbrev Tables.	Creating and working with abbrev tables.
* Defining Abbrevs::		Specifying what to use as abbreviations.
* Files: Abbrev Files.		Saving abbrevs in files.
* Expansion: Abbrev Expansion.	Controlling expansion; expansion subroutines.
* Standard Abbrev Tables::	Several standard tables.
@end menu

@node Abbrev Mode, Abbrev Tables, Abbreviations, Abbreviations
@comment  node-name,  next,  previous,  up
@section Setting Up Abbrev Mode    

Abbrev mode is a minor mode controlled by the value of the variable
@code{abbrev-mode}.

@defvar abbrev-mode
A non-@code{nil} value of this variable turns on the automatic expansion
of abbrevs when their abbreviations are inserted into a buffer.
If the value is @code{nil}, abbrevs may be defined, but they are not
expanded automatically.

Automatically becomes local when set in any fashion.
@end defvar

@defvar default-abbrev-mode
This is the value @code{abbrev-mode} for buffers that do not override it.
This is the same as @code{(default-value 'abbrev-mode)}.
@end defvar

@node Abbrev Tables, Defining Abbrevs, Abbrev Mode, Abbreviations
@section Abbrev Tables

@defun make-abbrev-table
This function creates a new, empty abbrev table---an obarray with no
symbols.  It is a vector filled with @code{nil}s.
@end defun

@defun clear-abbrev-table table
This function undefines all the abbrevs in abbrev table @var{table},
leaving it empty.
@end defun

@defun define-abbrev-table tabname definitions
This function defines @var{tabname} (a symbol) as an abbrev table name,
i.e., as a variable whose value is an abbrev table.  Define abbrevs in
the table according to @var{definitions}, a list of elements of the form
@code{(@var{abbrevname} @var{expansion} @var{hook} @var{usecount})}.
@end defun

@defvar abbrev-table-name-list
This is a list of symbols whose values are abbrev tables.
@code{define-abbrev-table} adds the new abbrev table name to this list.
@end defvar

@defun insert-abbrev-table-description name human
This function inserts before point a description of the abbrev table
named @var{name}.  @var{name} is a symbol whose value is an abbrev
table.

@c In version 19, human is optional.
If @var{human} is non-@code{nil}, a human-oriented description is
inserted.  Otherwise the description is a Lisp expression---a call to
@code{define-abbrev-table} which would define @var{name} exactly as it
is currently defined.
@end defun

@node Defining Abbrevs, Abbrev Files, Abbrev Tables, Abbreviations
@comment  node-name,  next,  previous,  up
@section Defining Abbrevs

@defun add-abbrev table type arg
This function adds an abbreviation to abbrev table @var{table}.
@var{type} is a string saying what kind of abbrev this is (global or
mode-specific, or whatever).  @var{arg} is the number of words in the
expansion.
@end defun

@defun define-abbrev table name expansion hook
This function defines an abbrev in @var{table} named @var{name}, to
expand to @var{expansion}, and call @var{hook}.  @var{name} and
@var{expansion} are strings.

@var{hook} is a function or @code{nil}.  If @var{hook} is
non-@code{nil}, then it is called with no arguments after the abbrev is
replaced with @var{expansion}; point is located at the end of
@var{expansion}.

The use-count of the abbrev is initialized to zero.

To undefine an abbrev, define it with @var{expansion} = @code{nil}
@end defun

@defopt only-global-abbrevs
If the the value of this variable is @code{t}, it means that the user
plans to use global abbrevs only.  This makes the commands that define
mode-specific abbrevs define global ones instead.
@end defopt

@defvar edit-abbrevs-map
This is the keymap used in @code{edit-abbrevs}.
@end defvar

@node Abbrev Files, Abbrev Expansion, Defining Abbrevs, Abbreviations
@section Saving Abbrevs in Files

@defopt abbrev-file-name
This is the default name of the file to read abbrevs from
and to save them in.
@end defopt

@defun quietly-read-abbrev-file file
This function reads abbrev definitions from a file named @var{file},
previously written with @code{write-abbrev-file}.  If @var{file} is
@code{nil}, the file specified in @code{abbrev-file-name} is used.
@code{save-abbrevs} is set to @code{t} so that changes will be saved.

This function does not print anything.  
@end defun

@defopt save-abbrevs
A non-@code{nil} value for @code{save-abbrev} means that Emacs should save
word abbrevs when files are saved.  @code{abbrev-file-name} specifies the
file to save in.
@end defopt

@defvar abbrevs-changed
This variable is set non-@code{nil} by defining or altering any word
abbrevs.  This serves as a flag for various Emacs commands to offer to
save your abbrevs.
@end defvar

@deffn Command write-abbrev-file file
Save all abbrev definitions, in all abbrev tables, in file @var{file}
as a Lisp program which will redefine the abbrevs when it is run.
@end deffn

@node Abbrev Expansion, Standard Abbrev Tables, Abbrev Files, Abbreviations
@comment  node-name,  next,  previous,  up
@section Looking Up and Expanding Abbreviations

  Abbrevs are usually expanded by commands for interactive use, or 
automatically by @code{self-insert}.  This section describes the 
subroutines used in writing such functions, and the variables they
use for communication.

@defun abbrev-symbol abbrev table
This function returns the symbol representing the abbrev named
@var{abbrev}.  The value returned is @code{nil} if that abbrev is not
defined.  The optional second argument @var{table} is the abbrev table
to look it up in.  By default, this function tries the buffer's
mode-specific abbrev table, and then the global table.
@end defun

@defopt abbrev-all-caps
When this is set non-@code{nil}, Emacs expands multi-word abbrevs using
all upper case letters if the abbrev was all in upper case.
@end defopt

@defun abbrev-expansion abbrev &optional table
This function returns the string that @var{abbrev} expands into in the
current buffer.  Optionally specify an abbrev @var{table}; then
@var{abbrev} is looked up in that table only.
@end defun

@defvar abbrev-start-location
This is the buffer position for @code{expand-abbrev} to use as the start
of the abbrev to expand.  @code{nil} means use the word before point as
the abbrev.  @code{abbrev-start-location} is set to @code{nil} each time
@code{expand-abbrev} is called.  This variable is set by
@code{abbrev-prefix-mark}.
@end defvar

@defvar abbrev-start-location-buffer
The value of this variable is the buffer that
@code{abbrev-start-location} has been set for.  Trying to expand an
abbrev in any other buffer clears @code{abbrev-start-location}.  This
variable is set by @code{abbrev-prefix-mark}.
@end defvar

@defvar last-abbrev
This is the @code{abbrev-symbol} of the last abbrev expanded.  This
contains information left by @code{expand-abbrev} for the sake of the
@code{unexpand-abbrev} command.
@end defvar

@defvar last-abbrev-location
This is the location of the last abbrev expanded.  This contains
information left by @code{expand-abbrev} for the sake of the
@code{unexpand-abbrev} command.
@end defvar

@defvar last-abbrev-text
This is the exact expansion  text of the last abbrev expanded, as
results from case conversion.  Its value is
@code{nil} if the abbrev has already been unexpanded.  This
contains information left by @code{expand-abbrev} for the sake of the
@code{unexpand-abbrev} command.
@end defvar

@node Standard Abbrev Tables,  , Abbrev Expansion, Abbreviations
@comment  node-name,  next,  previous,  up
@section Standard Abbrev Tables

@defvar global-abbrev-table
This is the abbrev table whose abbrevs affect all buffers.
Each buffer may also have a local abbrev table.
If it does, the local table overrides the global one
for any particular abbrev defined in both.
@end defvar

@defvar local-abbrev-table
The value of this buffer-local variable is the (mode-specific)
abbreviation table of the current buffer.
@end defvar

@defvar fundamental-mode-abbrev-table
This is the fundamental abbrev table of mode-specific abbrevs for Fundamental
mode.
@end defvar

@defvar text-mode-abbrev-table
This s the local abbrev table used in Text mode.
@end defvar

@defvar c-mode-abbrev-table
This is the local abbrev table used in C mode.
@end defvar

@defvar lisp-mode-abbrev-table
This is the local abbrev table used in Lisp mode and Emacs Lisp mode.
@end defvar