]> git.eshelyaron.com Git - emacs.git/commitdiff
Escape '%' in filenames to fix flymake warnings
authorStefan Kangas <stefan@marxist.se>
Sat, 6 Nov 2021 19:59:28 +0000 (20:59 +0100)
committerStefan Kangas <stefan@marxist.se>
Sat, 6 Nov 2021 19:59:28 +0000 (20:59 +0100)
* lisp/progmodes/flymake.el (flymake--log-1): Escape '%' in filenames
for 'warning-type-format' so they are not interpreted as a %-sequence
by 'format' later.  (Bug#51549)

lisp/progmodes/flymake.el

index bcb43c1faf1db23d500635fa6e68abd2b4dc1f20..403925c8557355c64f67fa4010a84420d9be9727 100644 (file)
@@ -266,7 +266,9 @@ If set to nil, don't suppress any zero counters."
         (warning-type-format
          (format " [%s %s]"
                  (or sublog 'flymake)
-                 (current-buffer))))
+                 ;; Handle file names with "%" correctly.  (Bug#51549)
+                 (string-replace "%" "%%"
+                                 (buffer-name (current-buffer))))))
     (display-warning (list 'flymake sublog)
                      (apply #'format-message msg args)
                      (if (numberp level)