]> git.eshelyaron.com Git - emacs.git/commitdiff
(flyspell-mode): Use define-minor-mode.
authorLute Kamstra <lute@gnu.org>
Wed, 8 Jun 2005 08:14:32 +0000 (08:14 +0000)
committerLute Kamstra <lute@gnu.org>
Wed, 8 Jun 2005 08:14:32 +0000 (08:14 +0000)
lisp/ChangeLog
lisp/textmodes/flyspell.el

index 368d5139978747f9b2fff59369d6a9d33efedc49..9d1e57f02615d94964db722bf47486659f99d1a9 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-08  Lute Kamstra  <lute@gnu.org>
+
+       * textmodes/flyspell.el (flyspell-mode): Use define-minor-mode.
+
 2005-06-07  Lute Kamstra  <lute@gnu.org>
 
        * textmodes/org.el (org-run-mode-hooks): New function.
index 8bd6c731e3cdb08c6f1e8d91312b6f3a043d849d..f66f81a195b200729b5fbe0fa0a5e245555db074 100644 (file)
@@ -468,7 +468,7 @@ See also `flyspell-duplicate-distance'."
 ;*    flyspell-mode ...                                                */
 ;*---------------------------------------------------------------------*/
 ;;;###autoload
-(defun flyspell-mode (&optional arg)
+(define-minor-mode flyspell-mode
   "Minor mode performing on-the-fly spelling checking.
 This spawns a single Ispell process and checks each word.
 The default flyspell behavior is to highlight incorrect words.
@@ -496,28 +496,12 @@ in your .emacs file.
 
 \\[flyspell-region] checks all words inside a region.
 \\[flyspell-buffer] checks the whole buffer."
-  (interactive "P")
-  (let ((old-flyspell-mode flyspell-mode))
-    ;; Mark the mode as on or off.
-    (setq flyspell-mode (not (or (and (null arg) flyspell-mode)
-                                (<= (prefix-numeric-value arg) 0))))
-    ;; Do the real work.
-    (unless (eq flyspell-mode old-flyspell-mode)
-      (if flyspell-mode
-         (flyspell-mode-on)
-       (flyspell-mode-off))
-      ;; Force modeline redisplay.
-      (set-buffer-modified-p (buffer-modified-p)))))
-
-;*---------------------------------------------------------------------*/
-;*    Autoloading                                                      */
-;*---------------------------------------------------------------------*/
-;;;###autoload
-(add-minor-mode 'flyspell-mode
-               'flyspell-mode-line-string
-               flyspell-mode-map
-               nil
-               'flyspell-mode)
+  :lighter flyspell-mode-line-string
+  :keymap flyspell-mode-map
+  :group 'flyspell
+  (if flyspell-mode
+      (flyspell-mode-on)
+    (flyspell-mode-off)))
 
 ;*---------------------------------------------------------------------*/
 ;*    flyspell-buffers ...                                             */