From 3ffe6058df9741b77870f5b06f28384e0d6923b6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 17 Jul 2025 12:36:16 -0400 Subject: [PATCH] comp.el: Fix minor corner-case annoyances * lisp/emacs-lisp/comp.el (comp--native-compile): Avoid `%s` on objects that may not have names. * src/data.c (Ffset): Don't compute trampoline for no-op `fset`. (cherry picked from commit f8b9d80ec6831671466000ba6dc0300a1577db0a) --- lisp/emacs-lisp/comp.el | 6 +++--- src/data.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index aa6bfbf0e6a..d72a926f93f 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -3561,7 +3561,7 @@ the deferred compilation mechanism." for pass in comp-passes unless (memq pass comp-disabled-passes) do - (comp-log (format "\n(%s) Running pass %s:\n" + (comp-log (format "\n(%S) Running pass %s:\n" function-or-file pass) 2) (setf data (funcall pass data)) @@ -3570,7 +3570,7 @@ the deferred compilation mechanism." do (funcall f data)) finally (when comp-log-time-report - (comp-log (format "Done compiling %s" data) 0) + (comp-log (format "Done compiling %S" data) 0) (cl-loop for (pass . time) in (reverse report) do (comp-log (format "Pass %s took: %fs." pass time) @@ -3582,7 +3582,7 @@ the deferred compilation mechanism." (if (and comp-async-compilation (not (eq (car err) 'native-compiler-error))) (progn - (message "%s: Error %s" + (message "%S: Error %s" function-or-file (error-message-string err)) (kill-emacs -1)) diff --git a/src/data.c b/src/data.c index 5d1c065e785..493a8dd63fc 100644 --- a/src/data.c +++ b/src/data.c @@ -904,8 +904,9 @@ signal a `cyclic-function-indirection' error. */) if (!NILP (Vnative_comp_enable_subr_trampolines) && SUBRP (function) - && !NATIVE_COMP_FUNCTIONP (function)) - calln (Qcomp_subr_trampoline_install, symbol); + && !NATIVE_COMP_FUNCTIONP (function) + && !EQ (definition, Fsymbol_function (symbol))) + calln (Qcomp_subr_trampoline_install, symbol); #endif set_symbol_function (symbol, definition); -- 2.39.5