changeset 108538:20b6e2c2c069

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).
author Agustin martin <agustin.martin@hispalinux.es>
date Thu, 13 May 2010 12:36:03 +0200
parents f9f040b85798
children 247a650c5ccd 95b466c28f77
files lisp/ChangeLog lisp/textmodes/ispell.el
diffstat 2 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu May 13 00:57:28 2010 -0700
+++ b/lisp/ChangeLog	Thu May 13 12:36:03 2010 +0200
@@ -1,3 +1,8 @@
+2010-05-13  Agustín Martín  <agustin.martin@hispalinux.es>
+
+	* ispell.el (ispell-init-process): Do not kill ispell process
+	everytime when spellchecking from the minibuffer (bug#6143).
+
 2010-05-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* progmodes/sh-script.el (sh-mode): Use define-derived-mode.
--- a/lisp/textmodes/ispell.el	Thu May 13 00:57:28 2010 -0700
+++ b/lisp/textmodes/ispell.el	Thu May 13 12:36:03 2010 +0200
@@ -2630,11 +2630,22 @@
 	     (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