]> code.delx.au - gnu-emacs/blobdiff - man/abbrevs.texi
*** empty log message ***
[gnu-emacs] / man / abbrevs.texi
index 1a6b81d971e846a4cba96c1c7792e0d64e5fc5d2..e8cf2dc9c4994b54ae9e8718713d5d9ba48547f4 100644 (file)
@@ -82,6 +82,10 @@ Define a word in the buffer as an abbrev (@code{inverse-add-global-abbrev}).
 @item C-x a i l
 Define a word in the buffer as a mode-specific abbrev
 (@code{inverse-add-mode-abbrev}).
+@item M-x define-global-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET}
+Define @var{abbrev} as an abbrev expanding into @var{exp}.
+@item M-x define-mode-abbrev @key{RET} @var{abbrev} @key{RET} @var{exp} @key{RET}
+Define @var{abbrev} as a mode-specific abbrev expanding into @var{exp}.
 @item M-x kill-all-abbrevs
 This command discards all abbrev definitions currently in effect,
 leaving a blank slate.
@@ -121,6 +125,13 @@ l}.  These commands are called ``inverse'' because they invert the
 meaning of the two text strings they use (one from the buffer and one
 read with the minibuffer).
 
+@findex define-mode-abbrev
+@findex define-global-abbrev
+  You can define an abbrev without inserting either the abbrev or its
+expansion in the buffer using the command @code{define-global-abbrev}.
+It reads two arguments---the abbrev, and its expansion.  The command
+@code{define-mode-abbrev} does likewise for a mode-specific abbrev.
+
   To change the definition of an abbrev, just define a new definition.
 When the abbrev has a prior definition, the abbrev definition commands
 ask for confirmation before replacing it.
@@ -308,7 +319,7 @@ variable @code{save-abbrevs} to @code{nil}.
 @findex define-abbrevs
   The commands @kbd{M-x insert-abbrevs} and @kbd{M-x define-abbrevs} are
 similar to the previous commands but work on text in an Emacs buffer.
-@kbd{M-x insert-abbrevs} inserts text into the current buffer before point,
+@kbd{M-x insert-abbrevs} inserts text into the current buffer after point,
 describing all current abbrev definitions; @kbd{M-x define-abbrevs} parses
 the entire current buffer and defines abbrevs accordingly.@refill
 
@@ -359,10 +370,12 @@ expressions.  If a buffer's name matches any of these regular
 expressions, dynamic abbrev expansion skips that buffer.
 
   A negative argument to @kbd{M-/}, as in @kbd{C-u - M-/}, says to
-search first for expansions after point, and second for expansions
-before point.  If you repeat the @kbd{M-/} to look for another
-expansion, do not specify an argument.  This tries all the expansions
-after point and then the expansions before point.
+search first for expansions after point, then other buffers, and
+consider expansions before point only as a last resort.
+
+  If you repeat the @kbd{M-/} to look for another expansion, do not
+specify an argument.  This tries all the expansions after point and
+then the expansions before point.
 
   After you have expanded a dynamic abbrev, you can copy additional
 words that follow the expansion in its original context.  Simply type
@@ -432,3 +445,7 @@ customize dynamic abbreviation to handle optional prefixes by setting
 the variable @code{dabbrev-abbrev-skip-leading-regexp}.  Its value
 should be a regular expression that matches the optional prefix that
 dynamic abbreviation should ignore.
+
+@ignore
+   arch-tag: 638e0079-9540-48ec-9166-414083e16445
+@end ignore