aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/window.el86
2 files changed, 76 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fb2dd09cb7d..c4141905890 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12009-01-15 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (special-display-p): Revert 2009-01-14 change.
4
12009-01-15 Glenn Morris <rgm@gnu.org> 52009-01-15 Glenn Morris <rgm@gnu.org>
2 6
3 * emacs-lisp/authors.el (authors-aliases, authors-fixed-case): 7 * emacs-lisp/authors.el (authors-aliases, authors-fixed-case):
diff --git a/lisp/window.el b/lisp/window.el
index 3b894a0b823..a5fdb2618f5 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -685,20 +685,22 @@ matching BUFFER-NAME. If `special-display-buffer-names' or
685`special-display-regexps' contain a list entry whose car equals 685`special-display-regexps' contain a list entry whose car equals
686or matches BUFFER-NAME, the return value is the cdr of that 686or matches BUFFER-NAME, the return value is the cdr of that
687entry." 687entry."
688 (cond 688 (let (tmp)
689 ((not (stringp buffer-name))) 689 (cond
690 ((member buffer-name special-display-buffer-names) t) 690 ((not (stringp buffer-name)))
691 ((let ((temp (assoc buffer-name special-display-buffer-names))) 691 ((member buffer-name special-display-buffer-names)
692 (cdr temp))) 692 t)
693 ((catch 'found 693 ((setq tmp (assoc buffer-name special-display-buffer-names))
694 (dolist (regexp special-display-regexps) 694 (cdr tmp))
695 (cond 695 ((catch 'found
696 ((stringp regexp) 696 (dolist (regexp special-display-regexps)
697 (when (string-match-p regexp buffer-name) 697 (cond
698 (throw 'found t))) 698 ((stringp regexp)
699 ((and (consp regexp) (stringp (car regexp)) 699 (when (string-match-p regexp buffer-name)
700 (string-match-p (car regexp) buffer-name)) 700 (throw 'found t)))
701 (throw 'found (cdr regexp))))))))) 701 ((and (consp regexp) (stringp (car regexp))
702 (string-match-p (car regexp) buffer-name))
703 (throw 'found (cdr regexp))))))))))
702 704
703(defcustom special-display-function 'special-display-popup-frame 705(defcustom special-display-function 'special-display-popup-frame
704 "Function to call for displaying special buffers. 706 "Function to call for displaying special buffers.
@@ -955,6 +957,59 @@ is higher than WINDOW."
955 (enlarge-window (/ (- (window-height window) (window-height)) 2)) 957 (enlarge-window (/ (- (window-height window) (window-height)) 2))
956 (error nil))))) 958 (error nil)))))
957 959
960(defun display-buffer-specially (buffer locus)
961 (cond
962 ((window-minibuffer-p (selected-window))
963 nil)
964 ((eq locus 'this)
965 (condition-case nil
966 (switch-to-buffer buffer)
967 (error nil)))
968 ((memq locus '(below below-split right right-split))
969 (let ((edges (window-edges)))
970 (cond
971 ((and (eq locus 'below)
972 (let* ((other-window (next-window))
973 (other-edges (window-edges other-window)))
974 (and (= (nth 0 edges) (nth 0 other-edges))
975 (< (nth 3 edges) (nth 3 other-edges))
976 other-window))))
977 ((and (eq locus 'right)
978 (let* ((other-window (next-window))
979 (other-edges (window-edges other-window)))
980 (and (= (nth 1 edges) (nth 1 other-edges))
981 (< (nth 2 edges) (nth 2 other-edges))
982 other-window))))
983 ((and (memq locus '(below below-split))
984 (let ((split-height-threshold 0))
985 (and (window--splittable-p (selected-window))
986 (split-window)))))
987 ((and (memq locus '(right right-split))
988 (let ((split-width-threshold 0))
989 (window--splittable-p (selected-window) t)
990 (split-window nil nil t)))))))
991 ((memq locus '(bottom bottom-split))
992 (let ((edges (window-edges))
993 (other-edges (window-edges (next-window)))
994 (window (selected-window))
995 window-to-display window-to-split)
996 ;; Wrong -- our window must be better than the last we found.
997 (while (or (> (nth 2 other-edges) (nth 2 edges))
998 (> (nth 3 other-edges) (nth 3 edges)))
999 (setq window (next-window window))
1000 (when (> (nth 3 other-edges) (nth 3 edges))
1001 (setq window-to-display window)
1002 (setq window-to-split
1003 (and (eq locus 'bottom-split)
1004 (let ((split-height-threshold 0))
1005 (and (window--splittable-p window)
1006 window)))))
1007 (setq other-edges (window-edges (next-window window))))
1008 (if (eq locus 'bottom)
1009 window-to-display
1010 (let ((split-height-threshold 0))
1011 (split-window window-to-split)))))))
1012
958(defun window--display-buffer-1 (window) 1013(defun window--display-buffer-1 (window)
959 "Raise the frame containing WINDOW. 1014 "Raise the frame containing WINDOW.
960Do not raise the selected frame. Return WINDOW." 1015Do not raise the selected frame. Return WINDOW."
@@ -1066,6 +1121,9 @@ consider all visible or iconified frames."
1066 (when pars 1121 (when pars
1067 (funcall special-display-function 1122 (funcall special-display-function
1068 buffer (if (listp pars) pars)))))) 1123 buffer (if (listp pars) pars))))))
1124 ((not (memq not-this-window '(nil t)))
1125 (window--display-buffer-2
1126 buffer (display-buffer-specially buffer not-this-window)))
1069 ((or use-pop-up-frames (not frame-to-use)) 1127 ((or use-pop-up-frames (not frame-to-use))
1070 ;; We want or need a new frame. 1128 ;; We want or need a new frame.
1071 (window--display-buffer-2 1129 (window--display-buffer-2