4.4BSD/usr/src/contrib/emacs-18.57/lisp/abbrev.elc


(defun abbrev-mode (arg) "\
Toggle abbrev mode.
With arg, turn abbrev mode on iff arg is positive.
In abbrev mode, inserting an abbreviation causes it to expand
and be replaced by its expansion." (interactive "P") (byte-code "ˆ	?ƒ?‚Ã	!ÄV‰ˆÅÆ !‡" [abbrev-mode arg nil prefix-numeric-value 0 set-buffer-modified-p buffer-modified-p] 4))

(defvar edit-abbrevs-map nil "\
Keymap used in edit-abbrevs.")

(if edit-abbrevs-map nil (setq edit-abbrevs-map (make-sparse-keymap)) (define-key edit-abbrevs-map "" (quote edit-abbrevs-redefine)) (define-key edit-abbrevs-map "" (quote edit-abbrevs-redefine)))

(defun kill-all-abbrevs nil "\
Undefine all defined abbrevs." (interactive) (byte-code "ˆ	…Ã@J!ˆA‰ˆ‚)‡" [tables abbrev-table-name-list nil clear-abbrev-table] 4))

(defun insert-abbrevs nil "\
Insert after point a description of all defined abbrevs.
Mark is set after the inserted text." (interactive) (byte-code "ÈĊ	…Å@Â\"ˆA‰ˆ‚)ˆ`)!‡" [tables abbrev-table-name-list t nil push-mark insert-abbrev-table-description] 5))

(defun list-abbrevs nil "\
Display a list of all defined abbrevs." (interactive) (byte-code "ÀˆÁ !‡" [nil display-buffer prepare-abbrev-list-buffer] 3))

(defun prepare-abbrev-list-buffer nil (byte-code "ŠÄÅ!qˆÆ ˆ	…Ç@Â\"ˆA‰ˆ‚)ˆebˆÈÃ!ˆÉ )ˆÄÅ!‡" [tables abbrev-table-name-list t nil get-buffer-create "*Abbrevs*" erase-buffer insert-abbrev-table-description set-buffer-modified-p edit-abbrevs-mode] 7))

