all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Martin Fredriksson <martin@crt.se>
Cc: emacs-devel@gnu.org
Subject: Re: window.c: suggested patch window_scroll_pixel_based
Date: Tue, 31 Dec 2002 07:27:10 +0100	[thread overview]
Message-ID: <E490FB63-1C88-11D7-99CD-003065478022@crt.se> (raw)
In-Reply-To: <E18T1om-0008W3-00@fencepost.gnu.org>

On måndag, dec 30, 2002, at 16:27 Europe/Stockholm, Richard Stallman 
wrote:

>     I suggest following patch to window.c (window_scroll_pixel_based), 
> to
>     make 'scroll-down' be able to reach the start of the buffer.  This
>     patch partly backs out of 1.433 (rms, 2002/12/23).  I apologize if 
> I
>     have misunderstood the issue.  I have verified the patch on 
> OpenBSD/X11
>     and OSX/Carbon.
>
> This problem does not happen for me, and your change reintroduces code
> that seems to be entirely wrong as far as I can tell.  Why do you
> think it is right to test `start' here?  It appears to me that BEGV
> is correct.

Line 4151--4152:
   if ((n > 0 && IT_CHARPOS (it) == ZV)
       || (n < 0 && IT_CHARPOS (it) == BEGV))

The comparison with ZV seems to be correct since the function
'move_it_to' (called on line 4144) never sets IT_CHARPOS(it) to ZV
unless ZV is visible in the same window.

For backwards movement, however, the function
'move_it_vertically_backword' (called on line 4142) sets
IT_CHARPOS(it) to BEGV when BEGV is less than a screenfull from
current position (as it should).  The comparison "IT_CHARPOS(it) ==
BEGV" now becomes true, and the move is aborted (with
Fsignal(Qbeginning_of_buffer), even though IT_CHARPOS(it) is not
visible.  Since the window is not set until 'set_marker_restricted',
etc, is called on line 4196--, the result is that the window is not
scrolled as it should be.

I believe that it is correct to test IT_CHARPOS(it) == CHARPOS(start)
instead, since that is true when the scroll should not be done (when the
new start position is the same as the current).  From what I can see and
understand, it is perfectly ok for IT_CHARPOS(it) == BEGV, and scrolling
should still be done.

Note that I've only tested with scroll_preserve_screen_position
non-zero.  I do not know if that complicates things.  I must admit I
have a hard time understanding all the issues involved here.

/m

  reply	other threads:[~2002-12-31  6:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-29  1:59 window.c: suggested patch window_scroll_pixel_based Martin Fredriksson
2002-12-30 15:27 ` Richard Stallman
2002-12-31  6:27   ` Martin Fredriksson [this message]
2003-01-01 16:45   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E490FB63-1C88-11D7-99CD-003065478022@crt.se \
    --to=martin@crt.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.