summaryrefslogtreecommitdiff
path: root/lisp/cedet
diff options
context:
space:
mode:
authorBarry O'Reilly <gundaetiapo@gmail.com>2013-11-16 15:27:24 -0500
committerBarry O'Reilly <gundaetiapo@gmail.com>2013-11-16 15:27:24 -0500
commit2bde2cf14383ab0cddca30f64180a2f7ecde7668 (patch)
tree6b65f05e339b0ee5287e3fc6f0507240273137f0 /lisp/cedet
parent0010ca514defbd9fde4139fd78513cdf4f303645 (diff)
downloademacs-2bde2cf14383ab0cddca30f64180a2f7ecde7668.tar.gz
* 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)
Diffstat (limited to 'lisp/cedet')
-rw-r--r--lisp/cedet/ChangeLog7
-rw-r--r--lisp/cedet/semantic/fw.el16
2 files changed, 21 insertions, 2 deletions
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 <gundaetiapo@gmail.com>
+
+ * 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 <bojohan@gnu.org>
* 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)))