From: Po Lu <luangruo@yahoo.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: pixel-point-and-height-at-unseen-line
Date: Sat, 27 Nov 2021 14:57:06 +0800 [thread overview]
Message-ID: <871r32cchp.fsf@yahoo.com> (raw)
In-Reply-To: <83h7by146u.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 27 Nov 2021 08:51:53 +0200")
Eli Zaretskii <eliz@gnu.org> writes:
> This function has several problems that IMO would be good to clean up:
>
> . It's unnecessarily restricted to a very special use case: a single
> screen line above the one where window-start is. It could be much
> more useful (and be moved to subr.el or simple.el) if it could at
> least accept an argument to control on which line or position to
> report.
>
> . It changes important state variables without protecting itself from
> errors and non-local exits, so a C-g at an opportune time will
> disrupt the buffer/window state.
>
> . It calls vertical-motion without checking its return value, which
> could tell you whether it actually moved at all, and where. (One
> bonus of checking the return value is that you could perhaps drop
> the bobp test there.) vertical-motion can do some surprising
> things around overlays and display properties, especially ones that
> include newlines in their strings.
>
> Thanks.
I'll look into that. I did not write that function, I only modified it
(and moved it) so I could reuse the code there in for precision pixel
scrolling.
Thanks.
next prev parent reply other threads:[~2021-11-27 6:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-27 6:51 pixel-point-and-height-at-unseen-line Eli Zaretskii
2021-11-27 6:57 ` Po Lu [this message]
2021-11-27 7:18 ` pixel-point-and-height-at-unseen-line Eli Zaretskii
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=871r32cchp.fsf@yahoo.com \
--to=luangruo@yahoo.com \
--cc=eliz@gnu.org \
--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 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).