GNU bug report logs - #54473
28.0.91; [PATCH] Eldoc: Handle invisible text when truncating strings

Previous Next

Package: emacs;

Reported by: Augusto Stoffel <arstoffel <at> gmail.com>

Date: Sun, 20 Mar 2022 12:08:02 UTC

Severity: normal

Tags: patch

Found in version 28.0.91

Fixed in version 29.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54473 in the body.
You can then email your comments to 54473 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#54473; Package emacs. (Sun, 20 Mar 2022 12:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Augusto Stoffel <arstoffel <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 20 Mar 2022 12:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Cc: João Távora <joaotavora <at> gmail.com>,
 andreyk.mad <at> gmail.com
Subject: 28.0.91; [PATCH] Eldoc: Handle invisible text when truncating strings
Date: Sun, 20 Mar 2022 13:06:56 +0100
[Message part 1 (text/plain, inline)]
This should solve the Eglot-related problem described in this Github comment:

https://github.com/joaotavora/eglot/issues/865#issuecomment-1065565845

[0001-Eldoc-Handle-invisible-text-when-truncating-strings.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54473; Package emacs. (Sun, 20 Mar 2022 13:11:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: "simon254--- via Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: 28.0.91;
 [PATCH] Eldoc: Handle invisible text when truncating strings
Date: Sun, 20 Mar 2022 13:10:54 +0000
[Message part 1 (text/plain, inline)]
Looks fine, but would need, I think, a decent amount of testing:

* In eglot.el, being validated by both Andrii and you for your particular
use cases.
* In bare emacs-lisp-mode, with multiple eldoc-documentation-strategy
options.  It should
  behave exactly the same before and after the patch, as elisp doesn't use
invisible stuff.
* In other situations you can think of.  Like variations on
eldoc-area-use-multiline-p and
  eldoc-echo-area-display-truncation-messages.  Again, here the behaviour
should be
  equivalent pre- and post- patch.

Just noting this because in my memory this code is somewhat hairy.  That
said, the patch "looks" really fine :-)

Thanks,
João

On Sun, Mar 20, 2022 at 12:06 PM Augusto Stoffel <arstoffel <at> gmail.com>
wrote:

> This should solve the Eglot-related problem described in this Github
> comment:
>
> https://github.com/joaotavora/eglot/issues/865#issuecomment-1065565845
>
>

-- 
João Távora
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54473; Package emacs. (Sun, 20 Mar 2022 13:53:01 GMT) Full text and rfc822 format available.

Message #11 received at 54473 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54473 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#54473: 28.0.91;
 [PATCH] Eldoc: Handle invisible text when truncating strings
Date: Sun, 20 Mar 2022 15:52:32 +0200
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Date: Sun, 20 Mar 2022 13:06:56 +0100
> Cc: João Távora <joaotavora <at> gmail.com>,
>  andreyk.mad <at> gmail.com
> 
> This should solve the Eglot-related problem described in this Github comment:
> 
> https://github.com/joaotavora/eglot/issues/865#issuecomment-1065565845

If this is proposed for the release branch, then can you tell more?
The discussion to which you pointed seems to be caused by some recent
change to Eglot that you installed several days ago, so how does it
affect the current pretest of Emacs 28?

I need to understand this to decide whether to consider the change for
the release branch.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54473; Package emacs. (Sun, 20 Mar 2022 14:03:02 GMT) Full text and rfc822 format available.

Message #14 received at 54473 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 54473 <at> debbugs.gnu.org, Augusto Stoffel <arstoffel <at> gmail.com>,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#54473: 28.0.91; [PATCH] Eldoc: Handle invisible text when
 truncating strings
Date: Sun, 20 Mar 2022 14:03:16 +0000
[Message part 1 (text/plain, inline)]
On Sun, Mar 20, 2022 at 1:52 PM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Augusto Stoffel <arstoffel <at> gmail.com>
> > Date: Sun, 20 Mar 2022 13:06:56 +0100
> > Cc: João Távora <joaotavora <at> gmail.com>,
> >  andreyk.mad <at> gmail.com
> >
> > This should solve the Eglot-related problem described in this Github
> comment:
> >
> > https://github.com/joaotavora/eglot/issues/865#issuecomment-1065565845
>
> If this is proposed for the release branch, then can you tell more?
> The discussion to which you pointed seems to be caused by some recent
> change to Eglot that you installed several days ago, so how does it
> affect the current pretest of Emacs 28?
>
> I need to understand this to decide whether to consider the change for
> the release branch.
>

Eglot, the Eldoc user, now simply doesn't strip _any_ properties from the
text
it sends Eldoc.  I think is a conceptually correct change to Eglot. It's
just that
Eldoc just doesn't have a way to deal with that yet.

If the patch is tested correctly, it is effectively fixing a bug in
eldoc.el,
whose current formatting/display code is oblivious to invisible text when
calculating how much actual (read visual) free space it has in the echo
area.
And, presumably, this patch fixes that shortcoming.

However, to err on the safe side, I'd say don't push it to the release
branch. Eldoc
is a "core ELPA package" so it can be distributed to the soon-to-be 28
release,
by simply bumping the ELPA package version and then asking for users
to update their packages.  This is how bugs in flymake.el, eldoc.el,
project.el
have been fixed recently: no need to wait for an Emacs release.

Maybe Augusto can fill in any details, if I haven't been clear.

João
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54473; Package emacs. (Sun, 20 Mar 2022 14:36:01 GMT) Full text and rfc822 format available.

Message #17 received at 54473 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 54473 <at> debbugs.gnu.org,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#54473: 28.0.91; [PATCH] Eldoc: Handle invisible text when
 truncating strings
Date: Sun, 20 Mar 2022 15:34:56 +0100
In short, this should definitely not be merged into Emacs 28.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54473; Package emacs. (Sun, 20 Mar 2022 15:59:02 GMT) Full text and rfc822 format available.

Message #20 received at 54473 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54473 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#54473: 28.0.91; [PATCH] Eldoc: Handle invisible text when
 truncating strings
Date: Sun, 20 Mar 2022 17:57:38 +0200
> From: Augusto Stoffel <arstoffel <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  54473 <at> debbugs.gnu.org,  Andrii Kolomoiets
>  <andreyk.mad <at> gmail.com>
> Date: Sun, 20 Mar 2022 15:34:56 +0100
> 
> In short, this should definitely not be merged into Emacs 28.

OK, thanks to both of you.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54473; Package emacs. (Sun, 20 Mar 2022 21:25:01 GMT) Full text and rfc822 format available.

Message #23 received at 54473 <at> debbugs.gnu.org (full text, mbox):

From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 54473 <at> debbugs.gnu.org,
 João Távora <joaotavora <at> gmail.com>
Subject: Re: bug#54473: 28.0.91; [PATCH] Eldoc: Handle invisible text when
 truncating strings
Date: Sun, 20 Mar 2022 23:24:12 +0200
Augusto Stoffel <arstoffel <at> gmail.com> writes:

> This should solve the Eglot-related problem described in this Github comment:
>
> https://github.com/joaotavora/eglot/issues/865#issuecomment-1065565845

I've tested this patch with recent Emacs master and Eglot versions, with
various values for the `eldoc-echo-area-use-multiline-p' variable
(truncate-sym-name-if-fit, 2, 1).

All works as expected.

Thanks Augusto!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54473; Package emacs. (Thu, 24 Mar 2022 15:25:01 GMT) Full text and rfc822 format available.

Message #26 received at 54473 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Andrii Kolomoiets <andreyk.mad <at> gmail.com>, eliz <at> gnu.org
Cc: 54473 <at> debbugs.gnu.org, Augusto Stoffel <arstoffel <at> gmail.com>
Subject: Re: bug#54473: 28.0.91; [PATCH] Eldoc: Handle invisible text when
 truncating strings
Date: Thu, 24 Mar 2022 15:25:19 +0000
Andrii Kolomoiets <andreyk.mad <at> gmail.com> writes:

> Augusto Stoffel <arstoffel <at> gmail.com> writes:
>
>> This should solve the Eglot-related problem described in this Github comment:
>>
>> https://github.com/joaotavora/eglot/issues/865#issuecomment-1065565845
>
> I've tested this patch with recent Emacs master and Eglot versions, with
> various values for the `eldoc-echo-area-use-multiline-p' variable
> (truncate-sym-name-if-fit, 2, 1).
>
> All works as expected.
>
> Thanks Augusto!

I've pushed this change to master and bumped the eldoc.el package
version.

João




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54473; Package emacs. (Thu, 23 Jun 2022 17:25:02 GMT) Full text and rfc822 format available.

Message #29 received at 54473 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: João Távora <joaotavora <at> gmail.com>
Cc: Augusto Stoffel <arstoffel <at> gmail.com>, eliz <at> gnu.org, 54473 <at> debbugs.gnu.org,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#54473: 28.0.91; [PATCH] Eldoc: Handle invisible text when
 truncating strings
Date: Thu, 23 Jun 2022 12:24:07 -0500
close 54473 29.1
thanks

João Távora <joaotavora <at> gmail.com> writes:

> I've pushed this change to master and bumped the eldoc.el package
> version.

This was pushed to master, so I'm closing this bug:

    commit 45978f97be89ae989ecf9e7129b88592e70a1f24
    Author: Augusto Stoffel <arstoffel <at> gmail.com>
    Date:   Thu Mar 24 15:05:39 2022 +0000

        Handle invisible text in Eldoc when calculating size

        Co-authored-by: João Távora <joaotavora <at> gmail.com>

        * lisp/emacs-lisp/eldoc.el (eldoc--echo-area-substring,
        eldoc-display-in-echo-area):  Take invisible text into consideration
        when counting lines to crop an echo-area message.
        (Version): Bump.




bug marked as fixed in version 29.1, send any further explanations to 54473 <at> debbugs.gnu.org and Augusto Stoffel <arstoffel <at> gmail.com> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Thu, 23 Jun 2022 17:25:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 22 Jul 2022 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.