From 57ff5d7b960ff48cba12d91d93f420d62cbcdf63 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Agust=C3=ADn=20Mart=C3=ADn?= Date: Thu, 13 May 2010 12:36:03 +0200 Subject: [PATCH] Do not ispell-kill-ispell over and over when spellchecking minibuffer contents. * ispell.el (ispell-init-process): Do not kill ispell process everytime when spellchecking from the minibuffer (bug#6143). --- lisp/ChangeLog | 5 +++++ lisp/textmodes/ispell.el | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4b73a4fd6df..8c4b4d5c40d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-05-13 Agustín Martín + + * ispell.el (ispell-init-process): Do not kill ispell process + everytime when spellchecking from the minibuffer (bug#6143). + 2010-05-13 Stefan Monnier * progmodes/sh-script.el (sh-mode): Use define-derived-mode. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c88b32f64cc..94eb721e4cf 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2630,11 +2630,22 @@ Keeps argument list for future ispell invocations for no async support." (or ispell-local-dictionary ispell-dictionary "default")) (sit-for 0) (setq ispell-library-directory (ispell-check-version) - ispell-process-directory default-directory ispell-process (ispell-start-process) ispell-filter nil - ispell-filter-continue nil - ispell-process-buffer-name (buffer-name)) + ispell-filter-continue nil) + ;; When spellchecking minibuffer contents, make sure ispell process + ;; is not restarted every time the minibuffer is killed. + (if (window-minibuffer-p) + (if (fboundp 'minibuffer-selected-window) + ;; Assign ispell process to parent buffer + (setq ispell-process-directory default-directory + ispell-process-buffer-name (window-buffer (minibuffer-selected-window))) + ;; Force `ispell-process-directory' to $HOME and use a dummy name + (setq ispell-process-directory (expand-file-name "~/") + ispell-process-buffer-name " * Minibuffer-has-spellcheck-enabled")) + ;; Not in a minibuffer + (setq ispell-process-directory default-directory + ispell-process-buffer-name (buffer-name))) (if ispell-async-processp (set-process-filter ispell-process 'ispell-filter)) ;; protect against bogus binding of `enable-multibyte-characters' in XEmacs -- 2.39.2