emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104761: Use better names for window-


From: martin rudalics
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104761: Use better names for window-next/-prev and window-vchild/-hchild.
Date: Mon, 27 Jun 2011 16:05:55 +0200
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104761
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Mon 2011-06-27 16:05:55 +0200
message:
  Use better names for window-next/-prev and window-vchild/-hchild.
  
  * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
  (Fwindow_hchild): Rename to Fwindow_left_child.
  (Fwindow_next): Rename to Fwindow_next_sibling.
  (Fwindow_prev): Rename to Fwindow_prev_sibling.
  
  * window.el (window-right, window-left, window-child)
  (window-child-count, window-last-child)
  (window-iso-combination-p, walk-window-tree-1)
  (window-atom-check-1, window-tree-1, delete-window)
  (window-state-get-1, display-buffer-even-window-sizes): Adapt to
  new naming conventions - window-vchild, window-hchild,
  window-next and window-prev are now called window-top-child,
  window-left-child, window-next-sibling and window-prev-sibling
  respectively.
modified:
  lisp/ChangeLog
  lisp/window.el
  src/ChangeLog
  src/window.c
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-06-27 08:14:10 +0000
+++ b/lisp/ChangeLog    2011-06-27 14:05:55 +0000
@@ -1,3 +1,15 @@
+2011-06-27  Martin Rudalics  <address@hidden>
+
+       * window.el (window-right, window-left, window-child)
+       (window-child-count, window-last-child)
+       (window-iso-combination-p, walk-window-tree-1)
+       (window-atom-check-1, window-tree-1, delete-window)
+       (window-state-get-1, display-buffer-even-window-sizes): Adapt to
+       new naming conventions - window-vchild, window-hchild,
+       window-next and window-prev are now called window-top-child,
+       window-left-child, window-next-sibling and window-prev-sibling
+       respectively.
+
 2011-06-27  Vincent Belaïche  <address@hidden>
 
        * ses.el (ses-destroy-cell-variable-range): Fix heading comment

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2011-06-26 16:17:30 +0000
+++ b/lisp/window.el    2011-06-27 14:05:55 +0000
@@ -63,25 +63,26 @@
         (when (window-live-p save-selected-window-window)
           (select-window save-selected-window-window 'norecord))))))
 
-;; The following two functions are like `window-next' and `window-prev'
-;; but the WINDOW argument is _not_ optional (so they don't substitute
-;; the selected window for nil), and they return nil when WINDOW doesn't
-;; have a parent (like a frame's root window or a minibuffer window).
+;; The following two functions are like `window-next-sibling' and
+;; `window-prev-sibling' but the WINDOW argument is _not_ optional (so
+;; they don't substitute the selected window for nil), and they return
+;; nil when WINDOW doesn't have a parent (like a frame's root window or
+;; a minibuffer window).
 (defsubst window-right (window)
   "Return WINDOW's right sibling.
 Return nil if WINDOW is the root window of its frame.  WINDOW can
 be any window."
-  (and window (window-parent window) (window-next window)))
+  (and window (window-parent window) (window-next-sibling window)))
 
 (defsubst window-left (window)
   "Return WINDOW's left sibling.
 Return nil if WINDOW is the root window of its frame.  WINDOW can
 be any window."
-  (and window (window-parent window) (window-prev window)))
+  (and window (window-parent window) (window-prev-sibling window)))
 
 (defsubst window-child (window)
   "Return WINDOW's first child window."
-  (or (window-vchild window) (window-hchild window)))
+  (or (window-top-child window) (window-left-child window)))
 
 (defun window-child-count (window)
   "Return number of WINDOW's child windows."
@@ -89,14 +90,14 @@
     (when (and (windowp window) (setq window (window-child window)))
       (while window
        (setq count (1+ count))
-       (setq window (window-next window))))
+       (setq window (window-next-sibling window))))
     count))
 
 (defun window-last-child (window)
   "Return last child window of WINDOW."
   (when (and (windowp window) (setq window (window-child window)))
-    (while (window-next window)
-      (setq window (window-next window))))
+    (while (window-next-sibling window)
+      (setq window (window-next-sibling window))))
   window)
 
 (defsubst window-any-p (object)
@@ -203,8 +204,8 @@
 child if WINDOW is a horizontal combination."
   (setq window (normalize-any-window window))
   (if horizontal
-      (window-hchild window)
-    (window-vchild window)))
+      (window-left-child window)
+    (window-top-child window)))
 
 (defsubst window-iso-combined-p (&optional window horizontal)
   "Return non-nil if and only if WINDOW is vertically combined.
@@ -258,9 +259,9 @@
        (funcall proc walk-window-tree-window))
       (unless walk-window-tree-buffer
        (walk-window-tree-1
-        proc (window-hchild walk-window-tree-window) any)
+        proc (window-left-child walk-window-tree-window) any)
        (walk-window-tree-1
-        proc (window-vchild walk-window-tree-window) any))
+        proc (window-top-child walk-window-tree-window) any))
       (if sub-only
          (setq walk-window-tree-window nil)
        (setq walk-window-tree-window
@@ -375,8 +376,8 @@
             window t)))
       ;; Check children.
       (unless (window-buffer window)
-       (window-atom-check-1 (window-hchild window))
-       (window-atom-check-1 (window-vchild window))))
+       (window-atom-check-1 (window-left-child window))
+       (window-atom-check-1 (window-top-child window))))
     ;; Check right sibling
     (window-atom-check-1 (window-right window))))
 
