;ELC ;;; compiled by jwz@thalidomide on Mon Jan 3 17:54:10 1994 ;;; from file /th/jwz/emacs19/lisp/modes/abbrev.el ;;; emacs version 19.9 Lucid (beta12). ;;; bytecomp version 2.22; 22-dec-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (defconst only-global-abbrevs nil "\ *t means user plans to use global abbrevs only. Makes the commands to define mode-specific abbrevs define global ones instead.") (defvar abbrev-table-name-list nil "\ List of symbols whose values are abbrev tables.") (defvar abbrevs-changed nil "\ Set non-nil by defining or altering any word abbrevs. This causes `save-some-buffers' to offer to save the abbrevs.") (fset 'make-abbrev-table #[nil "\"" [make-vector 59 0] 3 "\ Create a new, empty abbrev table object."]) (fset 'clear-abbrev-table #[(table) " \"Ň" [fillarray table 0 t abbrevs-changed nil] 3 "\ Undefine all abbrevs in abbrev table TABLE, leaving it empty."]) (fset 'define-abbrev-table #[(name defs) " ! J\n!\n  \nL B\nD\" \nL\n@#Ap)" [boundp name table vectorp make-abbrev-table abbrev-table-name-list signal wrong-type-argument defs apply define-abbrev nil] 5 "\ Define TABNAME (a symbol) as an abbrev table name. Define abbrevs in it according to DEFINITIONS, which is a list of elements of the form (ABBREVNAME EXPANSION HOOK USECOUNT)."]) (fset 'define-abbrev #[(table name &optional expansion hook count) ";D\" D\"\"  ! J  ! K  ;;  L M \"+" [expansion signal wrong-type-argument stringp count fixnump intern name table sym boundp oexp fboundp ohook hook t abbrevs-changed setplist 0] 5 "\ Define an abbrev in TABLE named NAME, to expand to EXPANSION or call HOOK. NAME and EXPANSION are strings. Hook is a function or `nil'. To undefine an abbrev, define with the an expansion of `nil'."]) (byte-code " @:\n\"\n@\nA\" A)d B B=\n\n)Ç" [abbrev-table-name-list l fixup delq define-abbrev-table global-abbrev-table make-abbrev-table fundamental-mode-abbrev-table major-mode fundamental-mode local-abbrev-table] 4) (fset 'define-global-abbrev #[(name expansion) " \n %" [define-abbrev global-abbrev-table name expansion nil 0] 6 "\ Define ABBREV as a global abbreviation for EXPANSION." "sDefine global abbrev: \nsExpansion for %s: "]) (fset 'define-mode-abbrev #[(name expansion) " ! $" [define-abbrev local-abbrev-table error "Major mode has no abbrev table" name nil 0] 5 "\ Define ABBREV as a mode-specific abbreviation for EXPANSION." "sDefine mode abbrev: \nsExpansion for %s: "]) (fset 'abbrev-symbol #[(abbrev &optional table) "\n \n! ! !)" [#[(table) " \n\" ! J; )" [intern-soft abbrev table sym boundp] 3] frob table local-abbrev-table global-abbrev-table] 2 "\ Return the symbol representing abbrev named ABBREV. This symbol's name is ABBREV, but it is not the canonical symbol of that name; it is interned in an abbrev-table rather than the normal obarray. The value is nil if that abbrev is not defined. Optional second arg TABLE is abbrev table to look it up in. The default is to try buffer's mode-specific abbrev table, then global table."]) (fset 'abbrev-expansion #[(abbrev &optional table) " \n\" J)" [abbrev-symbol abbrev table sym] 4 "\ Return the string that ABBREV expands into in the current buffer. Optionally specify an abbrev table as second arg; then ABBREV is looked up in that table only."]) (fset 'unexpand-abbrev #[nil "eWdV ;??` JGb \\| c GZ\nW\n Zb\nb+" [last-abbrev-location last-abbrev-text opoint last-abbrev val adjust nil] 4 "\ Undo the expansion of the last abbrev that expanded. This differs from ordinary undo in that other editing done since then is not undone."]) (fset 'insert-abbrev-table-description #[(name human-readable) "Jp\" C \" ! !\n\" ! \" \" \"\n\" \" !*!" [name stream table message "Abbrev-table %s..." human-readable prin1 terpri mapatoms #[(sym) "J!!G \" W\" Tp!\"\"KJ\"J! G\\\\ \" W\" TpK\"!*" [sym prin1-to-string symbol-name n pos princ stream 14 write-char 32 format " %-5S " symbol-plist prin1 6 45 terpri] 6] princ "(define-abbrev-table '" " '(\n" #[(sym) "J \"!JK!F \" !" [sym princ " " stream prin1 symbol-name symbol-plist terpri] 6] " ))\n" ""] 3 "\ Insert before point a full description of abbrev table named NAME. NAME is a symbol whose value is an abbrev table. If optional 2nd arg HUMAN is non-nil, insert a human-readable description. Otherwise the description is an expression, a call to `define-abbrev-table', which would define the abbrev table NAME exactly as it is currently defined."]) (fset 'abbrev-mode #[(arg) " ?!V !" [arg abbrev-mode prefix-numeric-value 0 set-buffer-modified-p buffer-modified-p] 2 "\ 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." "P"]) (defvar edit-abbrevs-map nil "\ Keymap used in edit-abbrevs.") (byte-code " \"##" [edit-abbrevs-map make-sparse-keymap set-keymap-name define-key "" edit-abbrevs-redefine ""] 4) (fset 'kill-all-abbrevs #[nil " @J! At)" [abbrev-table-name-list tables clear-abbrev-table nil] 3 "\ Undefine all defined abbrevs." nil]) (fset 'insert-abbrevs #[nil " \n@\"\nAt)`)!" [push-mark abbrev-table-name-list tables insert-abbrev-table-description t] 5 "\ Insert after point a description of all defined abbrevs. Mark is set after the inserted text." nil]) (fset 'list-abbrevs #[nil " !" [display-buffer prepare-abbrev-list-buffer] 2 "\ Display a list of all defined abbrevs." nil]) (fset 'prepare-abbrev-list-buffer #[nil "!q  @\" At)eb! )!" [get-buffer-create "*Abbrevs*" erase-buffer abbrev-table-name-list tables insert-abbrev-table-description t set-buffer-modified-p nil edit-abbrevs-mode] 4]) (fset 'edit-abbrevs-mode #[nil " !" [edit-abbrevs-mode major-mode "Edit-Abbrevs" mode-name use-local-map edit-abbrevs-map] 2 "\ Major mode for editing the list of abbrev definitions. \\{edit-abbrevs-map}" nil]) (fset 'edit-abbrevs #[nil " !" [switch-to-buffer prepare-abbrev-list-buffer] 2 "\ 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)." nil]) (fset 'edit-abbrevs-redefine #[nil "!!" [define-abbrevs t set-buffer-modified-p nil] 2 "\ Redefine abbrevs according to current buffer contents." nil]) (fset 'define-abbrevs #[(&optional arg) " ebm?#p! yyl! ! ! xl?!x   F B ,B \"+)" [arg kill-all-abbrevs re-search-forward "^(" nil t buf read table abbrevs 1 name count exp hook " \n " define-abbrev-table] 4 "\ 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." "P"]) (fset 'read-abbrev-file #[(&optional file quietly) " GV #ĉ" [load file 0 abbrev-file-name nil quietly t save-abbrevs abbrevs-changed] 4 "\ 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." "fRead abbrev file: "]) (fset 'quietly-read-abbrev-file #[(&optional file) " \"" [read-abbrev-file file t] 3 "\ Read abbrev definitions from file written with write-abbrev-file. Takes file name as argument. Does not print anything."]) (fset 'write-abbrev-file #[(file) "GV\n!q @\"Aq)d# )" [file 0 abbrev-file-name get-buffer-create " write-abbrev-file" erase-buffer abbrev-table-name-list tables insert-abbrev-table-description nil write-region 1] 5 "\ Write all abbrev definitions to file of Lisp code. The file can be loaded to define the same abbrevs." (byte-code " !! #C" [read-file-name "Write abbrev file: " file-name-directory expand-file-name abbrev-file-name] 5)]) (fset 'add-mode-abbrev #[(arg) " \n !#" [add-abbrev only-global-abbrevs global-abbrev-table local-abbrev-table error "No per-mode abbrev table." "Mode" arg] 4 "\ 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. Don't use this function in a Lisp program; use define-abbrev instead." "p"]) (fset 'add-global-abbrev #[(arg) " #" [add-abbrev global-abbrev-table "Global" arg] 4 "\ 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. Don't use this function in a Lisp program; use define-abbrev instead." "p"]) (fset 'add-abbrev #[(table type arg) "Y`U [v`){ Ȫ\n #!  \"  \"#! #*" [arg 0 mark nil name exp read-string format "%s abbrev for \"%s\": " "Undefine %s abbrev: " type abbrev-expansion table y-or-n-p "%s expands to \"%s\"; redefine? " define-abbrev] 7]) (fset 'inverse-add-mode-abbrev #[(arg) " \n !#" [inverse-add-abbrev only-global-abbrevs global-abbrev-table local-abbrev-table error "No per-mode abbrev table." "Mode" arg] 4 "\ 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." "p"]) (fset 'inverse-add-global-abbrev #[(arg) " #" [inverse-add-abbrev global-abbrev-table "Global" arg] 4 "\ 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." "p"]) (fset 'inverse-add-abbrev #[(table type arg) " [v`v`{) #!  \"  \"#! #\nb )+" [nil exp nameloc name arg 1 read-string format "%s expansion for \"%s\": " type abbrev-expansion table y-or-n-p "%s expands to \"%s\"; redefine? " define-abbrev expand-abbrev] 7]) (fset 'abbrev-prefix-mark #[(&optional arg) " pc" [arg expand-abbrev point-marker abbrev-start-location abbrev-start-location-buffer "-"] 1 "\ 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." "P"]) (fset 'expand-region-abbrevs #[(start end &optional noquery) "bd Z‰m?v`d ZXNJv`) {!b \"!V Q," [start end nil string pnt lim 1 abbrev-expansion -1 noquery y-or-n-p format "Expand `%s'? " expand-abbrev] 4 "\ 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." "r\nP"])