From: Martin Rudalics Date: Sat, 18 Jun 2011 14:23:14 +0000 (+0200) Subject: Additional fixes in handling of buffer display specifiers. X-Git-Tag: emacs-pretest-24.0.90~104^2~525 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=be3fb2b8752f83e91624e6427db159846abb998b;p=emacs.git Additional fixes in handling of buffer display specifiers. * window.el (display-buffer-default-specifiers): Remove pop-up-frame. Add pop-up-window-min-height, pop-up-window-min-width, and another reuse-window specifier (Bug#8882). Reported by Dan Nicolaescu . (display-buffer-normalize-specifiers-2): Handle split-height-threshold and split-width-threshold also when pop-up-windows is unset. Add a reuse-window specifier for the case popping up a new window fails. (special-display-popup-frame): Remove double quoting. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c83140774ae..afbca4c3118 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2011-06-18 Martin Rudalics + + * window.el (display-buffer-default-specifiers): Remove + pop-up-frame. Add pop-up-window-min-height, + pop-up-window-min-width, and another reuse-window specifier + (Bug#8882). Reported by Dan Nicolaescu . + (display-buffer-normalize-specifiers-2): Handle + split-height-threshold and split-width-threshold also when + pop-up-windows is unset. Add a reuse-window specifier for the + case popping up a new window fails. + (special-display-popup-frame): Remove double quoting. + 2011-06-17 Stefan Monnier * shell.el (shell-completion-vars): Set pcomplete-termination-string diff --git a/lisp/window.el b/lisp/window.el index a4baf99d956..67a80a6a2ec 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3480,10 +3480,13 @@ specific buffers." (defconst display-buffer-default-specifiers '((reuse-window nil same visible) (pop-up-window (largest . nil) (lru . nil)) - (pop-up-frame) + (pop-up-window-min-height . 40) + (pop-up-window-min-width . 80) + (reuse-window other nil nil) (pop-up-frame-alist (height . 24) (width . 80) (unsplittable . t)) (reuse-window nil other visible) + (reuse-window nil nil t) (reuse-window-even-sizes . t)) "Buffer display default specifiers. The value specified here is used when no other specifiers have @@ -5045,15 +5048,23 @@ options." (min-width (if (numberp split-width-threshold) (/ split-width-threshold 2) 1.0))) - (when pop-up-window - ;; `split-height-threshold' + ;; Create an entry only if a default value was changed. + (when (or pop-up-window + (not (equal split-height-threshold 80)) + (not (equal split-width-threshold 160))) + ;; `reuse-window' (needed as fallback when popping up the new + ;; window fails). (setq specifiers - (cons (cons 'pop-up-window-min-height min-height) + (cons (list 'reuse-window 'other nil nil) specifiers)) ;; `split-width-threshold' (setq specifiers (cons (cons 'pop-up-window-min-width min-width) specifiers)) + ;; `split-height-threshold' + (setq specifiers + (cons (cons 'pop-up-window-min-height min-height) + specifiers)) ;; `pop-up-window' (setq specifiers (cons (list 'pop-up-window @@ -5663,7 +5674,7 @@ and (cdr ARGS) as second." ;; Reuse the current window if the user requested it. (when (cdr (assq 'same-window args)) (display-buffer-reuse-window - buffer '(same nil nil) '((reuse-dedicated . 'weak)))) + buffer '(same nil nil) '((reuse-dedicated . weak)))) ;; Stay on the same frame if requested. (when (or (cdr (assq 'same-frame args)) (cdr (assq 'same-window args)))