From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: acm@muc.de, 51590@debbugs.gnu.org, juri@linkov.net
Subject: bug#51590: follow-mode is broken with header-line and tab-line
Date: Mon, 8 Nov 2021 16:36:36 +0100 [thread overview]
Message-ID: <db5ff87d-7ed4-f10c-d42a-3ac2da41451a@gmx.at> (raw)
In-Reply-To: <83o86x9lg6.fsf@gnu.org>
>> The text area does not contain the header line.
>
> It does in my book.
How would your book describe the text area? A T-shaped area comprising
the window's body, its header and tab line? What would be the width of
that area? Why would it exclude the mode line?
>> If you look at a version of 'coordinates-in-window-p' from the past
>> century you will see that
>>
>> If COORDINATES are in the text portion of WINDOW,\n\
>> the coordinates relative to the window are returned.\n\
>> If they are in the mode line of WINDOW, `mode-line' is returned.\n\
>> If they are in the top mode line of WINDOW, `header-line' is returned.\n\
>>
>> and this has never changed. The text area is what window_box_height
>> tells us.
>
> I don't think I understand how that follows.
Because text area and header line were mutually exclusive ever since.
At least so until last week.
> And last-century
> documentation may need updating anyway.
It _was_ updated continuously in a sense that tried to preserve the
original meaning of concepts and allowed them to live together with
concepts that were introduced at a later stage. Consider the
'window-height' and 'window-width' controversy, for example.
>> According to your change we'd now have to rewrite doc-strings and info
>> of lots of functions like 'window-text-height', 'window-body-height' or
>> 'window-text-pixel-size'.
>
> If we must, yes. Why is that a catastrophe?
Because the person who has to do that would have to check every single
occurrence of the string "text" in all files that deal with "windows".
>> If 'posn-at-x-y' has a problem, let's fix it. Just that I don't really
>> know what the problem is.
>
> See bug#51632. And let's continue the discussion there.
That bug has been closed meanwhile, like the present one. 'posn-at-x-y'
is a function with ill-conceived arguments (why does WHOLE affect the X
coordinate only) and a doc-string I've never been able to understand.
By default, X and Y are relative to text area of the selected window.
Note that the text area includes the header-line and the tab-line of
the window, if any of them are present.
This is at least as wrong as before: For example, with emacs -Q
(posn-area (posn-at-x-y 0 0))
gives me 'nil' here which is correct since the left fringe is not part of
the text area. But
(posn-area (posn-at-x-y 0 (window-body-height nil t)))
gives me 'mode-line' here which is wrong since, according to your new
definition, the mode line is _not_ part of the text area. Same holds
for a horizontal scroll bar, if present. And with a bottom divider
(posn-area (posn-at-x-y 0 (1- (window-pixel-height))))
gets me 'bottom-divider'.
So I'd suggest to revert your changes wrt the text area. And, since
'posn-at-x-y' deals with coordinates and not with "areas", simply say
that Y is always relative to the top edge of the window while X is
relative to the left body edge of the window if WHOLE is nil and Y is
within the top and bottom body edge of the window and relative to the
left window edge otherwise. Do we have a deal? Not yet ...
(posn-area (posn-at-x-y (1- (window-pixel-width)) 0))
currently gives 'nil' regardless of whether it's done with a header or
tab line and
(posn-area (posn-at-x-y
(1- (window-pixel-width))
(1- (window-pixel-height))))
gives 'nil' on the mode line. Only when I remove _both_ fringes and the
vertical scroll bar I get the expected results. This _is_ a bug and we
should fix it.
martin
next prev parent reply other threads:[~2021-11-08 15:36 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-03 18:24 bug#51590: Tab-line breaks windows of follow-mode Juri Linkov
2021-11-03 18:35 ` Eli Zaretskii
2021-11-04 17:29 ` bug#51590: follow-mode is broken with header-line and tab-line Juri Linkov
2021-11-04 18:46 ` Eli Zaretskii
2021-11-04 19:06 ` Alan Mackenzie
2021-11-05 21:45 ` Alan Mackenzie
2021-11-06 7:00 ` Eli Zaretskii
2021-11-06 11:50 ` Alan Mackenzie
2021-11-06 12:12 ` Eli Zaretskii
2021-11-06 18:31 ` martin rudalics
2021-11-06 18:40 ` Eli Zaretskii
2021-11-08 15:36 ` martin rudalics [this message]
2021-11-08 17:32 ` martin rudalics
2021-11-08 18:47 ` Eli Zaretskii
2021-11-09 10:14 ` martin rudalics
2021-11-06 18:44 ` martin rudalics
2021-11-08 17:59 ` Alan Mackenzie
2021-11-08 18:23 ` Eli Zaretskii
2021-11-09 10:12 ` martin rudalics
2021-11-09 10:10 ` martin rudalics
2021-11-04 18:52 ` martin rudalics
2021-11-07 12:48 ` Alan Mackenzie
2021-11-07 13:14 ` Eli Zaretskii
2021-11-07 14:28 ` Alan Mackenzie
2021-11-07 17:46 ` Juri Linkov
2021-11-07 19:44 ` Alan Mackenzie
2021-11-07 19:56 ` Juri Linkov
2021-11-08 7:13 ` Alan Mackenzie
2021-11-05 7:42 ` Stefan Kangas
2021-11-05 8:55 ` Juri Linkov
2021-11-05 10:15 ` Stefan Kangas
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=db5ff87d-7ed4-f10c-d42a-3ac2da41451a@gmx.at \
--to=rudalics@gmx.at \
--cc=51590@debbugs.gnu.org \
--cc=acm@muc.de \
--cc=eliz@gnu.org \
--cc=juri@linkov.net \
/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).