diff options
Diffstat (limited to 'lisp/textmodes/ispell.el')
-rw-r--r-- | lisp/textmodes/ispell.el | 107 |
1 files changed, 57 insertions, 50 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index a4bf454fdcb..b58514972a1 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -296,7 +296,8 @@ The following values are supported: "Non-nil means suppress messages in `ispell-word'." :type 'boolean) -(defvaralias 'ispell-format-word 'ispell-format-word-function) +(define-obsolete-variable-alias 'ispell-format-word + 'ispell-format-word-function "29.1") (defcustom ispell-format-word-function (function upcase) "Formatting function for displaying word being spell checked. @@ -796,6 +797,9 @@ See `ispell-buffer-with-debug' for an example of use." "An alist of parsed Aspell dicts and associated parameters. Internal use.") +(defvar ispell--aspell-found-dictionaries nil + "An alist of identified aspell dictionaries.") + (defun ispell-find-aspell-dictionaries () "Find Aspell's dictionaries, and record in `ispell-aspell-dictionary-alist'." (let* ((dictionaries @@ -809,7 +813,8 @@ Internal use.") (mapcar #'ispell-aspell-find-dictionary dictionaries)))) ;; Ensure aspell's alias dictionary will override standard ;; definitions. - (setq found (ispell-aspell-add-aliases found)) + (setq found (ispell-aspell-add-aliases found) + ispell--aspell-found-dictionaries (copy-sequence found)) ;; Merge into FOUND any elements from the standard ispell-dictionary-base-alist ;; which have no element in FOUND at all. (dolist (dict ispell-dictionary-base-alist) @@ -1377,9 +1382,11 @@ The variable `ispell-library-directory' defines their location." (if (and name (or ;; Include all for Aspell (we already know existing dicts) - ispell-really-aspell + (and ispell-really-aspell + (assoc name ispell--aspell-found-dictionaries)) ;; Include all if `ispell-library-directory' is nil (Hunspell) - (not ispell-library-directory) + (and (not ispell-really-aspell) + (not ispell-library-directory)) ;; If explicit (-d with an absolute path) and existing dict. (and dict-explt (file-name-absolute-p dict-explt) @@ -1672,14 +1679,13 @@ Valid forms include: ("\\\\bibliographystyle" ispell-tex-arg-end) ("\\\\makebox" ispell-tex-arg-end 0) ("\\\\e?psfig" ispell-tex-arg-end) - ("\\\\document\\(class\\|style\\)" . - "\\\\begin[ \t\n]*{[ \t\n]*document[ \t\n]*}")) + ("\\\\document\\(class\\|style\\)" . "\\\\begin[ \t\n]*{document}")) (;; delimited with \begin. In ispell: displaymath, eqnarray, eqnarray*, ;; equation, minipage, picture, tabular, tabular* (ispell) ("\\(figure\\|table\\)\\*?" ispell-tex-arg-end 0) ("list" ispell-tex-arg-end 2) - ("program" . "\\\\end[ \t\n]*{[ \t\n]*program[ \t\n]*}") - ("verbatim\\*?" . "\\\\end[ \t\n]*{[ \t\n]*verbatim\\*?[ \t\n]*}")))) + ("program" . "\\\\end[ \t]*{program}") + ("verbatim\\*?" . "\\\\end[ \t]*{verbatim\\*?}")))) "Lists of regions to be skipped in TeX mode. First list is used raw. Second list has key placed inside \\begin{}. @@ -2398,24 +2404,24 @@ Global `ispell-quit' set to start location to continue spell session." Selections are: -DIGIT: Replace the word with a digit offered in the *Choices* buffer. -SPC: Accept word this time. -`i': Accept word and insert into private dictionary. -`a': Accept word for this session. -`A': Accept word and place in `buffer-local dictionary'. -`r': Replace word with typed-in value. Rechecked. -`R': Replace word with typed-in value. Query-replaced in buffer. Rechecked. -`?': Show these commands. -`x': Exit spelling buffer. Move cursor to original point. -`X': Exit spelling buffer. Leaves cursor at the current point, and permits +\\`0'..\\`9' Replace the word with a digit offered in the *Choices* buffer. +\\`SPC' Accept word this time. +\\`i' Accept word and insert into private dictionary. +\\`a' Accept word for this session. +\\`A' Accept word and place in `buffer-local dictionary'. +\\`r' Replace word with typed-in value. Rechecked. +\\`R' Replace word with typed-in value. Query-replaced in buffer. Rechecked. +\\`?' Show these commands. +\\`x' Exit spelling buffer. Move cursor to original point. +\\`X' Exit spelling buffer. Leaves cursor at the current point, and permits the aborted check to be completed later. -`q': Quit spelling session (Kills ispell process). -`l': Look up typed-in replacement in alternate dictionary. Wildcards okay. -`u': Like `i', but the word is lower-cased first. -`m': Place typed-in value in personal dictionary, then recheck current word. -`C-l': Redraw screen. -`C-r': Recursive edit. -`C-z': Suspend Emacs or iconify frame." +\\`q' Quit spelling session (Kills ispell process). +\\`l' Look up typed-in replacement in alternate dictionary. Wildcards okay. +\\`u' Like \\`i', but the word is lower-cased first. +\\`m' Place typed-in value in personal dictionary, then recheck current word. +\\`C-l' Redraw screen. +\\`C-r' Recursive edit. +\\`C-z' Suspend Emacs or iconify frame." (if (equal ispell-help-in-bufferp 'electric) (progn @@ -2428,26 +2434,28 @@ SPC: Accept word this time. ;;(if (< (window-height) 15) ;; (enlarge-window ;; (- 15 (ispell-adjusted-window-height)))) - (princ "Selections are: - -DIGIT: Replace the word with a digit offered in the *Choices* buffer. -SPC: Accept word this time. -`i': Accept word and insert into private dictionary. -`a': Accept word for this session. -`A': Accept word and place in `buffer-local dictionary'. -`r': Replace word with typed-in value. Rechecked. -`R': Replace word with typed-in value. Query-replaced in buffer. Rechecked. -`?': Show these commands. -`x': Exit spelling buffer. Move cursor to original point. -`X': Exit spelling buffer. Leaves cursor at the current point, and permits - the aborted check to be completed later. -`q': Quit spelling session (Kills ispell process). -`l': Look up typed-in replacement in alternate dictionary. Wildcards okay. -`u': Like `i', but the word is lower-cased first. -`m': Place typed-in value in personal dictionary, then recheck current word. -`C-l': Redraw screen. -`C-r': Recursive edit. -`C-z': Suspend Emacs or iconify frame.") + (princ + (substitute-command-keys + "Selections are: + +\\`0'..\\`9' Replace the word with a digit offered in the *Choices* buffer. +\\`SPC' Accept word this time. +\\`i' Accept word and insert into private dictionary. +\\`a' Accept word for this session. +\\`A' Accept word and place in `buffer-local dictionary'. +\\`r' Replace word with typed-in value. Rechecked. +\\`R' Replace word with typed-in value. Query-replaced in buffer. Rechecked. +\\`?' Show these commands. +\\`x' Exit spelling buffer. Move cursor to original point. +\\`X' Exit spelling buffer. Leaves cursor at the current point, and permits + the aborted check to be completed later. +\\`q' Quit spelling session (Kills ispell process). +\\`l' Look up typed-in replacement in alternate dictionary. Wildcards okay. +\\`u' Like \\`i', but the word is lower-cased first. +\\`m' Place typed-in value in personal dictionary, then recheck current word. +\\`C-l' Redraw screen. +\\`C-r' Recursive edit. +\\`C-z' Suspend Emacs or iconify frame.")) nil))) @@ -2984,8 +2992,7 @@ By just answering RET you can find out what the current dictionary is." (interactive (list (completing-read "Use new dictionary (RET for current, SPC to complete): " - (and (fboundp 'ispell-valid-dictionary-list) - (mapcar #'list (ispell-valid-dictionary-list))) + (mapcar #'list (ispell-valid-dictionary-list)) nil t) current-prefix-arg)) (ispell-set-spellchecker-params) ; Initialize variables and dicts alists @@ -3883,8 +3890,8 @@ Don't check spelling of message headers except the Subject field. Don't check included messages. To abort spell checking of a message region and send the message anyway, -use the `x' command. (Any subsequent regions will be checked.) -The `X' command aborts sending the message so that you can edit the buffer. +use the \\`x' command. (Any subsequent regions will be checked.) +The \\`X' command aborts sending the message so that you can edit the buffer. To spell-check whenever a message is sent, include the appropriate lines in your init file: @@ -3975,7 +3982,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to (if (re-search-forward "^Subject: *" end-of-headers t) (progn (goto-char (match-end 0)) - (if (and (not (looking-at ".*Re\\>")) + (if (and (not (looking-at ".*\\<Re\\>")) (not (looking-at "\\["))) (progn (setq case-fold-search old-case-fold-search) |