diff options
| author | Lute Kamstra | 2005-06-08 08:14:32 +0000 |
|---|---|---|
| committer | Lute Kamstra | 2005-06-08 08:14:32 +0000 |
| commit | b978659cce9315dc255565c5488817aa4cc401ff (patch) | |
| tree | 68376a3c3e9e5ef0e8437b1260cf74d94b28fe9e | |
| parent | ecc8893aa3cd26a2d1a601b605ab59e74ffb0eac (diff) | |
| download | emacs-b978659cce9315dc255565c5488817aa4cc401ff.tar.gz emacs-b978659cce9315dc255565c5488817aa4cc401ff.zip | |
(flyspell-mode): Use define-minor-mode.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/textmodes/flyspell.el | 30 |
2 files changed, 11 insertions, 23 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 368d5139978..9d1e57f0261 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2005-06-08 Lute Kamstra <lute@gnu.org> | ||
| 2 | |||
| 3 | * textmodes/flyspell.el (flyspell-mode): Use define-minor-mode. | ||
| 4 | |||
| 1 | 2005-06-07 Lute Kamstra <lute@gnu.org> | 5 | 2005-06-07 Lute Kamstra <lute@gnu.org> |
| 2 | 6 | ||
| 3 | * textmodes/org.el (org-run-mode-hooks): New function. | 7 | * textmodes/org.el (org-run-mode-hooks): New function. |
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 8bd6c731e3c..f66f81a195b 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -468,7 +468,7 @@ See also `flyspell-duplicate-distance'." | |||
| 468 | ;* flyspell-mode ... */ | 468 | ;* flyspell-mode ... */ |
| 469 | ;*---------------------------------------------------------------------*/ | 469 | ;*---------------------------------------------------------------------*/ |
| 470 | ;;;###autoload | 470 | ;;;###autoload |
| 471 | (defun flyspell-mode (&optional arg) | 471 | (define-minor-mode flyspell-mode |
| 472 | "Minor mode performing on-the-fly spelling checking. | 472 | "Minor mode performing on-the-fly spelling checking. |
| 473 | This spawns a single Ispell process and checks each word. | 473 | This spawns a single Ispell process and checks each word. |
| 474 | The default flyspell behavior is to highlight incorrect words. | 474 | The default flyspell behavior is to highlight incorrect words. |
| @@ -496,28 +496,12 @@ in your .emacs file. | |||
| 496 | 496 | ||
| 497 | \\[flyspell-region] checks all words inside a region. | 497 | \\[flyspell-region] checks all words inside a region. |
| 498 | \\[flyspell-buffer] checks the whole buffer." | 498 | \\[flyspell-buffer] checks the whole buffer." |
| 499 | (interactive "P") | 499 | :lighter flyspell-mode-line-string |
| 500 | (let ((old-flyspell-mode flyspell-mode)) | 500 | :keymap flyspell-mode-map |
| 501 | ;; Mark the mode as on or off. | 501 | :group 'flyspell |
| 502 | (setq flyspell-mode (not (or (and (null arg) flyspell-mode) | 502 | (if flyspell-mode |
| 503 | (<= (prefix-numeric-value arg) 0)))) | 503 | (flyspell-mode-on) |
| 504 | ;; Do the real work. | 504 | (flyspell-mode-off))) |
| 505 | (unless (eq flyspell-mode old-flyspell-mode) | ||
| 506 | (if flyspell-mode | ||
| 507 | (flyspell-mode-on) | ||
| 508 | (flyspell-mode-off)) | ||
| 509 | ;; Force modeline redisplay. | ||
| 510 | (set-buffer-modified-p (buffer-modified-p))))) | ||
| 511 | |||
| 512 | ;*---------------------------------------------------------------------*/ | ||
| 513 | ;* Autoloading */ | ||
| 514 | ;*---------------------------------------------------------------------*/ | ||
| 515 | ;;;###autoload | ||
| 516 | (add-minor-mode 'flyspell-mode | ||
| 517 | 'flyspell-mode-line-string | ||
| 518 | flyspell-mode-map | ||
| 519 | nil | ||
| 520 | 'flyspell-mode) | ||
| 521 | 505 | ||
| 522 | ;*---------------------------------------------------------------------*/ | 506 | ;*---------------------------------------------------------------------*/ |
| 523 | ;* flyspell-buffers ... */ | 507 | ;* flyspell-buffers ... */ |