[Top][All Lists]

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

bug in window-end

From: Luc Teirlinck
Subject: bug in window-end
Date: Fri, 4 Apr 2003 17:37:36 -0600 (CST)

The following bug in window-end completely explains the problem with
the native scrollbar I pointed out before.

I will just keep using the same example I used before.

C-h n.

Region around:

GNU Emacs NEWS -- history of user-visible changes.  2001-03-15
Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
See the end for copying conditions.

Make sure the final newline is included.

C-x n n

M-: (window-end) will correctly give 174 in all kinds of situations,

move to behind the final newline and do

M-0 C-l

Now M-: (window-end) returns 458732, one more than

M-: (buffer-size), 458731

M-: (window-start) in this situation returns 174, the same thing
window-end should be returning (or so I believe).

Some apparently suspicious code in window-end:

      /* In case W->start is out of the range, use something
         reasonable.  This situation occurred when loading a file with
         `-l' containing a call to `rmail' with subsequent other
         commands.  At the end, W->start happened to be BEG, while
         rmail had already narrowed the buffer.  */
      if (XMARKER (w->start)->charpos < BEGV)
      SET_TEXT_POS (startp, BEGV, BEGV_BYTE);
      else if (XMARKER (w->start)->charpos > ZV)
      SET_TEXT_POS (startp, ZV, ZV_BYTE);
      SET_TEXT_POS_FROM_MARKER (startp, w->start);

I do not feel familiar enough with the Emacs C code to really mess
with this.  I hope the above helps anyway.



reply via email to

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