GNU bug report logs - #10105
24.0.91; Possible bug in `scroll-conservatively'

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Tue, 22 Nov 2011 09:54:01 UTC

Severity: normal

Found in version 24.0.91

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10105 in the body.
You can then email your comments to 10105 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Tue, 22 Nov 2011 09:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dani Moncayo <dmoncayo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 22 Nov 2011 09:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.91; Possible bug in `scroll-conservatively'
Date: Tue, 22 Nov 2011 10:51:43 +0100
[Message part 1 (text/plain, inline)]
Recipe from "emacs -Q":
1. Eval: "(setq scroll-conservatively 101)".
2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
3. Visit the attached file and from its first line type "C-s h e l l o".

--> The Isearch match should be positioned at the bottom line of the
window (see step #1), but it is at the top line instead.


In GNU Emacs 24.0.91.1 (i386-mingw-nt5.1.2600)
 of 2011-11-22 on MARVIN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.6) --no-opt --cflags
-ID:/devel/emacs/libs/libXpm-3.5.8/include
-ID:/devel/emacs/libs/libXpm-3.5.8/src
-ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
-ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
-ID:/devel/emacs/libs/giflib-4.1.4-1/include
-ID:/devel/emacs/libs/jpeg-6b-4/include
-ID:/devel/emacs/libs/tiff-3.8.2-1/include
-ID:/devel/emacs/libs/gnutls-2.10.1/include --ldflags
-LD:/devel/emacs/libs/gnutls-2.10.1/lib'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ESN
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

