diff options
| -rw-r--r-- | lisp/cedet/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/cedet/semantic/fw.el | 16 |
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 @@ | |||
| 1 | 2013-10-28 Barry O'Reilly <gundaetiapo@gmail.com> | ||
| 2 | |||
| 3 | * semantic/fw.el (semantic-exit-on-input) | ||
| 4 | (semantic-throw-on-input): Restore point before | ||
| 5 | accept-process-output because timers which redisplay can run. | ||
| 6 | (Bug#15045) | ||
| 7 | |||
| 1 | 2013-11-03 Johan Bockgård <bojohan@gnu.org> | 8 | 2013-11-03 Johan Bockgård <bojohan@gnu.org> |
| 2 | 9 | ||
| 3 | * semantic/lex.el (semantic-lex-start-block) | 10 | * 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." | |||
| 369 | ;; | 369 | ;; |
| 370 | (defvar semantic-current-input-throw-symbol nil | 370 | (defvar semantic-current-input-throw-symbol nil |
| 371 | "The current throw symbol for `semantic-exit-on-input'.") | 371 | "The current throw symbol for `semantic-exit-on-input'.") |
| 372 | (defvar semantic--on-input-start-marker nil | ||
| 373 | "The marker when starting a semantic-exit-on-input form.") | ||
| 372 | 374 | ||
| 373 | (defmacro semantic-exit-on-input (symbol &rest forms) | 375 | (defmacro semantic-exit-on-input (symbol &rest forms) |
| 374 | "Using SYMBOL as an argument to `throw', execute FORMS. | 376 | "Using SYMBOL as an argument to `throw', execute FORMS. |
| @@ -376,7 +378,8 @@ If FORMS includes a call to `semantic-throw-on-input', then | |||
| 376 | if a user presses any key during execution, this form macro | 378 | if a user presses any key during execution, this form macro |
| 377 | will exit with the value passed to `semantic-throw-on-input'. | 379 | will exit with the value passed to `semantic-throw-on-input'. |
| 378 | If FORMS completes, then the return value is the same as `progn'." | 380 | If FORMS completes, then the return value is the same as `progn'." |
| 379 | `(let ((semantic-current-input-throw-symbol ,symbol)) | 381 | `(let ((semantic-current-input-throw-symbol ,symbol) |
| 382 | (semantic--on-input-start-marker (point-marker))) | ||
| 380 | (catch ,symbol | 383 | (catch ,symbol |
| 381 | ,@forms))) | 384 | ,@forms))) |
| 382 | (put 'semantic-exit-on-input 'lisp-indent-function 1) | 385 | (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 | |||
| 387 | to pass to `throw'. It is recommended to use the name of the function | 390 | to pass to `throw'. It is recommended to use the name of the function |
| 388 | calling this one." | 391 | calling this one." |
| 389 | `(when (and semantic-current-input-throw-symbol | 392 | `(when (and semantic-current-input-throw-symbol |
| 390 | (or (input-pending-p) (accept-process-output))) | 393 | (or (input-pending-p) |
| 394 | (save-excursion | ||
| 395 | ;; Timers might run during accept-process-output. | ||
| 396 | ;; If they redisplay, point must be where the user | ||
| 397 | ;; expects. (Bug#15045) | ||
| 398 | (set-buffer (marker-buffer | ||
| 399 | semantic--on-input-start-marker)) | ||
| 400 | (goto-char (marker-position | ||
| 401 | semantic--on-input-start-marker)) | ||
| 402 | (accept-process-output)))) | ||
| 391 | (throw semantic-current-input-throw-symbol ,from))) | 403 | (throw semantic-current-input-throw-symbol ,from))) |
| 392 | 404 | ||
| 393 | 405 | ||