(defun edit-abbrevs-mode nil "\
Major mode for editing the list of abbrev definitions.
\\{edit-abbrevs-map}" (interactive) (byte-code "ÈĉˆÅ‰ˆÆ
!‡" [major-mode mode-name edit-abbrevs-map nil edit-abbrevs-mode "Edit-Abbrevs" use-local-map] 2))

(defun edit-abbrevs nil "\
Alter abbrev definitions by editing a list of them.
Selects a buffer containing a list of abbrev definitions.
You can edit them and type C-c C-c to redefine abbrevs
according to your editing.
Buffer contains a header line for each abbrev table,
 which is the abbrev table name in parentheses.
This is followed by one line per abbrev in that table:
NAME   USECOUNT   EXPANSION   HOOK
where NAME and EXPANSION are strings with quotes,
USECOUNT is an integer, and HOOK is any valid function
or may be omitted (it is usually omitted)." (interactive) (byte-code "ÀˆÁ !‡" [nil switch-to-buffer prepare-abbrev-list-buffer] 3))

(defun edit-abbrevs-redefine nil "\
Redefine abbrevs according to current buffer contents." (interactive) (byte-code "ÁˆÂÀ!ˆÃÁ!‡" [t nil define-abbrevs set-buffer-modified-p] 3))

(defun define-abbrevs (&optional arg) "\
Define abbrevs according to current visible buffer contents.
See documentation of edit-abbrevs for info on the format of the
text you must have in the buffer.
With argument, eliminate all abbrev definitions except
the ones defined from the buffer now." (interactive "P") (byte-code "Áˆ…Ê ˆŠebˆm?…ËÌÁÂ#…opÍ!ÁÎÏ!ˆÎÏ!ˆl?…eÍ!Í!Í!‰ˆÐÑ!ˆl?…LÍ!‰	ˆÐÑ!ˆ	F
B‰ˆ‚&ˆÒ
\"+ˆ‚
)‡" [arg nil t buf table abbrevs name count exp hook kill-all-abbrevs re-search-forward "^(" read forward-line 1 skip-chars-backward " 	
" define-abbrev-table] 17))

(defun read-abbrev-file (file &optional quietly) "\
Read abbrev definitions from file written with write-abbrev-file.
Takes file name as argument.
Optional second argument non-nil means don't print anything." (interactive "fRead abbrev file: ") (byte-code "ˆÇ…GÈVƒ‚	Â#ˆÅ‰‡" [file abbrev-file-name nil quietly save-abbrevs t abbrevs-changed load 0] 4))

(defun quietly-read-abbrev-file (file) "\
Read abbrev definitions from file written with write-abbrev-file.
Takes file name as argument.  Does not print anything." (byte-code "ÂÁ\"‡" [file t read-abbrev-file] 3))

(defun write-abbrev-file (file) "\
Write all abbrev definitions to file of Lisp code.
The file can be loaded to define the same abbrevs." (interactive "FWrite abbrev file: ") (byte-code "Ĉ…
GÅV†	‰ˆŠÆÇ!qˆÈ ˆ
….É
@Ä\"ˆ
A‰ˆ‚)ˆÊËd#ˆÈ )‡" [file abbrev-file-name tables abbrev-table-name-list nil 0 get-buffer-create " write-abbrev-file" erase-buffer insert-abbrev-table-description write-region 1] 7))

(defun add-mode-abbrev (arg) "\
Define mode-specific abbrev for last word(s) before point.
Argument is how many words before point form the expansion;
or zero means the region is the expansion.
A negative argument means to undefine the specified abbrev.
Reads the abbreviation in the minibuffer." (interactive "p") (byte-code "ĈŃ	‚
†ÆÇ!È#‡" [only-global-abbrevs global-abbrev-table local-abbrev-table arg nil add-abbrev error "No per-mode abbrev table." "Mode"] 5))

(defun add-global-abbrev (arg) "\
Define global (all modes) abbrev for last word(s) before point.
Argument is how many words before point form the expansion;
or zero means the region is the expansion.
A negative argument means to undefine the specified abbrev.
Reads the abbreviation in the minibuffer." (interactive "p") (byte-code "ˆÃÄ	#‡" [global-abbrev-table arg nil add-abbrev "Global"] 4))

(defun add-abbrev (table type arg) (byte-code "	ÅY…Æ`	ÅUƒÇ ‚ŠÈ	[!ˆ`)\"ÉÊËÌ#!‰ˆ?†@Í
\"?†@ÎËÏ
Í
\"#!…JÐÑ
!#*‡" [exp arg name type table 0 buffer-substring mark forward-word nil read-string format "%s abbrev for \"%s\": " abbrev-expansion y-or-n-p "%s expands to \"%s\"; redefine? " define-abbrev downcase] 14))

(defun inverse-add-mode-abbrev (arg) "\
Define last word before point as a mode-specific abbrev.
With argument N, defines the Nth word before point.
Reads the expansion in the minibuffer.
Expands the abbreviation after defining it." (interactive "p") (byte-code "ĈŃ	‚
†ÆÇ!È#‡" [only-global-abbrevs global-abbrev-table local-abbrev-table arg nil inverse-add-abbrev error "No per-mode abbrev table." "Mode"] 5))

(defun inverse-add-global-abbrev (arg) "\
Define last word before point as a global (mode-independent) abbrev.
With argument N, defines the Nth word before point.
Reads the expansion in the minibuffer.
Expands the abbreviation after defining it." (interactive "p") (byte-code "ˆÃÄ	#‡" [global-abbrev-table arg nil inverse-add-abbrev "Global"] 4))

(defun inverse-add-abbrev (table type arg) (byte-code "ÆÆÆŠÇ[!ˆÈ`ÇÉ!ˆ`‰\"‰)ˆÊËÌ#!‰ˆÍ
\"?†6ÎËÏÍ
\"#!…HÐ
Ñ!
#ˆŠ	bˆÒ )+‡" [name nameloc exp arg type table nil forward-word buffer-substring 1 read-string format "%s expansion for \"%s\": " abbrev-expansion y-or-n-p "%s expands to \"%s\"; redefine? " define-abbrev downcase expand-abbrev] 14))

(defun abbrev-prefix-mark (&optional arg) "\
Mark current point as the beginning of an abbrev.
Abbrev to be expanded starts here rather than at
beginning of word.  This way, you can expand an abbrev
with a prefix: insert the prefix, use this command,
then insert the abbrev." (interactive "P") (byte-code "頀 ˆÅ p‰ˆÆc‡" [arg abbrev-start-location abbrev-start-location-buffer nil expand-abbrev point-marker "-"] 4))

(defun expand-region-abbrevs (start end &optional noquery) "\
For abbrev occurrence in the region, offer to expand it.
The user is asked to type y or n for each occurrence.
A numeric argument means don't query; expand all abbrevs.
Calling from a program, arguments are START END &optional NOQUERY." (interactive "r") (byte-code "ňŠ	^bˆd	]Zm?…ÆÇ!ˆ`d
ZX…?È É …:Ê!ˆË ˆ†5ÌÍ!…:É )ˆ‚))‡" [start end lim modp noquery nil forward-word 1 buffer-modified-p expand-abbrev set-buffer-modified-p unexpand-abbrev y-or-n-p "Expand this? "] 9))