From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: (pos-visible-in-window-p t nil t) returns wrong position/is suboptimally documented.
Date: Wed, 30 Sep 2015 10:22:31 +0000 [thread overview]
Message-ID: <20150930102231.GB6672@acm.fritz.box> (raw)
In-Reply-To: <83lhbob6bs.fsf@gnu.org>
Hello, Eli.
On Wed, Sep 30, 2015 at 12:32:39PM +0300, Eli Zaretskii wrote:
> > Date: Wed, 30 Sep 2015 08:56:11 +0000
> > Cc: emacs-devel@gnu.org
> > From: Alan Mackenzie <acm@muc.de>
> > "If POSITION is `t', that means to check the first visible position
> > of the last visible screen line in WINDOW."
> > doesn't seem quite right. If the text in the window is scrolled such
> > that EOB is in the middle of the window, POSITION t gives the
> > coordinates of the last line containing text, not the last visible
> > screen line.
> You mean, it isn't clear that "screen line" means line with text? I
> could add "with text" if that's the issue (I thought it was obvious).
> > How about something like:
> > "If POSITION is `t', that means to check the first visible position
> > of the last visible screen line in WINDOW which is at or above the
> > end of the window's buffer."
> Too complex, IMO. It took me 4 readings to understand what you mean,
> and that's _after_ I've read the description of the situation you were
> taking about.
> > However 2: I think there's a bug in the functionality, too. If there is
> > o - a text buffer
> > o - with no terminating LF on its last line, and
> > o - that last line is above the window's last line
> > then (pos-visible-in-window t nil t) returns the coordinates of the last
> > lines's EOL. This is the case in both a Linux virtual terminal and an X
> > windows session.
> It's not a bug. If you think it's important to mention this marginal
> use case, I can add that, too.
OK, it's deliberate. It's a touch puzzling, though. I should grep the
elisp sources to find out what it's for. I do think it should be
mentioned in the doc, even if only for preventing somebody like me
raising a spurious bug report in the future.
How about expressing the piece of documentation as:
"If POSITION is `t', that means to check the position the first
visible position of the last visible screen line with text in
WINDOW; but if the end of the window's buffer is on the window, this
position is used instead."
? It's a bit convoluted, but then again, the function isn't simple
either.
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2015-09-30 10:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-27 10:40 (pos-visible-in-window-p t nil t) returns wrong position/is suboptimally documented Alan Mackenzie
2015-09-27 11:06 ` Eli Zaretskii
2015-09-30 7:21 ` Eli Zaretskii
2015-09-30 8:56 ` Alan Mackenzie
2015-09-30 9:32 ` Eli Zaretskii
2015-09-30 10:22 ` Alan Mackenzie [this message]
2015-09-30 13:52 ` Eli Zaretskii
2015-09-30 14:05 ` Alan Mackenzie
2015-10-01 7:36 ` 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=20150930102231.GB6672@acm.fritz.box \
--to=acm@muc.de \
--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).