1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

(ispell-start-process): Defend against bad default-directory.

This commit is contained in:
Martin Rudalics 2007-05-16 05:51:51 +00:00
parent 9fff44d500
commit 4132d58cf8
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-05-16 Martin Rudalics <rudalics@gmx.at>
* textmodes/ispell.el (ispell-start-process): Defend against bad
default-directory.
2007-05-14 Eli Zaretskii <eliz@gnu.org>
* mail/rmail.el (rmail-convert-to-babyl-format): Check

View File

@ -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))