diff options
| author | Agustín Martín | 2012-12-03 18:15:32 +0100 |
|---|---|---|
| committer | Agustín Martín | 2012-12-03 18:15:32 +0100 |
| commit | 214bd481639b08c3e636ff3c85893f2ac132d576 (patch) | |
| tree | 0da50535b12627f72538718a452b833b65d9ae83 | |
| parent | 329bfd64c27f79cb417d8408aaa006179be9cda9 (diff) | |
| download | emacs-214bd481639b08c3e636ff3c85893f2ac132d576.tar.gz emacs-214bd481639b08c3e636ff3c85893f2ac132d576.zip | |
ispell.el: Use expanded values of personal dictionary for process restart checks.
(ispell-internal-change-dictionary):
Improve ispell process restart checks by using expanded values for ispell
personal dictionary and for related restart check.
(ispell-start-process):
* Remove apparently redundant code that seems better handled from
(ispell-internal-change-dictionary)
* No longer need to expand ispell personal dictionary, it is already
expanded.
Fixes: debbugs:13019
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/textmodes/ispell.el | 21 |
2 files changed, 11 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 89c10440788..503added5cc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -2,7 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | * textmodes/ispell.el (ispell-init-process) | 3 | * textmodes/ispell.el (ispell-init-process) |
| 4 | (ispell-start-process): Make sure personal dictionary name is | 4 | (ispell-start-process): Make sure personal dictionary name is |
| 5 | expanded after initial `default-directory' value (Bug#13019). | 5 | expanded after initial `default-directory' value. Use expanded |
| 6 | values for keep/restart checks (Bug#13019). | ||
| 6 | 7 | ||
| 7 | 2012-12-03 Jay Belanger <jay.p.belanger@gmail.com> | 8 | 2012-12-03 Jay Belanger <jay.p.belanger@gmail.com> |
| 8 | 9 | ||
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 81468fad85f..961fb1bad83 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -2649,11 +2649,8 @@ When asynchronous processes are not supported, `run' is always returned." | |||
| 2649 | (defun ispell-start-process () | 2649 | (defun ispell-start-process () |
| 2650 | "Start the Ispell process, with support for no asynchronous processes. | 2650 | "Start the Ispell process, with support for no asynchronous processes. |
| 2651 | Keeps argument list for future Ispell invocations for no async support." | 2651 | Keeps argument list for future Ispell invocations for no async support." |
| 2652 | ;; Local dictionary becomes the global dictionary in use. | 2652 | ;; `ispell-current-dictionary' and `ispell-current-personal-dictionary' |
| 2653 | (setq ispell-current-dictionary | 2653 | ;; are properly set in `ispell-internal-change-dictionary'. |
| 2654 | (or ispell-local-dictionary ispell-dictionary)) | ||
| 2655 | (setq ispell-current-personal-dictionary | ||
| 2656 | (or ispell-local-pdict ispell-personal-dictionary)) | ||
| 2657 | (let* ((default-directory | 2654 | (let* ((default-directory |
| 2658 | (if (and (file-directory-p default-directory) | 2655 | (if (and (file-directory-p default-directory) |
| 2659 | (file-readable-p default-directory)) | 2656 | (file-readable-p default-directory)) |
| @@ -2668,9 +2665,7 @@ Keeps argument list for future Ispell invocations for no async support." | |||
| 2668 | (list "-d" ispell-current-dictionary)) | 2665 | (list "-d" ispell-current-dictionary)) |
| 2669 | orig-args | 2666 | orig-args |
| 2670 | (if ispell-current-personal-dictionary ; Use specified pers dict. | 2667 | (if ispell-current-personal-dictionary ; Use specified pers dict. |
| 2671 | (list "-p" | 2668 | (list "-p" ispell-current-personal-dictionary)) |
| 2672 | (expand-file-name ispell-current-personal-dictionary | ||
| 2673 | current-ispell-directory))) | ||
| 2674 | ;; If we are using recent aspell or hunspell, make sure we use the | 2669 | ;; If we are using recent aspell or hunspell, make sure we use the |
| 2675 | ;; right encoding for communication. ispell or older aspell/hunspell | 2670 | ;; right encoding for communication. ispell or older aspell/hunspell |
| 2676 | ;; does not support this. | 2671 | ;; does not support this. |
| @@ -2900,13 +2895,15 @@ By just answering RET you can find out what the current dictionary is." | |||
| 2900 | "Update the dictionary and the personal dictionary used by Ispell. | 2895 | "Update the dictionary and the personal dictionary used by Ispell. |
| 2901 | This may kill the Ispell process; if so, a new one will be started | 2896 | This may kill the Ispell process; if so, a new one will be started |
| 2902 | when needed." | 2897 | when needed." |
| 2903 | (let ((dict (or ispell-local-dictionary ispell-dictionary)) | 2898 | (let* ((dict (or ispell-local-dictionary ispell-dictionary)) |
| 2904 | (pdict (or ispell-local-pdict ispell-personal-dictionary))) | 2899 | (pdict (or ispell-local-pdict ispell-personal-dictionary)) |
| 2900 | (expanded-pdict (if pdict (expand-file-name pdict)))) | ||
| 2905 | (unless (and (equal ispell-current-dictionary dict) | 2901 | (unless (and (equal ispell-current-dictionary dict) |
| 2906 | (equal ispell-current-personal-dictionary pdict)) | 2902 | (equal ispell-current-personal-dictionary |
| 2903 | expanded-pdict)) | ||
| 2907 | (ispell-kill-ispell t) | 2904 | (ispell-kill-ispell t) |
| 2908 | (setq ispell-current-dictionary dict | 2905 | (setq ispell-current-dictionary dict |
| 2909 | ispell-current-personal-dictionary pdict)))) | 2906 | ispell-current-personal-dictionary expanded-pdict)))) |
| 2910 | 2907 | ||
| 2911 | ;; Avoid error messages when compiling for these dynamic variables. | 2908 | ;; Avoid error messages when compiling for these dynamic variables. |
| 2912 | (defvar ispell-start) | 2909 | (defvar ispell-start) |