From d85cf33e494f4e9ada2a9359247e88775e92e7c0 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 6 Nov 2021 20:59:28 +0100 Subject: [PATCH] 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) --- lisp/progmodes/flymake.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.39.2