]> code.delx.au - gnu-emacs/commitdiff
ispell.el: Use expanded values of personal dictionary for process restart checks.
authorAgustín Martín <agustin.martin@hispalinux.es>
Mon, 3 Dec 2012 17:15:32 +0000 (18:15 +0100)
committerAgustín Martín <agustin.martin@hispalinux.es>
Mon, 3 Dec 2012 17:15:32 +0000 (18:15 +0100)
(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
lisp/ChangeLog
lisp/textmodes/ispell.el

index 89c10440788e01226eb27155de8b501a7854c948..503added5cc8060f9b85d0b2dcf29ce618271ad7 100644 (file)
@@ -2,7 +2,8 @@
 
        * textmodes/ispell.el (ispell-init-process)
        (ispell-start-process): Make sure personal dictionary name is
-       expanded after initial `default-directory' value (Bug#13019).
+       expanded after initial `default-directory' value. Use expanded
+       values for keep/restart checks (Bug#13019).
 
 2012-12-03  Jay Belanger  <jay.p.belanger@gmail.com>
 
index 81468fad85f825c1393fe3f0d3d7ef41c1ed61eb..961fb1bad837b7e352462d30bd42fbe9ba76b735 100644 (file)
@@ -2649,11 +2649,8 @@ When asynchronous processes are not supported, `run' is always returned."
 (defun ispell-start-process ()
   "Start the Ispell process, with support for no asynchronous processes.
 Keeps argument list for future Ispell invocations for no async support."
-  ;; Local dictionary becomes the global dictionary in use.
-  (setq ispell-current-dictionary
-        (or ispell-local-dictionary ispell-dictionary))
-  (setq ispell-current-personal-dictionary
-        (or ispell-local-pdict ispell-personal-dictionary))
+  ;; `ispell-current-dictionary' and `ispell-current-personal-dictionary'
+  ;; are properly set in `ispell-internal-change-dictionary'.
   (let* ((default-directory
            (if (and (file-directory-p default-directory)
                     (file-readable-p default-directory))
@@ -2668,9 +2665,7 @@ Keeps argument list for future Ispell invocations for no async support."
                (list "-d" ispell-current-dictionary))
            orig-args
            (if ispell-current-personal-dictionary ; Use specified pers dict.
-               (list "-p"
-                     (expand-file-name ispell-current-personal-dictionary
-                                      current-ispell-directory)))
+               (list "-p" ispell-current-personal-dictionary))
            ;; If we are using recent aspell or hunspell, make sure we use the
            ;; right encoding for communication. ispell or older aspell/hunspell
            ;; does not support this.
@@ -2900,13 +2895,15 @@ By just answering RET you can find out what the current dictionary is."
   "Update the dictionary and the personal dictionary used by Ispell.
 This may kill the Ispell process; if so, a new one will be started
 when needed."
-  (let ((dict (or ispell-local-dictionary ispell-dictionary))
-       (pdict (or ispell-local-pdict ispell-personal-dictionary)))
+  (let* ((dict (or ispell-local-dictionary ispell-dictionary))
+        (pdict (or ispell-local-pdict ispell-personal-dictionary))
+        (expanded-pdict (if pdict (expand-file-name pdict))))
     (unless (and (equal ispell-current-dictionary dict)
-                (equal ispell-current-personal-dictionary pdict))
+                (equal ispell-current-personal-dictionary
+                       expanded-pdict))
       (ispell-kill-ispell t)
       (setq ispell-current-dictionary dict
-           ispell-current-personal-dictionary pdict))))
+           ispell-current-personal-dictionary expanded-pdict))))
 
 ;; Avoid error messages when compiling for these dynamic variables.
 (defvar ispell-start)