@@ -2119,15 +2120,15 @@
       (setq list
            (cons
             (cond
-             ((window-vchild window)
+             ((window-top-child window)
               (cons t (cons (window-edges window)
-                            (window-tree-1 (window-vchild window) t))))
-             ((window-hchild window)
+                            (window-tree-1 (window-top-child window) t))))
+             ((window-left-child window)
               (cons nil (cons (window-edges window)
-                              (window-tree-1 (window-hchild window) t))))
+                              (window-tree-1 (window-left-child window) t))))
              (t window))
             list))
-      (setq window (when next (window-next window))))
+      (setq window (when next (window-next-sibling window))))
     (nreverse list)))
 
 (defun window-tree (&optional frame)
@@ -2363,7 +2364,7 @@
        ((not parent)
        (error "Attempt to delete minibuffer or sole ordinary window")))
 
-      (let* ((horizontal (window-hchild parent))
+      (let* ((horizontal (window-left-child parent))
             (size (window-total-size window horizontal))
             (frame-selected
              (window-or-subwindow-p (frame-selected-window frame) window))
@@ -3524,15 +3525,15 @@
   "Helper function for `window-state-get'."
   (let* ((type
          (cond
-          ((window-vchild window) 'vc)
-          ((window-hchild window) 'hc)
+          ((window-top-child window) 'vc)
+          ((window-left-child window) 'hc)
           (t 'leaf)))
         (buffer (window-buffer window))
         (selected (eq window (selected-window)))
         (head
          (window-list-no-nils
           type
-          (unless (window-next window) (cons 'last t))
+          (unless (window-next-sibling window) (cons 'last t))
           (cons 'clone-number (window-clone-number window))
           (cons 'total-height (window-total-size window))
           (cons 'total-width (window-total-size window t))
@@ -4666,8 +4667,8 @@
        ;; Don't resize minibuffer windows.
        (window-minibuffer-p)
        ;; WINDOW must be adjacent to the selected one.
-       (not (or (eq window (window-prev))
-                (eq window (window-next))))))
+       (not (or (eq window (window-prev-sibling))
+                (eq window (window-next-sibling))))))
    ((and (window-iso-combined-p window)
         ;; Resize iff the selected window is higher than WINDOW.
         (> (window-total-height) (window-total-height window)))

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-06-27 09:27:44 +0000
+++ b/src/ChangeLog     2011-06-27 14:05:55 +0000
@@ -5,6 +5,11 @@
        matches the window's clone number process the overlay even if
        the overlay's window property doesn't match the current window.
 
+       * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
+       (Fwindow_hchild): Rename to Fwindow_left_child.
+       (Fwindow_next): Rename to Fwindow_next_sibling.
+       (Fwindow_prev): Rename to Fwindow_prev_sibling.
+
 2011-06-26  Jan Djärv  <address@hidden>
 
        * emacsgtkfixed.h: State that this is only used with Gtk+3.

=== modified file 'src/window.c'
--- a/src/window.c      2011-06-24 21:25:22 +0000
+++ b/src/window.c      2011-06-27 14:05:55 +0000
@@ -434,37 +434,37 @@
   return decode_any_window (window)->parent;
 }
 
-DEFUN ("window-vchild", Fwindow_vchild, Swindow_vchild, 0, 1, 0,
-       doc: /* Return WINDOW's first vertical child window.
+DEFUN ("window-top-child", Fwindow_top_child, Swindow_top_child, 0, 1, 0,
+       doc: /* Return WINDOW's topmost child window.
 WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW has no vertical child.  */)
+Return nil if WINDOW is not a vertical combination.  */)
   (Lisp_Object window)
 {
   return decode_any_window (window)->vchild;
 }
 
-DEFUN ("window-hchild", Fwindow_hchild, Swindow_hchild, 0, 1, 0,
-       doc: /* Return WINDOW's first horizontal child window.
+DEFUN ("window-left-child", Fwindow_left_child, Swindow_left_child, 0, 1, 0,
+       doc: /* Return WINDOW's leftmost child window.
 WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW has no horizontal child.  */)
+Return nil if WINDOW is not a horizontal combination.  */)
   (Lisp_Object window)
 {
   return decode_any_window (window)->hchild;
 }
 
-DEFUN ("window-next", Fwindow_next, Swindow_next, 0, 1, 0,
-       doc: /* Return WINDOW's right sibling window.
+DEFUN ("window-next-sibling", Fwindow_next_sibling, Swindow_next_sibling, 0, 
1, 0,
+       doc: /* Return WINDOW's next sibling window.
 WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW has no right sibling.  */)
+Return nil if WINDOW has no next sibling.  */)
   (Lisp_Object window)
 {
   return decode_any_window (window)->next;
 }
 
-DEFUN ("window-prev", Fwindow_prev, Swindow_prev, 0, 1, 0,
-       doc: /* Return WINDOW's left sibling window.
+DEFUN ("window-prev-sibling", Fwindow_prev_sibling, Swindow_prev_sibling, 0, 
1, 0,
+       doc: /* Return WINDOW's previous sibling window.
 WINDOW can be any window and defaults to the selected one.
-Return nil if WINDOW has no left sibling.  */)
+Return nil if WINDOW has no previous sibling.  */)
   (Lisp_Object window)
 {
   return decode_any_window (window)->prev;
@@ -6598,10 +6598,10 @@
   defsubr (&Swindow_clone_number);
   defsubr (&Swindow_buffer);
   defsubr (&Swindow_parent);
-  defsubr (&Swindow_vchild);
-  defsubr (&Swindow_hchild);
-  defsubr (&Swindow_next);
-  defsubr (&Swindow_prev);
+  defsubr (&Swindow_top_child);
+  defsubr (&Swindow_left_child);
+  defsubr (&Swindow_next_sibling);
+  defsubr (&Swindow_prev_sibling);
   defsubr (&Swindow_splits);
   defsubr (&Sset_window_splits);
   defsubr (&Swindow_nest);


reply via email to

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