mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-23 05:17:35 +00:00
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.
This commit is contained in:
parent
6464a8d702
commit
91e582a31a
1 changed files with 8 additions and 8 deletions
|
|
@ -117,6 +117,8 @@
|
|||
|
||||
(defalias 'check-ispell-version 'ispell-check-version)
|
||||
|
||||
(declare-function flyspell-unhighlight-at "flyspell" (pos))
|
||||
|
||||
;;; **********************************************************************
|
||||
;;; The following variables should be set according to personal preference
|
||||
;;; and location of binaries:
|
||||
|
|
@ -2086,10 +2088,7 @@ If so, ask if it needs to be saved."
|
|||
(or no-query
|
||||
(y-or-n-p "Personal dictionary modified. Save? ")))
|
||||
(ispell-send-string "#\n") ; save dictionary
|
||||
(message "Personal dictionary saved.")
|
||||
(when flyspell-mode
|
||||
(flyspell-mode 0)
|
||||
(flyspell-mode 1)))
|
||||
(message "Personal dictionary saved."))
|
||||
;; unassert variable, even if not saved to avoid questioning.
|
||||
(setq ispell-pdict-modified-p nil))
|
||||
|
||||
|
|
@ -2217,15 +2216,16 @@ Global `ispell-quit' set to start location to continue spell session."
|
|||
((= char ?i) ; accept and insert word into pers dict
|
||||
(ispell-send-string (concat "*" word "\n"))
|
||||
(setq ispell-pdict-modified-p '(t)) ; dictionary modified!
|
||||
(when (fboundp 'flyspell-unhighlight-at)
|
||||
(flyspell-unhighlight-at start))
|
||||
|
||||
(when flyspell-mode
|
||||
(flyspell-unhighlight-at start))
|
||||
nil)
|
||||
((or (= char ?a) (= char ?A)) ; accept word without insert
|
||||
(ispell-send-string (concat "@" word "\n"))
|
||||
(cl-pushnew word ispell-buffer-session-localwords
|
||||
:test #'equal)
|
||||
(when (fboundp 'flyspell-unhighlight-at)
|
||||
(flyspell-unhighlight-at start))
|
||||
(when flyspell-mode
|
||||
(flyspell-unhighlight-at start))
|
||||
(or ispell-buffer-local-name ; session localwords might conflict
|
||||
(setq ispell-buffer-local-name (buffer-name)))
|
||||
(if (null ispell-pdict-modified-p)
|
||||
|
|
|
|||
Loading…
Reference in a new issue