GNU bug report logs - #51549
29.0.50; flymake error when filename contain '%'

Previous Next

Package: emacs;

Reported by: Ola x Nilsson <ola.x.nilsson <at> axis.com>

Date: Mon, 1 Nov 2021 11:53:02 UTC

Severity: normal

Tags: confirmed

Found in version 29.0.50

Fixed in version 28.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: João Távora <joaotavora <at> gmail.com>
Cc: Ola x Nilsson <ola.x.nilsson <at> axis.com>, 51549 <at> debbugs.gnu.org
Subject: bug#51549: 29.0.50; flymake error when filename contain '%'
Date: Sat, 6 Nov 2021 04:08:55 -0700
João Távora <joaotavora <at> gmail.com> writes:

> Thanks for the report.  I don't have much time to look into this but
> this looks like the typical problem where a user-provided
> string is being passed as the first argument of format/message.
>
> In these cases, one normally makes it so that the first
> argument is simply the string "%s" and then the second
> argument is that user-provided thing.

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)))

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?

    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.




This bug report was last modified 3 years and 193 days ago.

Previous Next


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