comparison lisp/abbrev.el @ 93513:b97d6aea2d95

(abbrev-mode): Use define-minor-mode.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 01 Apr 2008 08:36:57 +0000
parents 73a01bf5cb80
children ad63f799c98d
comparison
equal deleted inserted replaced
93512:425b4f72a3dc 93513:b97d6aea2d95
47 define global abbrevs instead." 47 define global abbrevs instead."
48 :type 'boolean 48 :type 'boolean
49 :group 'abbrev-mode 49 :group 'abbrev-mode
50 :group 'convenience) 50 :group 'convenience)
51 51
52 (defun abbrev-mode (&optional arg) 52 (define-minor-mode abbrev-mode
53 "Toggle Abbrev mode in the current buffer. 53 "Toggle Abbrev mode in the current buffer.
54 With optional argument ARG, turn abbrev mode on if ARG is 54 With optional argument ARG, turn abbrev mode on if ARG is
55 positive, otherwise turn it off. In Abbrev mode, inserting an 55 positive, otherwise turn it off. In Abbrev mode, inserting an
56 abbreviation causes it to expand and be replaced by its expansion." 56 abbreviation causes it to expand and be replaced by its expansion.")
57 (interactive "P")
58 (setq abbrev-mode
59 (if (null arg) (not abbrev-mode)
60 (> (prefix-numeric-value arg) 0)))
61 (force-mode-line-update))
62 57
63 (defcustom abbrev-mode nil 58 (defcustom abbrev-mode nil
64 "Enable or disable Abbrev mode. 59 "Enable or disable Abbrev mode.
65 Non-nil means automatically expand abbrevs as they are inserted. 60 Non-nil means automatically expand abbrevs as they are inserted.
66 61