Merge from emacs-23; up to 2010-06-16T23:27:20Z!jay.p.belanger@gmail.com.
[bpt/emacs.git] / lisp / window.el
index 5cd5fca..37a3863 100644 (file)
@@ -163,8 +163,8 @@ Anything less might crash Emacs.")
 
 (defcustom window-min-height 4
   "The minimum number of lines of any window.
-The value has to accomodate a mode- or header-line if present.  A
-value less than `window-safe-min-height' is ignored.  The value
+The value has to accommodate a mode- or header-line if present.
+value less than `window-safe-min-height' is ignored.  The value
 of this variable is honored when windows are resized or split.
 
 Applications should never rebind this variable.  To resize a
@@ -3380,7 +3380,7 @@ WINDOW must be an iso-combination."
            (balance-windows-2 window horizontal)
          (let ((size (window-new-total window)))
            (while sub
-             (set-window-new-total sub size) 
+             (set-window-new-total sub size)
              (balance-windows-1 sub horizontal)
              (setq sub (window-right sub))))))))
 
@@ -3542,7 +3542,6 @@ specific buffers."
          (window-list-no-nils
           type
           (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))
           (cons 'normal-height (window-normal-size window))
@@ -3554,6 +3553,9 @@ specific buffers."
               (unless (memq (car parameter)
                             window-state-ignored-parameters)
                 (setq list (cons parameter list))))
+            (unless (window-parameter window 'clone-of)
+              ;; Make a clone-of parameter.
+              (setq list (cons (cons 'clone-of window) list)))
             (when list
               (cons 'parameters list)))
           (when buffer
@@ -3694,13 +3696,10 @@ value can be also stored on disk and read back in a new session."
   "Helper function for `window-state-put'."
   (dolist (item window-state-put-list)
     (let ((window (car item))
-         (clone-number (cdr (assq 'clone-number item)))
          (splits (cdr (assq 'splits item)))
          (nest (cdr (assq 'nest item)))
          (parameters (cdr (assq 'parameters item)))
          (state (cdr (assq 'buffer item))))
-      ;; Put in clone-number.
-      (when clone-number (set-window-clone-number window clone-number))
       (when splits (set-window-splits window splits))
       (when nest (set-window-nest window nest))
       ;; Process parameters.
@@ -4100,7 +4099,7 @@ A list whose car is the symbol `function' specifies that the
 function specified in the second element of the list is
 responsible for displaying the buffer.  `display-buffer' calls
 this function with the buffer as first argument and the remaining
-elements of the list as the other arguments.
+elements of the list as the second.
 
 The function should choose or create a window, display the buffer
 in it, and return the window.  It is also responsible for giving
@@ -5040,7 +5039,7 @@ description."
          (setq window
                (cond
                 ((eq cand 'largest)
-                 ;; The largest window. 
+                 ;; The largest window.
                  (get-largest-window frame t))
                 ((eq cand 'lru)
                  ;; The least recently used window.
@@ -5751,7 +5750,7 @@ this list as arguments."
          (display-buffer-reuse-window
           buffer '(nil nil t) '((reuse-window-dedicated . t)))))))
 
-(defsubst display-buffer-same-window (&optional buffer-or-name label) 
+(defsubst display-buffer-same-window (&optional buffer-or-name label)
   "Display buffer specified by BUFFER-OR-NAME in the selected window.
 Another window will be used only if the buffer can't be shown in
 the selected window, usually because it is dedicated to another
@@ -5760,7 +5759,7 @@ buffer.  Optional argument BUFFER-OR-NAME and LABEL are as for
   (interactive "BDisplay buffer in same window:\nP")
   (display-buffer buffer-or-name 'same-window label))
 
-(defsubst display-buffer-same-frame (&optional buffer-or-name label) 
+(defsubst display-buffer-same-frame (&optional buffer-or-name label)
   "Display buffer specified by BUFFER-OR-NAME in a window on the same frame.
 Another frame will be used only if there is no other choice.
 Optional argument BUFFER-OR-NAME and LABEL are as for
@@ -5768,7 +5767,7 @@ Optional argument BUFFER-OR-NAME and LABEL are as for
   (interactive "BDisplay buffer on same frame:\nP")
   (display-buffer buffer-or-name 'same-frame label))
 
-(defsubst display-buffer-other-window (&optional buffer-or-name label) 
+(defsubst display-buffer-other-window (&optional buffer-or-name label)
   "Display buffer specified by BUFFER-OR-NAME in another window.
 The selected window will be used only if there is no other
 choice.  Windows on the selected frame are preferred to windows
@@ -5777,7 +5776,7 @@ for `display-buffer'."
   (interactive "BDisplay buffer in another window:\nP")
   (display-buffer buffer-or-name 'other-window label))
 
-(defun display-buffer-same-frame-other-window (&optional buffer-or-name label) 
+(defun display-buffer-same-frame-other-window (&optional buffer-or-name label)
   "Display buffer specified by BUFFER-OR-NAME in another window on the same frame.
 The selected window or another frame will be used only if there
 is no other choice.  Optional argument BUFFER-OR-NAME and LABEL are
@@ -5854,7 +5853,7 @@ as for `pop-to-buffer'."
   (interactive "BPop to buffer in selected window:\nP")
   (pop-to-buffer buffer-or-name 'same-window norecord label))
 
-(defsubst pop-to-buffer-same-frame (&optional buffer-or-name norecord label) 
+(defsubst pop-to-buffer-same-frame (&optional buffer-or-name norecord label)
   "Pop to buffer specified by BUFFER-OR-NAME in a window on the selected frame.
 Another frame will be used only if there is no other choice.
 Optional arguments BUFFER-OR-NAME, NORECORD and LABEL are as for
@@ -5871,7 +5870,7 @@ LABEL are as for `pop-to-buffer'."
   (interactive "BPop to buffer in another window:\nP")
   (pop-to-buffer buffer-or-name 'other-window norecord))
 
-(defsubst pop-to-buffer-same-frame-other-window (&optional buffer-or-name norecord label) 
+(defsubst pop-to-buffer-same-frame-other-window (&optional buffer-or-name norecord label)
   "Pop to buffer specified by BUFFER-OR-NAME in another window on the selected frame.
 The selected window or another frame will be used only if there
 is no other choice.  Optional arguments BUFFER-OR-NAME, NORECORD
@@ -6109,7 +6108,7 @@ BUFFER in a window on the selected frame.
 
 If ARGS is a list whose car is a symbol, use (car ARGS) as a
 function to do the work.  Pass it BUFFER as first argument,
-and (cdr ARGS) as second."
+and (cdr ARGS) as the rest of the arguments."
   (if (and args (symbolp (car args)))
       (apply (car args) buffer (cdr args))
     (let ((window (get-buffer-window buffer 0)))
@@ -6909,7 +6908,7 @@ WINDOW was scrolled."
   ;; window and the current buffer when we're done.
   (setq window (window-normalize-live-window window))
   ;; Can't resize a full height or fixed-size window.
-  (unless (or (window-size-fixed-p window) 
+  (unless (or (window-size-fixed-p window)
              (window-full-height-p window))
     ;; `with-selected-window' should orderly restore the current buffer.
     (with-selected-window window