]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/comp.el (comp--native-compile): Use `error-message-string`
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 4 Feb 2024 19:39:02 +0000 (14:39 -0500)
committerEshel Yaron <me@eshelyaron.com>
Wed, 7 Feb 2024 10:50:52 +0000 (11:50 +0100)
(cherry picked from commit b2d350cfc0bf8f0e3198bffcebe60a43341fb340)

lisp/emacs-lisp/comp.el

index 2a516246ed463bb8f6af87815f4737b4af0632e6..dcdc973e6c5bf196ddd445fd73938a56a45073b6 100644 (file)
@@ -3398,16 +3398,18 @@ the deferred compilation mechanism."
                    (if (and comp-async-compilation
                             (not (eq (car err) 'native-compiler-error)))
                        (progn
-                         (message (if err-val
-                                      "%s: Error: %s %s"
-                                    "%s: Error %s")
+                         (message "%s: Error %s"
                                   function-or-file
-                                  (get (car err) 'error-message)
-                                  (car-safe err-val))
+                                  (error-message-string err))
                          (kill-emacs -1))
                      ;; Otherwise re-signal it adding the compilation input.
+                     ;; FIXME: We can't just insert arbitrary info in the
+                     ;; error-data part of an error: the handler may expect
+                     ;; specific data at specific positions!
                     (signal (car err) (if (consp err-val)
                                           (cons function-or-file err-val)
+                                        ;; FIXME: `err-val' is supposed to be
+                                        ;; a list, so it can only be nil here!
                                         (list function-or-file err-val)))))))
               (if (stringp function-or-file)
                   data