From: Barry O'Reilly Date: Sat, 16 Nov 2013 20:27:24 +0000 (-0500) Subject: * semantic/fw.el (semantic-exit-on-input) X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~808 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2bde2cf14383ab0cddca30f64180a2f7ecde7668;p=emacs.git * semantic/fw.el (semantic-exit-on-input) (semantic-throw-on-input): Restore point before accept-process-output because timers which redisplay can run. (Bug#15045) --- diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 88174e515f4..7e5033c6cfe 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog @@ -1,3 +1,10 @@ +2013-10-28 Barry O'Reilly + + * semantic/fw.el (semantic-exit-on-input) + (semantic-throw-on-input): Restore point before + accept-process-output because timers which redisplay can run. + (Bug#15045) + 2013-11-03 Johan Bockgård * semantic/lex.el (semantic-lex-start-block) diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el index 825cdc9f0a4..869d183514d 100644 --- a/lisp/cedet/semantic/fw.el +++ b/lisp/cedet/semantic/fw.el @@ -369,6 +369,8 @@ later installation should be done in MODE hook." ;; (defvar semantic-current-input-throw-symbol nil "The current throw symbol for `semantic-exit-on-input'.") +(defvar semantic--on-input-start-marker nil + "The marker when starting a semantic-exit-on-input form.") (defmacro semantic-exit-on-input (symbol &rest forms) "Using SYMBOL as an argument to `throw', execute FORMS. @@ -376,7 +378,8 @@ If FORMS includes a call to `semantic-throw-on-input', then if a user presses any key during execution, this form macro will exit with the value passed to `semantic-throw-on-input'. If FORMS completes, then the return value is the same as `progn'." - `(let ((semantic-current-input-throw-symbol ,symbol)) + `(let ((semantic-current-input-throw-symbol ,symbol) + (semantic--on-input-start-marker (point-marker))) (catch ,symbol ,@forms))) (put 'semantic-exit-on-input 'lisp-indent-function 1) @@ -387,7 +390,16 @@ FROM is an indication of where this function is called from as a value to pass to `throw'. It is recommended to use the name of the function calling this one." `(when (and semantic-current-input-throw-symbol - (or (input-pending-p) (accept-process-output))) + (or (input-pending-p) + (save-excursion + ;; Timers might run during accept-process-output. + ;; If they redisplay, point must be where the user + ;; expects. (Bug#15045) + (set-buffer (marker-buffer + semantic--on-input-start-marker)) + (goto-char (marker-position + semantic--on-input-start-marker)) + (accept-process-output)))) (throw semantic-current-input-throw-symbol ,from)))