Here is the patch for window-xemacs.el against XEmacs 21.4.13:
--- window-xemacs.el 2003-12-09 11:05:17.000000000 +0100
+++ window-xemacs.el.patched 2003-12-09 11:03:35.000000000 +0100
@@ -385,7 +385,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)
@@ -622,8 +622,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)))
@@ -636,7 +639,13 @@
(set-window-buffer window buffer)
- (display-buffer-1 window)))))
+ ;; 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))
(push-window-configuration wconfig))
result))
Ciao,
Klaus
-----Original Message-----
From: Vin Shelton [mailto:acs@xemacs.org]
Sent: Saturday, December 06, 2003 2:46 AM
To: Adrian Aichner
Cc: Berndl, Klaus; 'xemacs-beta(a)xemacs.org '
Subject: Re: When display-buffer has been changed to four args?
Adrian Aichner <adrian(a)xemacs.org> writes:
>>>>> "Klaus" == Klaus Berndl <Berndl>
writes:
Klaus> Hi,
Klaus> can anybody tell me, when display-buffer gots its forth
Klaus> argument SHRINK-TO-FIT (same for get-frame-for-buffer)?
Klaus> In 21.4.6 get-frame-for-buffer does not accept these 4
Klaus> arguments - so i assume display-buffer doesn't too. In my
Klaus> 21.4.13 version display-buffer and get-frame-for-buffer
Klaus> accept this SHRINK-TO-FIT argument.
Hi Klaus, I commited your SHRINK-TO-FIT fix to 21.5 and recommended it
for 21.4.
See
http://list-archive.xemacs.org/xemacs-cvs/200309/msg00050.html
The display-buffer SHRINK-TO-FIT argument has been there for a long
time.
cvs annotate will tell you for how long.
Hope this helps,
Adrian
Klaus> So my question: In which version of XEmacs 21.4 this has
Klaus> been changed? Or which version of window-xemacs.el is the
Klaus> last one which contains display-buffer *without* the
Klaus> SHRINK-TO-FIT-argument. Same for frame.el (which contains
Klaus> get-frame-for-buffer)
Klaus,
If there's a bug in shrink-to-fit for the 21.4 implementation of
display-buffer, I would happily accept a patch for 21.4. The patch
you submitted in September, 2003 does not apply cleanly.
Thanks,
Vin