1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-07 13:15:05 +00:00

(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.
This commit is contained in:
Karl Heuer 1994-03-15 05:12:14 +00:00
parent b09d7aa2a2
commit 75db9a6429

View File

@ -231,6 +231,7 @@ This regular expression should start with a `^' character.")
(make-variable-buffer-local 'Man-page-list) (make-variable-buffer-local 'Man-page-list)
(make-variable-buffer-local 'Man-current-page) (make-variable-buffer-local 'Man-current-page)
(make-variable-buffer-local 'Man-page-mode-string) (make-variable-buffer-local 'Man-page-mode-string)
(make-variable-buffer-local 'Man-original-frame)
(setq-default Man-sections-alist nil) (setq-default Man-sections-alist nil)
(setq-default Man-refpages-alist nil) (setq-default Man-refpages-alist nil)
@ -457,6 +458,9 @@ start a background process even if a buffer already exists and
(require 'env) (require 'env)
(message "Invoking man %s in background..." man-args) (message "Invoking man %s in background..." man-args)
(setq buffer (generate-new-buffer bufname)) (setq buffer (generate-new-buffer bufname))
(save-excursion
(set-buffer buffer)
(setq Man-original-frame (selected-frame)))
(let ((process-environment (copy-sequence process-environment))) (let ((process-environment (copy-sequence process-environment)))
;; Prevent any attempt to use display terminal fanciness. ;; Prevent any attempt to use display terminal fanciness.
(setenv "TERM" "dumb") (setenv "TERM" "dumb")
@ -474,11 +478,17 @@ See the variable `Man-notify' for the different notification behaviors."
(set-buffer man-buffer) (set-buffer man-buffer)
(new-frame Man-frame-parameters)) (new-frame Man-frame-parameters))
((eq Man-notify 'bully) ((eq Man-notify 'bully)
(and (frame-live-p Man-original-frame)
(select-frame Man-original-frame))
(pop-to-buffer man-buffer) (pop-to-buffer man-buffer)
(delete-other-windows)) (delete-other-windows))
((eq Man-notify 'aggressive) ((eq Man-notify 'aggressive)
(and (frame-live-p Man-original-frame)
(select-frame Man-original-frame))
(pop-to-buffer man-buffer)) (pop-to-buffer man-buffer))
((eq Man-notify 'friendly) ((eq Man-notify 'friendly)
(and (frame-live-p Man-original-frame)
(select-frame Man-original-frame))
(display-buffer man-buffer 'not-this-window)) (display-buffer man-buffer 'not-this-window))
((eq Man-notify 'polite) ((eq Man-notify 'polite)
(beep) (beep)