From: João Távora Date: Wed, 23 Apr 2025 07:32:51 +0000 (+0100) Subject: Flymake: fix flymake-make-diagnostic for numeric code (bug#77856) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3af81effc8dee85b2e30099c970c8db886d7d541;p=emacs.git Flymake: fix flymake-make-diagnostic for numeric code (bug#77856) * lisp/progmodes/flymake.el (flymake-make-diagnostic): Tighten up type requirements. (Version): Bump to 1.4.1 (cherry picked from commit a25fc9a518dc1c4bf1ef86bb949ed2f3c995adea) --- diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 44f923d74a1..995a4dd4c0d 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -313,8 +313,9 @@ TYPE is a diagnostic symbol (see Info Node `(Flymake)Flymake error types') INFO is a description of the problem detected. It may be a string, or -list of three strings (ORIGIN CODE MESSAGE) appropriately categorizing -and describing the diagnostic. +list (ORIGIN CODE MESSAGE) appropriately categorizing and describing the +diagnostic. ORIGIN may be a string or nil. CODE maybe be a string, a +number or nil. MESSAGE must be a string. DATA is any object that the caller wishes to attach to the created diagnostic for later retrieval with `flymake-diagnostic-data'. @@ -338,8 +339,10 @@ Alternatively, EDITS can also be a function of no arguments that performs the fix." (when (stringp locus) (setq locus (expand-file-name locus))) - (when (stringp info) - (setq info (list nil nil info))) + (cond ((stringp info) + (setq info (list nil nil info))) + ((numberp (cadr info)) + (setf (cadr info) (number-to-string (cadr info))))) (flymake--diag-make :locus locus :beg beg :end end :type type :origin (car info) :code (cadr info) :message (caddr info) :data data