diff options
| author | Eli Zaretskii | 2018-05-06 21:20:31 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2018-05-06 21:20:31 +0300 |
| commit | 91e582a31ada28fab5ae55bdbf959a9d30796587 (patch) | |
| tree | 654a9b0d243760216aaf1aea5671f21876cb8a29 | |
| parent | 6464a8d702d56f26d34d989a9182396cdc6197a8 (diff) | |
| download | emacs-91e582a31ada28fab5ae55bdbf959a9d30796587.tar.gz emacs-91e582a31ada28fab5ae55bdbf959a9d30796587.zip | |
Don't remove highlight of misspelled word on pdict save
* lisp/textmodes/ispell.el (ispell-pdict-save): Don't restart
flyspell-mode, as bug#11963, which this was supposed to fix, is
fixed better by ispell-command-loop, when the user types 'i' or
'a'. Restarting Flyspell mode when the personal dictionary is
saved caused bug#31372 as side effect.
(ispell-command-loop): Test 'flyspell-mode', not whether
flyspell-unhighlight-at is fboundp, to determine whether Flyspell
mode is turned on in the current buffer.
(flyspell-unhighlight-at): Add declare-function form for it.
| -rw-r--r-- | lisp/textmodes/ispell.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 1dc39650861..d03d12b3758 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -117,6 +117,8 @@ | |||
| 117 | 117 | ||
| 118 | (defalias 'check-ispell-version 'ispell-check-version) | 118 | (defalias 'check-ispell-version 'ispell-check-version) |
| 119 | 119 | ||
| 120 | (declare-function flyspell-unhighlight-at "flyspell" (pos)) | ||
| 121 | |||
| 120 | ;;; ********************************************************************** | 122 | ;;; ********************************************************************** |
| 121 | ;;; The following variables should be set according to personal preference | 123 | ;;; The following variables should be set according to personal preference |
| 122 | ;;; and location of binaries: | 124 | ;;; and location of binaries: |
| @@ -2086,10 +2088,7 @@ If so, ask if it needs to be saved." | |||
| 2086 | (or no-query | 2088 | (or no-query |
| 2087 | (y-or-n-p "Personal dictionary modified. Save? "))) | 2089 | (y-or-n-p "Personal dictionary modified. Save? "))) |
| 2088 | (ispell-send-string "#\n") ; save dictionary | 2090 | (ispell-send-string "#\n") ; save dictionary |
| 2089 | (message "Personal dictionary saved.") | 2091 | (message "Personal dictionary saved.")) |
| 2090 | (when flyspell-mode | ||
| 2091 | (flyspell-mode 0) | ||
| 2092 | (flyspell-mode 1))) | ||
| 2093 | ;; unassert variable, even if not saved to avoid questioning. | 2092 | ;; unassert variable, even if not saved to avoid questioning. |
| 2094 | (setq ispell-pdict-modified-p nil)) | 2093 | (setq ispell-pdict-modified-p nil)) |
| 2095 | 2094 | ||
| @@ -2217,15 +2216,16 @@ Global `ispell-quit' set to start location to continue spell session." | |||
| 2217 | ((= char ?i) ; accept and insert word into pers dict | 2216 | ((= char ?i) ; accept and insert word into pers dict |
| 2218 | (ispell-send-string (concat "*" word "\n")) | 2217 | (ispell-send-string (concat "*" word "\n")) |
| 2219 | (setq ispell-pdict-modified-p '(t)) ; dictionary modified! | 2218 | (setq ispell-pdict-modified-p '(t)) ; dictionary modified! |
| 2220 | (when (fboundp 'flyspell-unhighlight-at) | 2219 | |
| 2221 | (flyspell-unhighlight-at start)) | 2220 | (when flyspell-mode |
| 2221 | (flyspell-unhighlight-at start)) | ||
| 2222 | nil) | 2222 | nil) |
| 2223 | ((or (= char ?a) (= char ?A)) ; accept word without insert | 2223 | ((or (= char ?a) (= char ?A)) ; accept word without insert |
| 2224 | (ispell-send-string (concat "@" word "\n")) | 2224 | (ispell-send-string (concat "@" word "\n")) |
| 2225 | (cl-pushnew word ispell-buffer-session-localwords | 2225 | (cl-pushnew word ispell-buffer-session-localwords |
| 2226 | :test #'equal) | 2226 | :test #'equal) |
| 2227 | (when (fboundp 'flyspell-unhighlight-at) | 2227 | (when flyspell-mode |
| 2228 | (flyspell-unhighlight-at start)) | 2228 | (flyspell-unhighlight-at start)) |
| 2229 | (or ispell-buffer-local-name ; session localwords might conflict | 2229 | (or ispell-buffer-local-name ; session localwords might conflict |
| 2230 | (setq ispell-buffer-local-name (buffer-name))) | 2230 | (setq ispell-buffer-local-name (buffer-name))) |
| 2231 | (if (null ispell-pdict-modified-p) | 2231 | (if (null ispell-pdict-modified-p) |