From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#51590: follow-mode is broken with header-line and tab-line Date: Mon, 8 Nov 2021 16:36:36 +0100 Message-ID: References: <86bl31xfl9.fsf@mail.linkov.net> <83h7ctgk93.fsf@gnu.org> <86pmrf3l9m.fsf_-_@mail.linkov.net> <835yt7g3my.fsf@gnu.org> <8335o9dazn.fsf@gnu.org> <83bl2xbhz1.fsf@gnu.org> <83o86x9lg6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25624"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 51590@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 08 16:37:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mk6hx-0006UG-KU for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Nov 2021 16:37:17 +0100 Original-Received: from localhost ([::1]:44858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk6hv-00064Q-O4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Nov 2021 10:37:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk6hi-00063K-Oi for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2021 10:37:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk6hi-0003G5-GZ for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2021 10:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mk6hi-0007Lv-E8 for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2021 10:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Nov 2021 15:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51590 X-GNU-PR-Package: emacs Original-Received: via spool by 51590-submit@debbugs.gnu.org id=B51590.163638580828234 (code B ref 51590); Mon, 08 Nov 2021 15:37:02 +0000 Original-Received: (at 51590) by debbugs.gnu.org; 8 Nov 2021 15:36:48 +0000 Original-Received: from localhost ([127.0.0.1]:59144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mk6hU-0007LK-4h for submit@debbugs.gnu.org; Mon, 08 Nov 2021 10:36:48 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:47119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mk6hS-0007L6-AI for 51590@debbugs.gnu.org; Mon, 08 Nov 2021 10:36:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1636385798; bh=3lbgat9PiTkjxsvhgdEh1uFML5MChKylQz3ihhZyqZA=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=h4RobsQ88JDUI09/QuSFTe50NR3vPJ3UNg1USX35lSrRKMShn1VpzPh5+u/brMB+8 oUZ+sUzJ8QeVUj0IC966DMElwAz1EhoLBK59stm0+tLEjcz/gf3d8iYG9k65QuIkY3 HSHw7GzQhwT8hyvvWIXq+fboI7JHTeWmXo22Zj88= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.102] ([212.95.5.204]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MbAh0-1m8r8f3yRc-00bdIc; Mon, 08 Nov 2021 16:36:38 +0100 In-Reply-To: <83o86x9lg6.fsf@gnu.org> Content-Language: en-US X-Provags-ID: V03:K1:sPsfzxN0sCSt4/HkwZMCzQrajObmnu5hGcXq97fSNjCOUoVyC1e nzHOMUQo2l3VXG1YovfmUVNjCDmxVEy+i0bCqwNP2vOldwQAHejGoxtET7xLT2bnBuF+buL urYRv8Be0Iwj6p/Ty0dOPj3V6DieeanlsAhF3KY6+lkD2pyNcsiJ7Pz7BrWIE+YNngg1i1M TrLRo7ALHYhvoGKJ/IuZg== X-UI-Out-Filterresults: notjunk:1;V03:K0:sTKVkuNVs1Q=:bN8PPlzNYtmYM5oXDaFAyq jBLNMrzEpKuB6fASlAddCti5ufTbT4QXLaGWko0gtps8NIZCsXl2wlzCscOJv5ETvqKP0GRAr Tz7nmksouLRRmNkGJZSIbHJPrHXb2QtUASOU2bzd4rq5oyrdbnWfCiIQegc3gMgcE+8q1HD2y u66Gn5zkIuUsj8jv2yGIj7Uhjn9PihPbGx4Uer6MThkHia8bbxJhUXgak+meOyttn3OgKlxEM mc4N4MU99LxWzZ7dXHMUyxhAu1gZu06bzdsVeXfpEAbl3Vo2+QbTeB/X2hsetgtxwkciVZWmj 8IuOPFbZEiVrGMgzRnrncSBWELhVzyvYfq5TYu0ipG9DmU4AVNG0E2SLLILWLtuxbkX1PxqN5 r/nYoLN4mYDXE8xgt+xs5DbtuCZOOCJX8UocFlCjUfTQ/wP90Ev9d3sVp3Cw9vvBfPhvGQaTh faf/MqpSa18XorCa9cK0Hya9WV02ViFKyCDWyjLVQMOocVzjPweJcwERu1eLGRL0c3CbDsL0V 6/lLtrfz01lGLRhcyYp7r9I8qeK3tvkoZ8rV0grqGQL6RtnMhkHTZz6lNKuvE2DGsMZtEHeS0 Y+8yAQ3TrHXpLrV6orFp5uus3/m8oDiDRbcrX9q3NLosU3j33Evk3fcG3LvEwkXHDQLNPKCj4 Y35ozZK5FCnAicn7+HBKxWm3cVdoA09ajTV1sZkqXkLmosi/LMOxwXTQV9HCU8+DCPDQe/pey ZTrwHuzs6zOyMLa0wtDZ9ATSw16yMLo8uPOs1qGoCAMbSoRLplPYFwXqoCR13XqK2DRyA/lp X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219359 Archived-At: >> 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