aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-03-15 05:12:14 +0000
committerKarl Heuer1994-03-15 05:12:14 +0000
commit75db9a6429d9a1f17f8ec5321ba80ef3f2366f18 (patch)
tree342326f15300dee3df3e3230c9007d5dca4bb42a
parentb09d7aa2a2dd02af0c106c5b21c8827ab2684cb7 (diff)
downloademacs-75db9a6429d9a1f17f8ec5321ba80ef3f2366f18.tar.gz
emacs-75db9a6429d9a1f17f8ec5321ba80ef3f2366f18.zip
(Man-original-frame): New variable.
(Man-getpage-in-background): Save the frame that man was invoked in. (Man-notify-when-ready): Restore it, if appropriate.
-rw-r--r--lisp/man.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/man.el b/lisp/man.el
index b18612ec8fc..0000a0d9a6e 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -231,6 +231,7 @@ This regular expression should start with a `^' character.")
231(make-variable-buffer-local 'Man-page-list) 231(make-variable-buffer-local 'Man-page-list)
232(make-variable-buffer-local 'Man-current-page) 232(make-variable-buffer-local 'Man-current-page)
233(make-variable-buffer-local 'Man-page-mode-string) 233(make-variable-buffer-local 'Man-page-mode-string)
234(make-variable-buffer-local 'Man-original-frame)
234 235
235(setq-default Man-sections-alist nil) 236(setq-default Man-sections-alist nil)
236(setq-default Man-refpages-alist nil) 237(setq-default Man-refpages-alist nil)
@@ -457,6 +458,9 @@ start a background process even if a buffer already exists and
457 (require 'env) 458 (require 'env)
458 (message "Invoking man %s in background..." man-args) 459 (message "Invoking man %s in background..." man-args)
459 (setq buffer (generate-new-buffer bufname)) 460 (setq buffer (generate-new-buffer bufname))
461 (save-excursion
462 (set-buffer buffer)
463 (setq Man-original-frame (selected-frame)))
460 (let ((process-environment (copy-sequence process-environment))) 464 (let ((process-environment (copy-sequence process-environment)))
461 ;; Prevent any attempt to use display terminal fanciness. 465 ;; Prevent any attempt to use display terminal fanciness.
462 (setenv "TERM" "dumb") 466 (setenv "TERM" "dumb")
@@ -474,11 +478,17 @@ See the variable `Man-notify' for the different notification behaviors."
474 (set-buffer man-buffer) 478 (set-buffer man-buffer)
475 (new-frame Man-frame-parameters)) 479 (new-frame Man-frame-parameters))
476 ((eq Man-notify 'bully) 480 ((eq Man-notify 'bully)
481 (and (frame-live-p Man-original-frame)
482 (select-frame Man-original-frame))
477 (pop-to-buffer man-buffer) 483 (pop-to-buffer man-buffer)
478 (delete-other-windows)) 484 (delete-other-windows))
479 ((eq Man-notify 'aggressive) 485 ((eq Man-notify 'aggressive)
486 (and (frame-live-p Man-original-frame)
487 (select-frame Man-original-frame))
480 (pop-to-buffer man-buffer)) 488 (pop-to-buffer man-buffer))
481 ((eq Man-notify 'friendly) 489 ((eq Man-notify 'friendly)
490 (and (frame-live-p Man-original-frame)
491 (select-frame Man-original-frame))
482 (display-buffer man-buffer 'not-this-window)) 492 (display-buffer man-buffer 'not-this-window))
483 ((eq Man-notify 'polite) 493 ((eq Man-notify 'polite)
484 (beep) 494 (beep)