From d5f98c51df0e3aac25ad8ec0458305523aa16ad3 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Thu, 9 Oct 2008 08:12:41 +0000 Subject: [PATCH] (pop-up-frames): Add choice graphic-only. (display-buffer): When pop-up-frames equals graphic-only do not pop up new frame on text-only terminals. (Bug#1061) --- lisp/ChangeLog | 6 ++++++ lisp/window.el | 24 +++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 102713618ec..cf7567fb46f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-10-09 Martin Rudalics + + * window.el (pop-up-frames): Add choice graphic-only. + (display-buffer): When pop-up-frames equals graphic-only do + not pop up new frame on text-only terminals. (Bug#1061) + 2008-10-09 Dan Nicolaescu * vc-cvs.el (vc-cvs-dir-stay-local): New variable. diff --git a/lisp/window.el b/lisp/window.el index 5afe1811dda..e69634de68c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -710,8 +710,15 @@ See also `same-window-buffer-names'." :group 'windows) (defcustom pop-up-frames nil - "Non-nil means `display-buffer' should make a separate frame." - :type 'boolean + "Whether `display-buffer' should make a separate frame. +If nil, never make a seperate frame. +If the value is `graphic-only', make a separate frame +on graphic displays only. +Any other non-nil value means always make a separate frame." + :type '(choice + (const :tag "Never" nil) + (const :tag "On graphic displays only" graphic-only) + (const :tag "Always" t)) :group 'windows) (defcustom display-buffer-reuse-frames nil @@ -931,7 +938,8 @@ A specific frame - consider windows on that frame only. nil - consider windows on the selected frame \(actually the last non-minibuffer frame\) only. If, however, either -`display-buffer-reuse-frames' or `pop-up-frames' is non-nil, +`display-buffer-reuse-frames' or `pop-up-frames' is non-nil +\(non-nil and not graphic-only on a text-only terminal), consider all visible or iconified frames." (interactive "BDisplay buffer:\nP") (let* ((can-use-selected-window @@ -945,6 +953,11 @@ consider all visible or iconified frames." buffer-or-name (get-buffer buffer-or-name))) (name-of-buffer (buffer-name buffer)) + ;; On text-only terminals do not pop up a new frame when + ;; `pop-up-frames' equals graphic-only. + (use-pop-up-frames (if (eq pop-up-frames 'graphic-only) + (display-graphic-p) + pop-up-frames)) ;; `frame-to-use' is the frame where to show `buffer' - either ;; the selected frame or the last nonminibuffer frame. (frame-to-use @@ -967,7 +980,8 @@ consider all visible or iconified frames." ;; If the buffer's name tells us to use the selected window do so. (window--display-buffer-2 buffer (selected-window))) ((let ((frames (or frame - (and (or pop-up-frames display-buffer-reuse-frames + (and (or use-pop-up-frames + display-buffer-reuse-frames (not (last-nonminibuffer-frame))) 0) (last-nonminibuffer-frame)))) @@ -983,7 +997,7 @@ consider all visible or iconified frames." (when pars (funcall special-display-function buffer (if (listp pars) pars)))))) - ((or pop-up-frames (not frame-to-use)) + ((or use-pop-up-frames (not frame-to-use)) ;; We want or need a new frame. (window--display-buffer-2 buffer (frame-selected-window (funcall pop-up-frame-function)))) -- 2.39.5