unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Romain Francoise <romain@orebokech.com>
Cc: no-spam@cua.dk, emacs-devel@gnu.org
Subject: Re: scroll-conservatively overflow
Date: Sun, 02 May 2004 14:37:53 +0200	[thread overview]
Message-ID: <87n04rgg2m.fsf@orebokech.com> (raw)
In-Reply-To: <E1BJydX-0001LF-V6@fencepost.gnu.org> (Richard Stallman's message of "Sat, 01 May 2004 13:50:51 -0400")

Richard Stallman <rms@gnu.org> writes:

> I made that change to fix a specific bug.  That function was returning
> incorrect results in a certain case.  I don't remember the test case,
> unfortunately.

Kim F. Storm kindly provided me with the original bug report so I've
been able to reproduce it.

> This change also makes the function cleaner because it handles vpos
> like the various other values.

Yes; I wasn't convinced at first that doing this was necessary, but now
that I have looked into it in more detail I agree that it is cleaner
this way.

> Apparently the new code has another bug.  That often happens.  Could
> you figure out precisely what the bug is?  Then we could find the
> right fix.

I have spent some time reading the code and found the problem: you had
overlooked a case where vpos needs to be saved in prev_vpos when dealing
with continuation lines.  Your change did not save the value even though
it had been incremented to take into account the fact that the line is
continued on another line, thus making the next iteration restore vpos
from prev_vpos with a wrong value, which caused all my scrolling
problems in Gnus and Dired.

I suggest the following patch against CVS which merely saves vpos in
prev_vpos in that case, and that fixes the various problems I was
having.  I have also checked that the original bug is still fixed with
that change.  Could you please install it?

Index: src/indent.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/indent.c,v
retrieving revision 1.160
diff -c -r1.160 indent.c
*** src/indent.c	5 Apr 2004 21:41:08 -0000	1.160
--- src/indent.c	2 May 2004 11:54:42 -0000
***************
*** 1407,1412 ****
--- 1407,1413 ----
  	      vpos++;
  	      contin_hpos = prev_hpos;
  	      prev_hpos = 0;
+ 	      prev_vpos = vpos;
  	    }
  	}

Suggested changelog entry:

2004-05-02  Romain Francoise  <romain@orebokech.com>  (tiny change)

	* indent.c (compute_motion): Save vpos in prev_vpos when dealing
	with continuation lines, too.

Thanks,

-- 
Romain Francoise <romain@orebokech.com> | This is a man's man's man's
it's a miracle -- http://orebokech.com/ | world. --James Brown

  reply	other threads:[~2004-05-02 12:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-16 10:00 scroll-conservatively overflow Juanma Barranquero
2004-04-16 13:17 ` Kim F. Storm
2004-04-16 14:03   ` Romain Francoise
2004-04-30 11:35     ` Romain Francoise
2004-04-30 16:38       ` Kim F. Storm
2004-05-01 17:50       ` Richard Stallman
2004-05-02 12:37         ` Romain Francoise [this message]
2004-05-02 16:58           ` Stefan Monnier
2004-05-03 14:03           ` Richard Stallman
2004-04-17 19:42   ` Richard Stallman
2004-04-17 20:52     ` Juanma Barranquero
2004-04-18 21:31       ` Kim F. Storm
2004-04-19 11:37       ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87n04rgg2m.fsf@orebokech.com \
    --to=romain@orebokech.com \
    --cc=emacs-devel@gnu.org \
    --cc=no-spam@cua.dk \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).