aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-09-06 20:07:49 +0000
committerChong Yidong2008-09-06 20:07:49 +0000
commit09144fdd27ea5d688ea6e9c15a3daee7499a5711 (patch)
tree3914709babfe31c7a9eea71ee098a8f4f29f6ca7
parent269feb23db62b0535b0088eb3325ad385f1d269b (diff)
downloademacs-09144fdd27ea5d688ea6e9c15a3daee7499a5711.tar.gz
emacs-09144fdd27ea5d688ea6e9c15a3daee7499a5711.zip
(ispell-command-loop): Suspend ispell if the user enters a mouse event
in another frame, or a special event.
-rw-r--r--lisp/textmodes/ispell.el25
1 files changed, 17 insertions, 8 deletions
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index b752f873d8c..d6a5da48d35 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1858,14 +1858,23 @@ Global `ispell-quit' set to start location to continue spell session."
1858 (let (message-log-max) 1858 (let (message-log-max)
1859 (message (concat "C-h or ? for more options; SPC to leave " 1859 (message (concat "C-h or ? for more options; SPC to leave "
1860 "unchanged, Character to replace word"))) 1860 "unchanged, Character to replace word")))
1861 (let ((inhibit-quit t)) 1861 (let ((inhibit-quit t)
1862 (setq char (if (fboundp 'read-char-exclusive) 1862 (input-valid t))
1863 (read-char-exclusive) 1863 (setq char nil skipped 0)
1864 (read-char)) 1864 ;; If the user types C-g, or generates some other
1865 skipped 0) 1865 ;; non-character event (such as a frame switch
1866 (if (or quit-flag (= char ?\C-g)) ; C-g is like typing X 1866 ;; event), stop ispell. As a special exception,
1867 (setq char ?X 1867 ;; ignore mouse events occuring in the same frame.
1868 quit-flag nil))) 1868 (while (and input-valid (not (characterp char)))
1869 (setq char (read-event))
1870 (setq input-valid
1871 (or (characterp char)
1872 (and (mouse-event-p char)
1873 (eq (selected-frame)
1874 (window-frame
1875 (posn-window (event-start char))))))))
1876 (when (or quit-flag (not input-valid) (= char ?\C-g))
1877 (setq char ?X quit-flag nil)))
1869 ;; Adjust num to array offset skipping command characters. 1878 ;; Adjust num to array offset skipping command characters.
1870 (let ((com-chars command-characters)) 1879 (let ((com-chars command-characters))
1871 (while com-chars 1880 (while com-chars