diff options
| author | Agustín Martín | 2010-04-27 12:44:44 +0200 |
|---|---|---|
| committer | Agustín Martín | 2010-04-27 12:44:44 +0200 |
| commit | 681c14d0b4d1a3c368dae9014ca9ed99515f61bf (patch) | |
| tree | edaf6fd8b7e82c1f36a38b8e6a8eaab284170515 | |
| parent | 7fd689fc4ab40d925d8db85f3550fe29f590a2e4 (diff) | |
| download | emacs-681c14d0b4d1a3c368dae9014ca9ed99515f61bf.tar.gz emacs-681c14d0b4d1a3c368dae9014ca9ed99515f61bf.zip | |
ispell.el: Kill ispell process when killing its associated buffer.
(ispell-init-process,ispell-kill-ispell,kill-buffer-hook):
Kill ispell process when killing its associated buffer.
| -rw-r--r-- | lisp/textmodes/ispell.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c9ede28e054..c88b32f64cc 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el | |||
| @@ -1334,6 +1334,9 @@ Protects against bogus binding of `enable-multibyte-characters' in XEmacs." | |||
| 1334 | (defvar ispell-process-directory nil | 1334 | (defvar ispell-process-directory nil |
| 1335 | "The directory where `ispell-process' was started.") | 1335 | "The directory where `ispell-process' was started.") |
| 1336 | 1336 | ||
| 1337 | (defvar ispell-process-buffer-name nil | ||
| 1338 | "The buffer where `ispell-process' was started.") | ||
| 1339 | |||
| 1337 | (defvar ispell-filter nil | 1340 | (defvar ispell-filter nil |
| 1338 | "Output filter from piped calls to Ispell.") | 1341 | "Output filter from piped calls to Ispell.") |
| 1339 | 1342 | ||
| @@ -2630,7 +2633,8 @@ Keeps argument list for future ispell invocations for no async support." | |||
| 2630 | ispell-process-directory default-directory | 2633 | ispell-process-directory default-directory |
| 2631 | ispell-process (ispell-start-process) | 2634 | ispell-process (ispell-start-process) |
| 2632 | ispell-filter nil | 2635 | ispell-filter nil |
| 2633 | ispell-filter-continue nil) | 2636 | ispell-filter-continue nil |
| 2637 | ispell-process-buffer-name (buffer-name)) | ||
| 2634 | (if ispell-async-processp | 2638 | (if ispell-async-processp |
| 2635 | (set-process-filter ispell-process 'ispell-filter)) | 2639 | (set-process-filter ispell-process 'ispell-filter)) |
| 2636 | ;; protect against bogus binding of `enable-multibyte-characters' in XEmacs | 2640 | ;; protect against bogus binding of `enable-multibyte-characters' in XEmacs |
| @@ -2691,10 +2695,16 @@ With NO-ERROR, just return non-nil if there was no Ispell running." | |||
| 2691 | (kill-buffer ispell-session-buffer) | 2695 | (kill-buffer ispell-session-buffer) |
| 2692 | (setq ispell-output-buffer nil | 2696 | (setq ispell-output-buffer nil |
| 2693 | ispell-session-buffer nil)) | 2697 | ispell-session-buffer nil)) |
| 2698 | (setq ispell-process-buffer-name nil) | ||
| 2694 | (setq ispell-process nil) | 2699 | (setq ispell-process nil) |
| 2695 | (message "Ispell process killed") | 2700 | (message "Ispell process killed") |
| 2696 | nil)) | 2701 | nil)) |
| 2697 | 2702 | ||
| 2703 | ;; Kill ispell process when killing its associated buffer | ||
| 2704 | (add-hook 'kill-buffer-hook | ||
| 2705 | '(lambda () | ||
| 2706 | (if (equal ispell-process-buffer-name (buffer-name)) | ||
| 2707 | (ispell-kill-ispell t)))) | ||
| 2698 | 2708 | ||
| 2699 | ;;; ispell-change-dictionary is set in some people's hooks. Maybe this should | 2709 | ;;; ispell-change-dictionary is set in some people's hooks. Maybe this should |
| 2700 | ;;; call ispell-init-process rather than wait for a spell checking command? | 2710 | ;;; call ispell-init-process rather than wait for a spell checking command? |