-- 
Dani Moncayo
[test.txt (text/plain, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 25 Nov 2011 11:36:02 GMT) Full text and rfc822 format available.

Notification sent to Dani Moncayo <dmoncayo <at> gmail.com>:
bug acknowledged by developer. (Fri, 25 Nov 2011 11:36:03 GMT) Full text and rfc822 format available.

Message #10 received at 10105-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 10105-done <at> debbugs.gnu.org
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Fri, 25 Nov 2011 13:33:56 +0200
> Date: Tue, 22 Nov 2011 10:51:43 +0100
> From: Dani Moncayo <dmoncayo <at> gmail.com>
> 
> Recipe from "emacs -Q":
> 1. Eval: "(setq scroll-conservatively 101)".
> 2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
> 3. Visit the attached file and from its first line type "C-s h e l l o".
> 
> --> The Isearch match should be positioned at the bottom line of the
> window (see step #1), but it is at the top line instead.

Fixed in revision 106511 on the trunk.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Fri, 25 Nov 2011 15:46:02 GMT) Full text and rfc822 format available.

Message #13 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 10105 <at> debbugs.gnu.org
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Fri, 25 Nov 2011 17:43:59 +0200
> Date: Fri, 25 Nov 2011 13:33:56 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 10105-done <at> debbugs.gnu.org
> 
> > Date: Tue, 22 Nov 2011 10:51:43 +0100
> > From: Dani Moncayo <dmoncayo <at> gmail.com>
> > 
> > Recipe from "emacs -Q":
> > 1. Eval: "(setq scroll-conservatively 101)".
> > 2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
> > 3. Visit the attached file and from its first line type "C-s h e l l o".
> > 
> > --> The Isearch match should be positioned at the bottom line of the
> > window (see step #1), but it is at the top line instead.
> 
> Fixed in revision 106511 on the trunk.

Err.. make that 106515; 106511 had a thinko that I fixed in the
followup.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Fri, 25 Nov 2011 16:41:01 GMT) Full text and rfc822 format available.

Message #16 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 10105 <at> debbugs.gnu.org
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Fri, 25 Nov 2011 17:38:58 +0100
>> > Recipe from "emacs -Q":
>> > 1. Eval: "(setq scroll-conservatively 101)".
>> > 2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
>> > 3. Visit the attached file and from its first line type "C-s h e l l o".
>> >
>> > --> The Isearch match should be positioned at the bottom line of the
>> > window (see step #1), but it is at the top line instead.
>>
>> Fixed in revision 106511 on the trunk.
>
> Err.. make that 106515; 106511 had a thinko that I fixed in the
> followup.

Tested.  Thank you.


-- 
Dani Moncayo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Mon, 28 Nov 2011 10:41:01 GMT) Full text and rfc822 format available.

Message #19 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 10105 <at> debbugs.gnu.org
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Mon, 28 Nov 2011 11:38:05 +0100
[Message part 1 (text/plain, inline)]
>> > Recipe from "emacs -Q":
>> > 1. Eval: "(setq scroll-conservatively 101)".
>> > 2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
>> > 3. Visit the attached file and from its first line type "C-s h e l l o".
>> >
>> > --> The Isearch match should be positioned at the bottom line of the
>> > window (see step #1), but it is at the top line instead.
>>
>> Fixed in revision 106511 on the trunk.
>
> Err.. make that 106515; 106511 had a thinko that I fixed in the
> followup.

I've just seen another behavior that seem to be still wrong.  Please
try this from "emacs -Q":

1. Eval: "(setq scroll-conservatively 101)".
2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
3. Visit the attached file.
4. Type "C-s p C-s C-s C-s".
--> At this point, the Isearch has moved point to line "p1", but it's
positioned at the top of the window.  It should be at the bottom.


In GNU Emacs 24.0.91.1 (i386-mingw-nt5.1.2600)
 of 2011-11-25 on DANI-PC
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.6) --cflags -fno-omit-frame-pointer'


-- 
Dani Moncayo
[test-2.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Mon, 28 Nov 2011 12:04:02 GMT) Full text and rfc822 format available.

Message #22 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 10105 <at> debbugs.gnu.org
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Mon, 28 Nov 2011 07:01:17 -0500
> Date: Mon, 28 Nov 2011 11:38:05 +0100
> From: Dani Moncayo <dmoncayo <at> gmail.com>
> Cc: 10105 <at> debbugs.gnu.org
> 
> 1. Eval: "(setq scroll-conservatively 101)".
> 2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
> 3. Visit the attached file.
> 4. Type "C-s p C-s C-s C-s".
> --> At this point, the Isearch has moved point to line "p1", but it's
> positioned at the top of the window.  It should be at the bottom.

I'm quite sure this is by design: the last C-s scrolls _up_, which
under scroll-conservatively means Emacs should put point at the
topmost line.  If you'd get to that line by C-p, that would be where
point should be displayed, right?

Why did you expect it to be at the bottom?

And does the custom-set-faces even make a difference (I cannot test
that where I'm typing this)?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Mon, 28 Nov 2011 12:15:01 GMT) Full text and rfc822 format available.

Message #25 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 10105 <at> debbugs.gnu.org
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Mon, 28 Nov 2011 13:12:48 +0100
>> 1. Eval: "(setq scroll-conservatively 101)".
>> 2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
>> 3. Visit the attached file.
>> 4. Type "C-s p C-s C-s C-s".
>> --> At this point, the Isearch has moved point to line "p1", but it's
>> positioned at the top of the window.  It should be at the bottom.
>
> I'm quite sure this is by design: the last C-s scrolls _up_, which
> under scroll-conservatively means Emacs should put point at the
> topmost line.  If you'd get to that line by C-p, that would be where
> point should be displayed, right?
>
> Why did you expect it to be at the bottom?

Because, after the "failing" C-s, the Isearch begins again from the
top of the buffer, so that the search direction is always (at least
conceptually) from top to bottom, i.e. _fordward_.  See info node
"(emacs)Repeat Isearch".

> And does the custom-set-faces even make a difference (I cannot test
> that where I'm typing this)?

Oh no, you're right.  Thus step #2 in the above recipe is unnecessary (sorry).


-- 
Dani Moncayo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Mon, 28 Nov 2011 13:11:02 GMT) Full text and rfc822 format available.

Message #28 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 10105 <at> debbugs.gnu.org
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Mon, 28 Nov 2011 08:08:14 -0500
> Date: Mon, 28 Nov 2011 13:12:48 +0100
> From: Dani Moncayo <dmoncayo <at> gmail.com>
> Cc: 10105 <at> debbugs.gnu.org
> 
> > Why did you expect it to be at the bottom?
> 
> Because, after the "failing" C-s, the Isearch begins again from the
> top of the buffer, so that the search direction is always (at least
> conceptually) from top to bottom, i.e. _fordward_.

The _search_ direction is forward, that's true.  But
scroll-conservatively is not about the search direction, it is about
the direction in which point moves in the buffer from its last
displayed location.  And that is _backward_, not forward.

> See info node "(emacs)Repeat Isearch".

I will see your manual reference and raise ya.  From info node
"(emacs)Auto Scrolling", pay attention to the last sentence:

   Emacs performs "automatic scrolling" when point moves out of the
   visible portion of the text.

     Normally, this centers point vertically within the window.
   However, if you set `scroll-conservatively' to a small number N,
   then if you move point just a little off the screen (less than N
   lines), Emacs scrolls the text just far enough to bring point back
   on screen.  By default, `scroll-conservatively' is 0.  If you set
   `scroll-conservatively' to a large number (larger than 100), Emacs
   will never center point as result of scrolling, even if point moves
   far away from the text previously displayed in the window.  With
   such a large value, Emacs will always scroll text just enough for
   bringing point into view, so point will end up at the top or bottom
   of the window, depending on the scroll direction.

It talks about the direction in which point moves wrt the window, not
the direction of search.

Anyway, this is not something the display engine can fix.  If we want
point at the window bottom in this case, Isearch should arrange for
that to happen.  The display engine does not know anything about
Isearch and wrap-around, all it has is the previous window start point
and the new location of point in the buffer.  E.g., try "M-x goto-char" 
and you will see that point ends up at the top or bottom line
depending on the direction you move it.

So if you still want to have the behavior changed, please file a
separate bug against Isearch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Mon, 28 Nov 2011 17:40:02 GMT) Full text and rfc822 format available.

Message #31 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 10105 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo <at> gmail.com>
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Mon, 28 Nov 2011 12:37:47 -0500
>> > Why did you expect it to be at the bottom?
>> Because, after the "failing" C-s, the Isearch begins again from the
>> top of the buffer, so that the search direction is always (at least
>> conceptually) from top to bottom, i.e. _fordward_.
> The _search_ direction is forward, that's true.
> But scroll-conservatively is not about the search direction, it is
> about the direction in which point moves in the buffer from its last
> displayed location.  And that is _backward_, not forward.

Indeed: it would make sense to put point at the bottom, but that
requires information to which the redisplay does not have access.
If you really insist, you could make isearch force a redisplay with
point at (point-min) when doing the wrap around and before moving to the
actual destination, but I don't think we want to go that far.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Mon, 28 Nov 2011 18:14:02 GMT) Full text and rfc822 format available.

Message #34 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 10105 <at> debbugs.gnu.org, dmoncayo <at> gmail.com
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Mon, 28 Nov 2011 20:11:27 +0200
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> Cc: Dani Moncayo <dmoncayo <at> gmail.com>, 10105 <at> debbugs.gnu.org
> Date: Mon, 28 Nov 2011 12:37:47 -0500
> 
> If you really insist, you could make isearch force a redisplay with
> point at (point-min) when doing the wrap around and before moving to the
> actual destination, but I don't think we want to go that far.

That would momentarily flash incorrect display, so I don't think it's
wise.

Isearch could notice the scroll-conservatively setting, and position
the hit accordingly in this case.  Gross, I know, but...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Tue, 29 Nov 2011 07:11:01 GMT) Full text and rfc822 format available.

Message #37 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 10105 <at> debbugs.gnu.org
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Tue, 29 Nov 2011 09:05:04 +0200
> 1. Eval: "(setq scroll-conservatively 101)".
> 2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
> 3. Visit the attached file.
> 4. Type "C-s p C-s C-s C-s".
> --> At this point, the Isearch has moved point to line "p1", but it's
> positioned at the top of the window.  It should be at the bottom.

I've just noticed that Firefox behaves exactly the same as Emacs.
When typing repeatedly `F3' and wrapping around to the beginning
of the Web page, the search string is highlighted and positioned
at the top of the Firefox window, not at the bottom.  Firefox imitates
Emacs-like Isearch.  So we should not disappoint users by changing
the traditional behavior in Emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10105; Package emacs. (Tue, 29 Nov 2011 16:58:01 GMT) Full text and rfc822 format available.

Message #40 received at 10105 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: 10105 <at> debbugs.gnu.org, dmoncayo <at> gmail.com
Subject: Re: bug#10105: 24.0.91; Possible bug in `scroll-conservatively'
Date: Tue, 29 Nov 2011 18:55:36 +0200
> From: Juri Linkov <juri <at> jurta.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  10105 <at> debbugs.gnu.org
> Date: Tue, 29 Nov 2011 09:05:04 +0200
> 
> > 1. Eval: "(setq scroll-conservatively 101)".
> > 2. Eval: "(custom-set-faces '(mode-line ((t (:box (:line-width 1))))))".
> > 3. Visit the attached file.
> > 4. Type "C-s p C-s C-s C-s".
> > --> At this point, the Isearch has moved point to line "p1", but it's
> > positioned at the top of the window.  It should be at the bottom.
> 
> I've just noticed that Firefox behaves exactly the same as Emacs.
> When typing repeatedly `F3' and wrapping around to the beginning
> of the Web page, the search string is highlighted and positioned
> at the top of the Firefox window, not at the bottom.  Firefox imitates
> Emacs-like Isearch.  So we should not disappoint users by changing
> the traditional behavior in Emacs.

I agree with your conclusion, but for the record I'd like to point out
that what you see in Emacs 24 is not the traditional behavior, not in
this case.  All versions of Emacs before 24 would not keep point at
the first or last screen line, they would sooner or later center point
in the window.  Emacs 23.3, in particular, centers point already after
the first "C-s p"; Emacs 22.3 centers it after the next C-s.

Only Emacs 24 behaves consistently when scroll-conservatively is set
to a large value.  IOW, the default "recentering" is now completely
replaced with code that puts point on the first or last line in the
window (barring bugs, of course) when this variable is set.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 28 Dec 2011 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.