[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
pixel-point-and-height-at-unseen-line
From: |
Eli Zaretskii |
Subject: |
pixel-point-and-height-at-unseen-line |
Date: |
Sat, 27 Nov 2021 08:51:53 +0200 |
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.
- pixel-point-and-height-at-unseen-line,
Eli Zaretskii <=