From: Martin Rudalics Date: Thu, 17 May 2007 08:28:29 +0000 (+0000) Subject: (ispell-start-process): Defend against bad default-directory. X-Git-Url: http://git.hcoop.net/bpt/emacs.git/commitdiff_plain/ef1f3012faf1ef629c7b82e9dcbf043a78d8b4ab?hp=464df798e9bacb3a7ec9c0ead081c31e3e1d024d (ispell-start-process): Defend against bad default-directory. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 650348ed7a..7d083fb797 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-05-17 Martin Rudalics + + * textmodes/ispell.el (ispell-start-process): Defend against bad + default-directory. + 2007-05-17 Stefan Monnier * vc-hooks.el (vc-find-root): Stop searching when the user changes. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index a3c9575d90..e4b2dd9f04 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2483,7 +2483,12 @@ 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." - (let (args) + (let ((default-directory default-directory) + args) + (unless (and (file-directory-p default-directory) + (file-readable-p default-directory)) + ;; Defend against bad `default-directory'. + (setq default-directory (expand-file-name "~/"))) ;; Local dictionary becomes the global dictionary in use. (setq ispell-current-dictionary (or ispell-local-dictionary ispell-dictionary))