From: Stefan Kangas Date: Sat, 6 Nov 2021 19:59:28 +0000 (+0100) Subject: Escape '%' in filenames to fix flymake warnings X-Git-Tag: emacs-28.0.90~109 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d85cf33e49;p=emacs.git Escape '%' in filenames to fix flymake warnings * 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) --- diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index bcb43c1faf1..403925c8557 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -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)