APPROVE COMMIT 21.4
Adrian Aichner <Adrian.Aichner(a)t-online.de> writes:
COMMIT
APPROVE 21.5
SUPERSEDES <BCA1A6F5CBABD44388AB9C4C6D0D1366F3FAE1(a)mucexch3.muc.sdm.de>
RECOMMEND 21.4
Klaus, this works fine for me in
(emacs-version)
"XEmacs 21.5 (beta15) \"celery\" [Lucid] (i586-pc-win32, Mule) of Sun
Sep 07 2003 on D5DC120J"
Please include ChangeLog additions (verbatim or context-less diff)
like the one below (but in your own name) in the future to get proper
credit in the ChangeLog.
Thanks for debugging and fixing this problem, Klaus!
Best regards,
Adrian
xemacs-21.5 ChangeLog patch:
Diff command: cvs -q diff -U 0
Files affected: lisp/ChangeLog
Index: lisp/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 1.525
diff -u -U0 -r1.525 ChangeLog
--- lisp/ChangeLog 2003/09/04 00:05:08 1.525
+++ lisp/ChangeLog 2003/09/07 19:37:45
@@ -0,0 +1,6 @@
+2003-09-07 Adrian Aichner <adrian(a)xemacs.org>
+
+ * window-xemacs.el (display-buffer): Fix for `shrink-to-fit' by
+ Klaus Berndl, calling `shrink-window-if-larger-than-buffer' when
+ displaying buffer in question.
+
xemacs-21.5 source patch:
Diff command: cvs -f -z3 -q diff -u -N
Files affected: lisp/window-xemacs.el
Index: lisp/window-xemacs.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/window-xemacs.el,v
retrieving revision 1.18
diff -u -r1.18 window-xemacs.el
--- lisp/window-xemacs.el 2003/07/17 14:41:24 1.18
+++ lisp/window-xemacs.el 2003/09/07 19:31:16
@@ -707,7 +707,7 @@
;; and does `returns' all over the place and there's no sense
;; in trying to rewrite it to be more Lispy.
(catch 'done
- (let (window old-frame target-frame explicit-frame)
+ (let (window old-frame target-frame explicit-frame shrink-it)
(setq old-frame (or (last-nonminibuf-frame) (selected-frame)))
(setq buffer (get-buffer buffer))
(check-argument-type 'bufferp buffer)
@@ -895,9 +895,7 @@
(and (window-leftmost-p window)
(window-rightmost-p window))))
(setq window (split-window window))
- (let (upper
-;; lower
- other)
+ (let (upper other)
(setq window (get-lru-window target-frame))
;; If the LRU window is selected, and big enough,
;; and can be split, split it.
@@ -927,11 +925,9 @@
;; even out their heights.
(if (window-previous-child window)
(setq other (window-previous-child window)
-;; lower window
upper other))
(if (window-next-child window)
(setq other (window-next-child window)
-;; lower other
upper window))
;; Check that OTHER and WINDOW are vertically arrayed.
(if (and other
@@ -944,8 +940,11 @@
2)
(window-height upper))
nil upper))
- (if shrink-to-fit
- (shrink-window-if-larger-than-buffer window)))))
+ ;; Klaus Berndl <klaus.berndl(a)sdm.de>: Only in
+ ;; this situation we shrink-to-fit but we can do
+ ;; this first after we have displayed buffer in
+ ;; window (s.b. (set-window-buffer window buffer))
+ (setq shrink-it shrink-to-fit))))
(setq window (get-lru-window target-frame)))
@@ -957,6 +956,12 @@
(record-buffer (window-buffer window)))))
(set-window-buffer window buffer)
+
+ ;; Now window's previous buffer has been brought to the top
+ ;; of the MRU chain and window displays buffer - now we can
+ ;; shrink-to-fit if necessary
+ (if shrink-it
+ (shrink-window-if-larger-than-buffer window))
(display-buffer-1 window)))))
(or (equal wconfig (current-window-configuration))
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/