summaryrefslogtreecommitdiff
path: root/lisp/man.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-05-02 06:01:55 +0000
committerRichard M. Stallman <rms@gnu.org>1994-05-02 06:01:55 +0000
commitc759c250ee5483d5a31af53388b501a4f4d83ee8 (patch)
tree61e2e78b28f2a431352315771f2f16cf6966d232 /lisp/man.el
parent8bf5f54e7cc3df66d01d6d3a7aaa414c20e22a0e (diff)
downloademacs-c759c250ee5483d5a31af53388b501a4f4d83ee8.tar.gz
(Man-notify-when-ready): In newframe case, use save-excursion.
Diffstat (limited to 'lisp/man.el')
-rw-r--r--lisp/man.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/man.el b/lisp/man.el
index 9d5c97bacaf..7fd87f7996d 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -481,8 +481,13 @@ start a background process even if a buffer already exists and
See the variable `Man-notify' for the different notification behaviors."
(cond
((eq Man-notify 'newframe)
- (set-buffer man-buffer)
- (new-frame Man-frame-parameters))
+ ;; Since we run asynchronously, perhaps while Emacs is waiting for input,
+ ;; we must not leave a different buffer current.
+ ;; We can't rely on the editor command loop to reselect
+ ;; the selected window's buffer.
+ (save-excursion
+ (set-buffer man-buffer)
+ (new-frame Man-frame-parameters)))
((eq Man-notify 'bully)
(and (frame-live-p Man-original-frame)
(select-frame Man-original-frame))