Subject: Re: bug#51549: 29.0.50; flymake error when filename contain '%'

From: João Távora <[email-masked]>
Date: Sat, 6 Nov 2021 16:45:59 +0000

On Sat, Nov 6, 2021 at 11:08 AM Stefan Kangas <[email-masked]> wrote:

> That's what I thought too, until I looked at the code.  Unfortunately,
> the fix we both thought of isn't that trivial as we set
> `warning-type-format' like this:
>
>     (warning-type-format
>              (format " [%s %s]"
>                      (or sublog 'flymake)
>                      (current-buffer)))

Ah I see.  Then maybe the problem is how that is used forward.

> And then we run `display-warning', which uses this variable as the first
> argument to format.
>
> Is there a strong need to have this format for flymake warnings?

Absolutely not.  This is probably one of the most over-engineered
things I put in Flymake.  It's occasionally useful, but not terribly so.

>     Emergency [flymake foo%sbar.c]: foo
>
> If not, my best idea for fixing this is to remove the filename from the
> `warning-type-format', and put it in the message instead.  That would be
> a backwards-incompatible change, however.

Yes, do what you think is best, and thanks in advance.
It's good to have the buffer name where the warning came from,
but it doesn't have to be in that exact place.  Maybe just
escaping the "%" in the return value of `current-buffer`
would work though?  Doubling the "%" into "%%", perhaps.

João