Aaron Lehmann <aaronl(a)vitelus.com> writes:
Or am I doing something wrong? All I'm going on is that "C-x
-" works in
XEmacs 21.1.10, even with the CVS version of
shrink-window-if-larger-than-buffer, but in XEmacs 21.2 it doesn't work,
even with the old version of the code.
The former patch fixes the bug. It is bogus to check
window-pixel-ediges just after window-left-most-p.
The latter patch is to fix window-pixel-edges. Right now,
left top corner is not (0 0). According to the ChangeLog,
Andy made the change but I don't know why. Andy, could you
review this patch?
2000-07-31 Yoshiki Hayashi <yoshiki(a)xemacs.org>
* window.el (shrink-window-if-larger-than-buffer): Remove
edge checking code.
2000-07-31 Yoshiki Hayashi <yoshiki(a)xemacs.org>
* window.c (Fwindow_pixel_edges): Subtract frame border and
gutter size.
Index: window.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/window.el,v
retrieving revision 1.4.2.3
diff -u -r1.4.2.3 window.el
--- window.el 2000/03/13 07:27:44 1.4.2.3
+++ window.el 2000/07/31 09:43:12
@@ -286,8 +286,7 @@
(if (and (not (eobp))
(eq ?\n (char-after (1- (point-max)))))
1 0)))
- (mini (frame-property (window-frame window) 'minibuffer))
- (edges (window-pixel-edges (selected-window))))
+ (mini (frame-property (window-frame window) 'minibuffer)))
(if (and (< 1 (let ((frame (selected-frame)))
(select-frame (window-frame window))
(unwind-protect
@@ -297,7 +296,6 @@
;; of the frame
(window-leftmost-p window)
(window-rightmost-p window)
- (zerop (nth 0 edges))
;; The whole buffer must be visible.
(pos-visible-in-window-p (point-min) window)
;; The frame must not be minibuffer-only.
Index: window.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/window.c,v
retrieving revision 1.41.2.54
diff -u -r1.41.2.54 window.c
--- window.c 2000/07/22 19:33:30 1.41.2.54
+++ window.c 2000/07/31 09:43:00
@@ -1603,9 +1603,12 @@
(window))
{
struct window *w = decode_window (window);
+ struct frame *f = XFRAME (w->frame);
- int left = w->pixel_left;
- int top = w->pixel_top;
+ int left =
+ w->pixel_left - FRAME_LEFT_BORDER_END (f) - FRAME_LEFT_GUTTER_BOUNDS (f);
+ int top =
+ w->pixel_top - FRAME_TOP_BORDER_END (f) - FRAME_TOP_GUTTER_BOUNDS (f);
return list4 (make_int (left),
make_int (top),
--
Yoshiki Hayashi