]> code.delx.au - gnu-emacs/blobdiff - lisp/abbrev.el
(display-time-string-forms): Test display-time-day-and-date
[gnu-emacs] / lisp / abbrev.el
index ad7dd54405ce9aea6505e2348f3d71177f6d1f51..ff6ae3ac672495173cbf117c43c2b671b4cb68ed 100644 (file)
@@ -2,6 +2,8 @@
 
 ;; Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc.
 
+;; Keywords: abbrev
+
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; This facility is documented in the Emacs Manual.
 
 ;;; Code:
 
-(defconst only-global-abbrevs nil "\
+(defvar 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.")
 
 (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")
   (setq abbrev-mode
        (if (null arg) (not abbrev-mode)
          (> (prefix-numeric-value arg) 0)))
-  (set-buffer-modified-p (buffer-modified-p))) ;No-op, but updates mode line.
+  (force-mode-line-update))
 \f
 (defvar edit-abbrevs-map nil
   "Keymap used in edit-abbrevs.")
@@ -211,6 +218,7 @@ Don't use this function in a Lisp program; use `define-abbrev' instead."
          (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? "
@@ -244,6 +252,7 @@ Expands the abbreviation after defining it."
      (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))