diff options
| author | Richard M. Stallman | 1998-08-08 23:44:03 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-08-08 23:44:03 +0000 |
| commit | 2ed1f669bd405f98359509dd8649b5df872ea472 (patch) | |
| tree | c520b734426bb1e4ec39317f04e5b35a2be9a06d | |
| parent | a46dba07a8bf41046dcc2c3f170851edc5045f3d (diff) | |
| download | emacs-2ed1f669bd405f98359509dd8649b5df872ea472.tar.gz emacs-2ed1f669bd405f98359509dd8649b5df872ea472.zip | |
(flyspell-command-hook): Option deleted.
(flyspell-mode-on): Delete code to handle flyspell-command-hook.
(flyspell-mode-off): Likewise.
(flyspell-mark-duplications-flag): Doc fix.
(flyspell-duplicate-distance): Doc fix.
(flyspell-duplicate-face): Doc fix.
| -rw-r--r-- | lisp/textmodes/flyspell.el | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index c6e875b8332..f9050122f77 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el | |||
| @@ -65,7 +65,7 @@ Non-nil means use highlight, nil means use minibuffer messages." | |||
| 65 | :type 'boolean) | 65 | :type 'boolean) |
| 66 | 66 | ||
| 67 | (defcustom flyspell-mark-duplications-flag t | 67 | (defcustom flyspell-mark-duplications-flag t |
| 68 | "*Non-nil means Flyspell reports duplications as well as misspellings." | 68 | "*Non-nil means Flyspell reports a repeated word as an error." |
| 69 | :group 'flyspell | 69 | :group 'flyspell |
| 70 | :type 'boolean) | 70 | :type 'boolean) |
| 71 | 71 | ||
| @@ -74,15 +74,14 @@ Non-nil means use highlight, nil means use minibuffer messages." | |||
| 74 | :group 'flyspell | 74 | :group 'flyspell |
| 75 | :type 'boolean) | 75 | :type 'boolean) |
| 76 | 76 | ||
| 77 | (defcustom flyspell-command-hook t | ||
| 78 | "*Non-nil means that `post-command-hook' is used to check already-typed words." | ||
| 79 | :group 'flyspell | ||
| 80 | :type 'boolean) | ||
| 81 | |||
| 82 | (defcustom flyspell-duplicate-distance 10000 | 77 | (defcustom flyspell-duplicate-distance 10000 |
| 83 | "*The maximum distance between duplicate mispelled words, for flagging them. | 78 | "*The maximum distance for finding duplicates of unrecognized words. |
| 79 | This applies to the feature that when a word is not found in the dictionary, | ||
| 80 | if the same spelling occurs elsewhere in the buffer, | ||
| 81 | Flyspell uses a different face (`flyspell-duplicate-face') to highlight it. | ||
| 82 | This variable specifies how far to search to find such a duplicate. | ||
| 84 | -1 means no limit (search the whole buffer). | 83 | -1 means no limit (search the whole buffer). |
| 85 | 0 means do not search for duplicate misspelled words." | 84 | 0 means do not search for duplicate unrecognized spellings." |
| 86 | :group 'flyspell | 85 | :group 'flyspell |
| 87 | :type 'number) | 86 | :type 'number) |
| 88 | 87 | ||
| @@ -246,13 +245,14 @@ property of the major mode name.") | |||
| 246 | (defface flyspell-incorrect-face | 245 | (defface flyspell-incorrect-face |
| 247 | '((((class color)) (:foreground "OrangeRed" :bold t :underline t)) | 246 | '((((class color)) (:foreground "OrangeRed" :bold t :underline t)) |
| 248 | (t (:bold t))) | 247 | (t (:bold t))) |
| 249 | "Face used for showing misspelled words in Flyspell." | 248 | "Face used for marking a misspelled word in Flyspell." |
| 250 | :group 'flyspell) | 249 | :group 'flyspell) |
| 251 | 250 | ||
| 252 | (defface flyspell-duplicate-face | 251 | (defface flyspell-duplicate-face |
| 253 | '((((class color)) (:foreground "Gold3" :bold t :underline t)) | 252 | '((((class color)) (:foreground "Gold3" :bold t :underline t)) |
| 254 | (t (:bold t))) | 253 | (t (:bold t))) |
| 255 | "Face used for showing misspelled words in Flyspell." | 254 | "Face used for marking a misspelled word that appears twice in the buffer. |
| 255 | See also `flyspell-duplicate-distance'." | ||
| 256 | :group 'flyspell) | 256 | :group 'flyspell) |
| 257 | 257 | ||
| 258 | (defvar flyspell-overlay nil) | 258 | (defvar flyspell-overlay nil) |
| @@ -317,21 +317,11 @@ flyspell-buffer checks the whole buffer." | |||
| 317 | ;; We put the `flyspel-delayed' property on some commands. | 317 | ;; We put the `flyspel-delayed' property on some commands. |
| 318 | (flyspell-delay-commands) | 318 | (flyspell-delay-commands) |
| 319 | ;; we bound flyspell action to post-command hook | 319 | ;; we bound flyspell action to post-command hook |
| 320 | (if flyspell-command-hook | 320 | (make-local-hook 'post-command-hook) |
| 321 | (progn | 321 | (add-hook 'post-command-hook (function flyspell-post-command-hook) t t) |
| 322 | (make-local-hook 'post-command-hook) | ||
| 323 | (add-hook 'post-command-hook | ||
| 324 | (function flyspell-post-command-hook) | ||
| 325 | t | ||
| 326 | t))) | ||
| 327 | ;; we bound flyspell action to pre-command hook | 322 | ;; we bound flyspell action to pre-command hook |
| 328 | (if flyspell-command-hook | 323 | (make-local-hook 'pre-command-hook) |
| 329 | (progn | 324 | (add-hook 'pre-command-hook (function flyspell-pre-command-hook) t t) |
| 330 | (make-local-hook 'pre-command-hook) | ||
| 331 | (add-hook 'pre-command-hook | ||
| 332 | (function flyspell-pre-command-hook) | ||
| 333 | t | ||
| 334 | t))) | ||
| 335 | 325 | ||
| 336 | ;; Set flyspell-generic-check-word-p based on the major mode. | 326 | ;; Set flyspell-generic-check-word-p based on the major mode. |
| 337 | (let ((mode-predicate (get major-mode 'flyspell-mode-predicate))) | 327 | (let ((mode-predicate (get major-mode 'flyspell-mode-predicate))) |
| @@ -431,14 +421,8 @@ COMMAND is the name of the command to be delayed." | |||
| 431 | (if flyspell-multi-language-p | 421 | (if flyspell-multi-language-p |
| 432 | (ispell-kill-ispell t)) | 422 | (ispell-kill-ispell t)) |
| 433 | ;; we remove the hooks | 423 | ;; we remove the hooks |
| 434 | (if flyspell-command-hook | 424 | (remove-hook 'post-command-hook (function flyspell-post-command-hook) t) |
| 435 | (progn | 425 | (remove-hook 'pre-command-hook (function flyspell-pre-command-hook) t) |
| 436 | (remove-hook 'post-command-hook | ||
| 437 | (function flyspell-post-command-hook) | ||
| 438 | t) | ||
| 439 | (remove-hook 'pre-command-hook | ||
| 440 | (function flyspell-pre-command-hook) | ||
| 441 | t))) | ||
| 442 | ;; we remove all the flyspell hilightings | 426 | ;; we remove all the flyspell hilightings |
| 443 | (flyspell-delete-all-overlays) | 427 | (flyspell-delete-all-overlays) |
| 444 | ;; we have to erase pre cache variables | 428 | ;; we have to erase pre cache variables |
| @@ -468,10 +452,10 @@ Mostly we check word delimiters." | |||
| 468 | (and (looking-at (flyspell-get-not-casechars)) | 452 | (and (looking-at (flyspell-get-not-casechars)) |
| 469 | (or flyspell-consider-dash-as-word-delimiter-flag | 453 | (or flyspell-consider-dash-as-word-delimiter-flag |
| 470 | (not (looking-at "\\-")))))) | 454 | (not (looking-at "\\-")))))) |
| 471 | ;; yes because we have reached or typed a word delimiter | 455 | ;; yes because we have reached or typed a word delimiter. |
| 472 | t) | 456 | t) |
| 473 | ((not (integerp flyspell-delay)) | 457 | ((not (integerp flyspell-delay)) |
| 474 | ;; yes because the user had settup a non delay configuration | 458 | ;; yes because the user had set up a no-delay configuration. |
| 475 | t) | 459 | t) |
| 476 | (t | 460 | (t |
| 477 | (if (fboundp 'about-xemacs) | 461 | (if (fboundp 'about-xemacs) |