;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
-;; Maintainer: FSF
+;; Keywords: abbrev
;; This file is part of GNU Emacs.
;; along with GNU Emacs; see the file COPYING. If not, write to
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;;; Commentary:
+
+;; This facility is documented in the Emacs Manual.
+
;;; Code:
(defconst only-global-abbrevs nil "\
(defun abbrev-mode (arg)
"Toggle abbrev mode.
-With arg, turn abbrev mode on iff arg is positive.
+With argument 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")
(while (and (not (eobp)) (re-search-forward "^(" nil t))
(let* ((buf (current-buffer))
(table (read buf))
- abbrevs)
+ abbrevs name hook exp count)
(forward-line 1)
(while (progn (forward-line 1)
(not (eolp)))
(read-string (format (if exp "%s abbrev for \"%s\": "
"Undefine %s abbrev: ")
type exp)))
+ (set-text-properties 0 (length name) nil name)
(if (or (null exp)
(not (abbrev-expansion name table))
(y-or-n-p (format "%s expands to \"%s\"; redefine? "
(forward-word (- arg))
(setq name (buffer-substring (point) (progn (forward-word 1)
(setq nameloc (point))))))
+ (set-text-properties 0 (length name) nil name)
(setq exp (read-string (format "%s expansion for \"%s\": "
type name)))
(if (or (not (abbrev-expansion name table))