Subject: Re: bug#70711: 30.0.50; Issue with flymake indicators

From: Roman Rudakov <[email-masked]>
Date: Thu, 02 May 2024 22:43:07 +0200

Elijah G <[email-masked]> writes:

> On Thu, May 2, 2024 at 5:04 AM Eli Zaretskii <[email-masked]> wrote:
>>
>> > From: Roman Rudakov <[email-masked]>
>> > Date: Thu, 02 May 2024 10:06:15 +0200
>> >
>> > After the latest update of flymake I started experiencing an issue
>> > with indicators. The problem occurs if I try to disable indicators
>> > completely.
>> >
>> > Steps to reproduce from "emacs -q":
>> > 1. Evaluate the following forms:
>> >
>> > (setopt flymake-fringe-indicator-position nil
>> >         flymake-margin-indicator-position nil)
>> > (flymake-mode)
>> >
>> > 2. Type some invalid expression to trigger flymake.
>> >
>> > Expected result: No indicators.
>> >
>> > Actual result: Exclamation mark is shown right before the faulty
>> > expression (not even on fringe or margin).
>>
>> Elijah, could you please look into this?
>>
>> Thanks.
>
> Hi Eli, below you can find the attached patch that
> should fix this issue.
>
> Roman Can you eval this defun and tell
> if the bug is fixed?
>
> Thanks.
>
> ``` elisp
> (defun flymake--indicator-overlay-spec (indicator)
>   "Return INDICATOR as propertized string to use in error indicators."
>   (let* ((value (if (symbolp indicator)
>                     (symbol-value indicator)
>                   indicator))
>          (indicator-car (if (listp value)
>                             (car value)
>                           value))
>          (indicator-cdr (if (listp value)
>                             (cdr value))))
>     (cond
>      ((and (symbolp indicator-car)
>            flymake-fringe-indicator-position)
>       (propertize "!" 'display
>                   (cons flymake-fringe-indicator-position
>                         (if (listp value)
>                             value
>                           (list value)))))
>      ((and (stringp indicator-car)
>            flymake-margin-indicator-position)
>       (propertize "!"
>                   'display
>                   `((margin ,flymake-margin-indicator-position)
>                     ,(propertize
>                       indicator-car
>                       'face
>                       `(:inherit (,indicator-cdr
>                                   default)))))))))
> ````

Hello Elijah, I can confirm that the patch fixes the issue. Thank you.
-- 
Best regards, Roman