all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dani Moncayo <dmoncayo@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 12811@debbugs.gnu.org
Subject: bug#12811: 24.3.50; `scroll-up/down-aggressively' don't seem to work as expected
Date: Sun, 11 Nov 2012 17:55:59 +0100	[thread overview]
Message-ID: <CAH8Pv0ieYQsfoVC+ezT-zuZKG7ohsdfPQm9e1dbtYPi1nS4NaQ@mail.gmail.com> (raw)
In-Reply-To: <83zk2ow1ry.fsf@gnu.org>

> Emacs doesn't count in lines, it counts in pixels.  And since a line
> has a finite size, where exactly those 70% end is not well determined
> (is it the top of the line, the bottom of the line, somewhere in
> between?).

I don't see the point of using pixel as unit of measure here.  The
unit should be the line, because the problem to solve here can
(should) be expressed in terms of lines; going down to the pixel level
is unnecessary and confusing, IMO.

So, given a window which is W lines high, the line L that is X % from
the top of the window can be determined as

L = round((X/100)*(W-1))+1

Conversely, the percentage X from the top of the window can be determined as

X = 100*(L-1)/(W-1)

Therefore, testing with a window of W=11 lines high makes the above
calculations quite easy, because each line counts as 10%.

-- 
Dani Moncayo





  reply	other threads:[~2012-11-11 16:55 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
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 [this message]
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

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

  git send-email \
    --in-reply-to=CAH8Pv0ieYQsfoVC+ezT-zuZKG7ohsdfPQm9e1dbtYPi1nS4NaQ@mail.gmail.com \
    --to=dmoncayo@gmail.com \
    --cc=12811@debbugs.gnu.org \
    --cc=eliz@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.