# HG changeset patch # User Chong Yidong # Date 1220731669 0 # Node ID fa8fea8ec49ae11047c3d687b0ae51df6bc8ffa8 # Parent f5d9629680f8d4ab38cf91e1fb29ae2dff155678 (ispell-command-loop): Suspend ispell if the user enters a mouse event in another frame, or a special event. diff -r f5d9629680f8 -r fa8fea8ec49a lisp/textmodes/ispell.el --- a/lisp/textmodes/ispell.el Sat Sep 06 20:07:40 2008 +0000 +++ b/lisp/textmodes/ispell.el Sat Sep 06 20:07:49 2008 +0000 @@ -1858,14 +1858,23 @@ (let (message-log-max) (message (concat "C-h or ? for more options; SPC to leave " "unchanged, Character to replace word"))) - (let ((inhibit-quit t)) - (setq char (if (fboundp 'read-char-exclusive) - (read-char-exclusive) - (read-char)) - skipped 0) - (if (or quit-flag (= char ?\C-g)) ; C-g is like typing X - (setq char ?X - quit-flag nil))) + (let ((inhibit-quit t) + (input-valid t)) + (setq char nil skipped 0) + ;; If the user types C-g, or generates some other + ;; non-character event (such as a frame switch + ;; event), stop ispell. As a special exception, + ;; ignore mouse events occuring in the same frame. + (while (and input-valid (not (characterp char))) + (setq char (read-event)) + (setq input-valid + (or (characterp char) + (and (mouse-event-p char) + (eq (selected-frame) + (window-frame + (posn-window (event-start char)))))))) + (when (or quit-flag (not input-valid) (= char ?\C-g)) + (setq char ?X quit-flag nil))) ;; Adjust num to array offset skipping command characters. (let ((com-chars command-characters)) (while com-chars