aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2011-06-16 09:31:51 +0200
committerMartin Rudalics2011-06-16 09:31:51 +0200
commit9b9c9e3acbd2285e87e0233d4cfc83c65f2235d1 (patch)
treee6688522627ff2c74303a043c593a75c47fb6f66
parent2b8c5660b71d1111d65eaa4af3ade8528bc35ead (diff)
downloademacs-9b9c9e3acbd2285e87e0233d4cfc83c65f2235d1.tar.gz
emacs-9b9c9e3acbd2285e87e0233d4cfc83c65f2235d1.zip
Improve cohabitation of pop-up-frames and second argument of display-buffer (bug#8865).
* window.el (display-buffer-normalize-specifiers-1): Respect current value of pop-up-frames for most reasonable values of second argument of display-buffer (Bug#8865).
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/window.el34
2 files changed, 22 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d2d44793366..b4b726c7407 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12011-06-16 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (display-buffer-normalize-specifiers-1): Respect
4 current value of pop-up-frames for most reasonable values of
5 second argument of display-buffer (Bug#8865).
6
12011-06-15 Stefan Monnier <monnier@iro.umontreal.ca> 72011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * pcmpl-rpm.el (pcomplete/rpm): Minor simplification. 9 * pcmpl-rpm.el (pcomplete/rpm): Minor simplification.
diff --git a/lisp/window.el b/lisp/window.el
index 5493893d4c1..1661fedfe25 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3453,9 +3453,8 @@ specific buffers."
3453 ;; (bw-finetune wins) 3453 ;; (bw-finetune wins)
3454 ;; (message "Done in %d rounds" round) 3454 ;; (message "Done in %d rounds" round)
3455 )) 3455 ))
3456
3457
3458 3456
3457;;; Displaying buffers.
3459(defconst display-buffer-default-specifiers 3458(defconst display-buffer-default-specifiers
3460 '((reuse-window nil same visible) 3459 '((reuse-window nil same visible)
3461 (pop-up-window (largest . nil) (lru . nil)) 3460 (pop-up-window (largest . nil) (lru . nil))
@@ -4909,9 +4908,12 @@ BUFFER-OR-NAME and return that buffer."
4909(defun display-buffer-normalize-specifiers-1 (specifiers) 4908(defun display-buffer-normalize-specifiers-1 (specifiers)
4910 "Subroutine of `display-buffer-normalize-specifiers'. 4909 "Subroutine of `display-buffer-normalize-specifiers'.
4911SPECIFIERS is the SPECIFIERS argument of `display-buffer'." 4910SPECIFIERS is the SPECIFIERS argument of `display-buffer'."
4912 (let (normalized) 4911 (let (normalized entry)
4913 (cond 4912 (cond
4913 ((not specifiers)
4914 nil)
4914 ((listp specifiers) 4915 ((listp specifiers)
4916 ;; If SPECIFIERS is a list, we assume it is a list of specifiers.
4915 (dolist (specifier specifiers) 4917 (dolist (specifier specifiers)
4916 (cond 4918 (cond
4917 ((consp specifier) 4919 ((consp specifier)
@@ -4924,21 +4926,17 @@ SPECIFIERS is the SPECIFIERS argument of `display-buffer'."
4924 (dolist (item (cdr entry)) 4926 (dolist (item (cdr entry))
4925 (setq normalized (cons item normalized))))))) 4927 (setq normalized (cons item normalized)))))))
4926 ;; Reverse list. 4928 ;; Reverse list.
4927 (setq normalized (nreverse normalized))) 4929 (nreverse normalized))
4928 ;; The two cases below must come from the SPECIFIERS argument of 4930 ((and (not (eq specifiers 'other-window))
4929 ;; `display-buffer'. 4931 (setq entry (assq specifiers display-buffer-macro-specifiers)))
4930 ((eq specifiers 't) 4932 ;; A macro specifier.
4931 ;; Historically t means "other window". Eventually we should get 4933 (cdr entry))
4932 ;; rid of this. 4934 ((memq pop-up-frames '(nil unset))
4933 (setq normalized 4935 ;; Pop up a new window.
4934 (cdr (assq 'other-window display-buffer-macro-specifiers)) 4936 (cdr (assq 'other-window display-buffer-macro-specifiers)))
4935 normalized)) 4937 (t
4936 ((symbolp specifiers) 4938 ;; Pop up a new frame.
4937 ;; We allow scalar specifiers in calls of `display-buffer'. 4939 (cdr (assq 'other-frame display-buffer-macro-specifiers))))))
4938 (let ((entry (assq specifiers display-buffer-macro-specifiers)))
4939 (when entry (setq normalized (cdr entry))))))
4940
4941 normalized))
4942 4940
4943(defun display-buffer-normalize-specifiers-2 (&optional buffer-or-name) 4941(defun display-buffer-normalize-specifiers-2 (&optional buffer-or-name)
4944 "Subroutine of `display-buffer-normalize-specifiers'. 4942 "Subroutine of `display-buffer-normalize-specifiers'.