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


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

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

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

> Flymake includes the buffer name in `warning-type-format' (see
> `flymake--log-1').
> When the file name - and the buffer name - contain a % character it is
> very probable that the `format' call in `display-warning' either fails
> or produce unexpected results.
>
> In my case I used a file name arm-trusted-firmware-2.4_%.bbappend with a
> local flymake backend running a local linter.
> The local backend uses a process sentinel to process errors and generate
> flymake diagnostic objects with
>
>    (flymake-make-diagnostic source beg end type msg)
>
> where
> source is the buffer visiting arm-trusted-firmware-2.4_%.bbappend,
> bed and end set from `flymake-diag-region'
> type is :warning
> and msg is a string with the error message from the linter.

Thanks for the bug report.  I can reproduce this using this contrived
example:

./src/emacs -Q --eval "(progn (require 'flymake) (find-file
\"/tmp/foo%sbar.c\") \
    (flymake--log-1 :emergency nil \"foo\"))"

I now see in the *Warnings* buffer:

    Emergency [flymake fooflymakebar.c]: foo

The expected output is:

    Emergency [flymake foo%sbar.c]: foo

Your analysis of why the problem happens seems correct to me, but I'm
not sure how to best fix it.  João, what do you think?




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.