emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog window.el


From: Martin Rudalics
Subject: [Emacs-diffs] emacs/lisp ChangeLog window.el
Date: Thu, 15 Jan 2009 07:57:02 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Martin Rudalics <m061211>       09/01/15 07:57:02

Modified files:
        lisp           : ChangeLog window.el 

Log message:
        (special-display-p): Revert 2009-01-14 change.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15107&r2=1.15108
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/window.el?cvsroot=emacs&r1=1.177&r2=1.178

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15107
retrieving revision 1.15108
diff -u -b -r1.15107 -r1.15108
--- ChangeLog   15 Jan 2009 03:27:12 -0000      1.15107
+++ ChangeLog   15 Jan 2009 07:56:58 -0000      1.15108
@@ -1,3 +1,7 @@
+2009-01-15  Martin Rudalics  <address@hidden>
+
+       * window.el (special-display-p): Revert 2009-01-14 change.
+
 2009-01-15  Glenn Morris  <address@hidden>
 
        * emacs-lisp/authors.el (authors-aliases, authors-fixed-case):

Index: window.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/window.el,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -b -r1.177 -r1.178
--- window.el   14 Jan 2009 09:56:13 -0000      1.177
+++ window.el   15 Jan 2009 07:57:01 -0000      1.178
@@ -685,11 +685,13 @@
 `special-display-regexps' contain a list entry whose car equals
 or matches BUFFER-NAME, the return value is the cdr of that
 entry."
+  (let (tmp)
   (cond
    ((not (stringp buffer-name)))
-   ((member buffer-name special-display-buffer-names) t)
-   ((let ((temp (assoc buffer-name special-display-buffer-names)))
-      (cdr temp)))
+     ((member buffer-name special-display-buffer-names)
+      t)
+     ((setq tmp (assoc buffer-name special-display-buffer-names))
+      (cdr tmp))
    ((catch 'found
       (dolist (regexp special-display-regexps)
        (cond
@@ -698,7 +700,7 @@
            (throw 'found t)))
         ((and (consp regexp) (stringp (car regexp))
               (string-match-p (car regexp) buffer-name))
-         (throw 'found (cdr regexp)))))))))
+           (throw 'found (cdr regexp))))))))))
 
 (defcustom special-display-function 'special-display-popup-frame
   "Function to call for displaying special buffers.
@@ -955,6 +957,59 @@
          (enlarge-window (/ (- (window-height window) (window-height)) 2))
        (error nil)))))
 
+(defun display-buffer-specially (buffer locus)
+  (cond
+   ((window-minibuffer-p (selected-window))
+    nil)
+   ((eq locus 'this)
+    (condition-case nil
+       (switch-to-buffer buffer)
+      (error nil)))
+   ((memq locus '(below below-split right right-split))
+    (let ((edges (window-edges)))
+      (cond
+       ((and (eq locus 'below)
+            (let* ((other-window (next-window))
+                  (other-edges (window-edges other-window)))
+              (and (= (nth 0 edges) (nth 0 other-edges))
+                   (< (nth 3 edges) (nth 3 other-edges))
+                   other-window))))
+       ((and (eq locus 'right)
+            (let* ((other-window (next-window))
+                  (other-edges (window-edges other-window)))
+              (and (= (nth 1 edges) (nth 1 other-edges))
+                   (< (nth 2 edges) (nth 2 other-edges))
+                   other-window))))
+       ((and (memq locus '(below below-split))
+            (let ((split-height-threshold 0))
+              (and (window--splittable-p (selected-window))
+                   (split-window)))))
+       ((and (memq locus '(right right-split))
+            (let ((split-width-threshold 0))
+              (window--splittable-p (selected-window) t)
+              (split-window nil nil t)))))))
+   ((memq locus '(bottom bottom-split))
+    (let ((edges (window-edges))
+         (other-edges (window-edges (next-window)))
+         (window (selected-window))
+         window-to-display window-to-split)
+      ;; Wrong -- our window must be better than the last we found.
+      (while (or (> (nth 2 other-edges) (nth 2 edges))
+                (> (nth 3 other-edges) (nth 3 edges)))
+       (setq window (next-window window))
+       (when (> (nth 3 other-edges) (nth 3 edges))
+         (setq window-to-display window)
+         (setq window-to-split
+               (and (eq locus 'bottom-split)
+                    (let ((split-height-threshold 0))
+                      (and (window--splittable-p window)
+                           window)))))
+       (setq other-edges (window-edges (next-window window))))
+      (if (eq locus 'bottom)
+         window-to-display
+       (let ((split-height-threshold 0))
+         (split-window window-to-split)))))))
+
 (defun window--display-buffer-1 (window)
   "Raise the frame containing WINDOW.
 Do not raise the selected frame.  Return WINDOW."
@@ -1066,6 +1121,9 @@
             (when pars
               (funcall special-display-function
                        buffer (if (listp pars) pars))))))
+     ((not (memq not-this-window '(nil t)))
+      (window--display-buffer-2
+       buffer (display-buffer-specially buffer not-this-window)))
      ((or use-pop-up-frames (not frame-to-use))
       ;; We want or need a new frame.
       (window--display-buffer-2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]