]> git.eshelyaron.com Git - emacs.git/commitdiff
Flymake: fix flymake-make-diagnostic for numeric code (bug#77856)
authorJoão Távora <joaotavora@gmail.com>
Wed, 23 Apr 2025 07:32:51 +0000 (08:32 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Apr 2025 07:49:12 +0000 (09:49 +0200)
* lisp/progmodes/flymake.el (flymake-make-diagnostic): Tighten up
type requirements.
(Version): Bump to 1.4.1

(cherry picked from commit a25fc9a518dc1c4bf1ef86bb949ed2f3c995adea)

lisp/progmodes/flymake.el

index 44f923d74a1255dbb37df668f3dc22b8e299aa8b..995a4dd4c0dffd1f79228d5267d4009858f78915 100644 (file)
@@ -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