From: Eli Zaretskii <eliz@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: emacs-devel@gnu.org
Subject: pixel-point-and-height-at-unseen-line
Date: Sat, 27 Nov 2021 08:51:53 +0200 [thread overview]
Message-ID: <83h7by146u.fsf@gnu.org> (raw)
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.
next reply other threads:[~2021-11-27 6:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-27 6:51 Eli Zaretskii [this message]
2021-11-27 6:57 ` pixel-point-and-height-at-unseen-line Po Lu
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=83h7by146u.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.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).