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: wishlist

Tags: patch

Full log


View this message in rfc822 format

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: 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.




This bug report was last modified 116 days ago.

Previous Next


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