unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dani Moncayo <dmoncayo@gmail.com>
Cc: 12811@debbugs.gnu.org
Subject: bug#12811: 24.3.50; `scroll-up/down-aggressively' don't seem to work as expected
Date: Tue, 06 Nov 2012 18:54:26 +0200	[thread overview]
Message-ID: <83ip9i3c59.fsf@gnu.org> (raw)
In-Reply-To: <CAH8Pv0i8draLsPnLVru0QwcOCHx4zcrDnmGwNDTxUVaG5kuJEg@mail.gmail.com>

> Date: Tue, 6 Nov 2012 00:27:55 +0100
> From: Dani Moncayo <dmoncayo@gmail.com>
> 
> 1. Visit the attached file.
> 2. Adjust the height of the Emacs GUI frame so that only lines 1 to 11
> are visible.  With this setup it is easy to tell the relative position
> of a line in the window in terms of percentage from the top or bottom,
> since each line counts as 10% for such percentages.

I guess you meant lines 1 to 10, not 11, because with 10 the
percentages are not integral numbers of lines.

> 3. Go to line 1.
> 4. Type: C-u 1 5 C-n
> --> Point goes to line 16, and that line is centered in the window. So
> everything is as expected so far.
> 5. M-: (setq scroll-up-aggressively 0.7) <RET>
> 6. Repeat steps #3 and #4.
> --> This time I observe that point goes to line 16, but that line is
> near the bottom of the window (9th line; 20% from the bottom) when it
> should be near the top (4th line; 70% from the bottom).
> 
> 
> I also observe a misbehavior when testing scroll-down-aggressively:
> 1. M-: (setq scroll-down-aggressively 0.7) <RET>
> 2. Go to line 30 and make that line the last visible one.
> 3. Type: C-u 1 1 C-p
> --> I observe that point goes to line 19, but that line is the 10th in
> the window (90% from the top), when it should be the 8th line (70%
> from the top).

IMO, it doesn't make sense to expect scroll-up/down-aggressively do
anything useful when you move point by more than a window-full.  (In
your case, the window is 11 (or 10) lines, and you move point by 15
lines.)  These variables exist to control the _overlap_ between the
current window-full of text and the next/previous one.  When you move
by more than the window's height, so that there's no overlap at all,
these variables are meaningless.  E.g., what would you expect them to
do with "C-u 100 C-n", or with "C-u 100000 M-x goto-char"? why would
it make sense to position point anywhere but the middle of the window
for such large scrolls?

That is why what you expected never worked in Emacs, at least since
v21.1.  The code which implements the effect of these variables was
written under the assumption that point is only a small ways outside
of the window, one or 2 screen lines, because this is what happens
when you type "C-n" or "C-p" on the border of the scroll margin.

Having said that, since the code already almost did TRT, it is much
easier for me to fix it for this use case than to argue about the
applicability of these variables.  So I did just that in revision
110795 on the emacs-24 branch.  Just don't ask me to make C-v and M-v
also obey these variables...





  reply	other threads:[~2012-11-06 16:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05 23:27 bug#12811: 24.3.50; `scroll-up/down-aggressively' don't seem to work as expected Dani Moncayo
2012-11-06 16:54 ` Eli Zaretskii [this message]
2012-11-06 17:30   ` Eli Zaretskii
2012-11-06 19:18   ` Dani Moncayo
2012-11-06 21:36     ` Eli Zaretskii
2012-11-07  1:58       ` Juanma Barranquero
2012-11-07  9:23       ` Dani Moncayo
2012-11-07  9:34         ` Dani Moncayo
2012-11-07 16:59         ` Eli Zaretskii
2012-11-09 17:17           ` Dani Moncayo
2012-11-11 13:33             ` Dani Moncayo
2012-11-11 16:19               ` Eli Zaretskii
2012-11-11 16:55                 ` Dani Moncayo
2012-11-11 17:21                   ` Eli Zaretskii
2012-11-11 17:28                     ` Dani Moncayo

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=83ip9i3c59.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=12811@debbugs.gnu.org \
    --cc=dmoncayo@gmail.com \
    /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).