GNU bug report logs - #76455
[PATCH] Allow truncate flymake end-of-line diagnostic summary

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Fri, 21 Feb 2025 04:50:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 76455 AT debbugs.gnu.org.

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#76455; Package emacs. (Fri, 21 Feb 2025 04:50:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Elijah Gabe Pérez <eg642616 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 21 Feb 2025 04:50:02 GMT) Full text and rfc822 format available.

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

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Allow truncate flymake end-of-line diagnostic summary
Date: Thu, 20 Feb 2025 22:49:37 -0600
[Message part 1 (text/plain, inline)]
Tags: patch

This patch allow to user set a limit for
`flymake-show-diagnostics-at-end-of-line' summary text.

This way you can shorten long messages like:

(message ) ‘message’ called with 0 arguments, but requires 1 or more
           error message^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

to...

(message ) ‘message’ called with 0 arguments...
           error message^^^^^^^^^^^^^^^^^^^^^^^

This is related to bug#74691, which I also have this problem.

[0001-Allow-truncate-flymake-end-of-line-diagnostic-summar.patch (text/patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
                                                   - E.G via GNU Emacs.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76455; Package emacs. (Fri, 21 Feb 2025 07:55:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>,
 sbaugh <at> janestreet.com
Cc: 76455 <at> debbugs.gnu.org
Subject: Re: bug#76455: [PATCH] Allow truncate flymake end-of-line diagnostic
 summary
Date: Fri, 21 Feb 2025 09:54:06 +0200
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Date: Thu, 20 Feb 2025 22:49:37 -0600
> 
> This patch allow to user set a limit for
> `flymake-show-diagnostics-at-end-of-line' summary text.
> 
> This way you can shorten long messages like:
> 
> (message ) ‘message’ called with 0 arguments, but requires 1 or more
>            error message^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> to...
> 
> (message ) ‘message’ called with 0 arguments...
>            error message^^^^^^^^^^^^^^^^^^^^^^^
> 
> This is related to bug#74691, which I also have this problem.

Would it make sense to use string-truncate-left instead of reinventing
what it does?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76455; Package emacs. (Fri, 21 Feb 2025 08:04:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sbaugh <at> janestreet.com,
 Elijah Gabe Pérez <eg642616 <at> gmail.com>,
 76455 <at> debbugs.gnu.org
Subject: Re: bug#76455: [PATCH] Allow truncate flymake end-of-line
 diagnostic summary
Date: Fri, 21 Feb 2025 10:02:15 +0200
>> This patch allow to user set a limit for
>> `flymake-show-diagnostics-at-end-of-line' summary text.
>> 
>> This way you can shorten long messages like:
>> 
>> (message ) ‘message’ called with 0 arguments, but requires 1 or more
>>            error message^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> 
>> to...
>> 
>> (message ) ‘message’ called with 0 arguments...
>>            error message^^^^^^^^^^^^^^^^^^^^^^^
>> 
>> This is related to bug#74691, which I also have this problem.
>
> Would it make sense to use string-truncate-left instead of reinventing
> what it does?

Or truncate-string-to-width.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76455; Package emacs. (Fri, 21 Feb 2025 17:08:02 GMT) Full text and rfc822 format available.

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

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: sbaugh <at> janestreet.com, 76455 <at> debbugs.gnu.org
Subject: Re: bug#76455: [PATCH] Allow truncate flymake end-of-line
 diagnostic summary
Date: Fri, 21 Feb 2025 11:07:29 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
>> Date: Thu, 20 Feb 2025 22:49:37 -0600
>> 
>> This patch allow to user set a limit for
>> `flymake-show-diagnostics-at-end-of-line' summary text.
>> 
>> This way you can shorten long messages like:
>> 
>> (message ) ‘message’ called with 0 arguments, but requires 1 or more
>>            error message^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> 
>> to...
>> 
>> (message ) ‘message’ called with 0 arguments...
>>            error message^^^^^^^^^^^^^^^^^^^^^^^
>> 
>> This is related to bug#74691, which I also have this problem.
>
> Would it make sense to use string-truncate-left instead of reinventing
> what it does?

The problem is that `string-truncate-left' only truncate from left and
not from right.

If I eval this:
   (string-truncate-left "‘message’ called with 0 arguments, but requires 1 or more" 30)
returns:
  "...nts, but requires 1 or more"

But I think this would be more appropriate:
  "‘message’ called with 0 arg..."

Maybe the way to achieve this would be something like this:

  (string-reverse
    (string-truncate-left
      (string-reverse
        "‘message’ called with 0 arguments, but requires 1 or more") 20))

but this is very ugly imo.

That's why I decided to use `substring',
unless there is a "string-truncate-right" that can I use.

-- 
                                                   - E.G via GNU Emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#76455; Package emacs. (Fri, 21 Feb 2025 17:48:03 GMT) Full text and rfc822 format available.

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

From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: sbaugh <at> janestreet.com, Eli Zaretskii <eliz <at> gnu.org>, 76455 <at> debbugs.gnu.org
Subject: Re: bug#76455: [PATCH] Allow truncate flymake end-of-line
 diagnostic summary
Date: Fri, 21 Feb 2025 11:47:15 -0600
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:

> Or truncate-string-to-width.

I didn't know about that function.
I've now updated the patch:

[0001-Allow-truncate-flymake-end-of-line-diagnostic-summar.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
-- 
                                                   - E.G via GNU Emacs.

This bug report was last modified today.

Previous Next


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