found))
(defun prepare-abbrev-list-buffer (&optional local)
+ "Return buffer listing abbreviations and expansions for each abbrev table.
+
+If LOCAL is non-nil, include in the buffer only the local abbrevs."
(let ((local-table local-abbrev-table))
(with-current-buffer (get-buffer-create "*Abbrevs*")
(erase-buffer)
(add-abbrev global-abbrev-table "Global" arg))
(defun add-abbrev (table type arg)
+ "Define abbrev in TABLE, whose expansion is ARG words before point.
+Read the abbreviation from the minibuffer, with prompt TYPE.
+
+ARG of zero means the entire region is the expansion.
+
+A negative ARG means to undefine the specified abbrev.
+
+TYPE is an arbitrary string used to prompt user for the kind of
+abbrev, such as \"Global\", \"Mode\". (This has no influence on the
+choice of the actual TABLE).
+
+See `inverse-add-abbrev' for the opposite task.
+
+Don't use this function in a Lisp program; use `define-abbrev' instead."
(let ((exp
(cond
((or (and (null arg) (use-region-p))
(if (or (null exp)
(not (abbrev-expansion name table))
(y-or-n-p (format "%s expands into \"%s\"; redefine? "
- name (abbrev-expansion name table))))
+ name (abbrev-expansion name table))))
(define-abbrev table (downcase name) exp))))
(defun inverse-add-mode-abbrev (n)
(inverse-add-abbrev global-abbrev-table "Global" n))
(defun inverse-add-abbrev (table type arg)
+ "Define the word before point as an abbrev in TABLE.
+Read the expansion from the minibuffer, using prompt TYPE, define
+the abbrev, and then expand the abbreviation in the current
+buffer.
+
+ARG means use the ARG-th word before point as the abbreviation.
+Negative ARG means use the ARG-th word after point.
+
+TYPE is an arbitrary string used to prompt user for the kind of
+abbrev, such as \"Global\", \"Mode\". (This has no influence on the
+choice of the actual TABLE).
+
+See also `add-abbrev', which performs the opposite task."
(let (name exp start end)
(save-excursion
(forward-word (1+ (- arg)))
(insert ")\n"))
(defun abbrev--describe (sym)
+ "Describe abbrev SYM.
+Print on `standard-output' the abbrev, count of use, expansion."
(when (symbol-value sym)
(prin1 (symbol-name sym))
(if (null (abbrev-get sym :system))
(setq font-lock-multiline nil))
(defun abbrev--possibly-save (query &optional arg)
+ "Hook function for use by `save-some-buffer-functions'.
+
+Maybe save abbrevs, and record whether we either saved them or asked to."
;; Query mode.
(if (eq query 'query)
(and save-abbrevs abbrevs-changed)
- ;; Maybe save abbrevs, and record whether we either saved them or
- ;; asked to.
(and save-abbrevs
abbrevs-changed
(prog1