aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Baugh2025-09-04 10:36:17 -0400
committerEli Zaretskii2025-09-06 18:33:32 +0300
commit2a1f9f8dfee82aa08d544ec776e11025642eb4a8 (patch)
tree7427acc3e5f9e5123e72ced61564a8cfedf462b4
parent72401548ca7e93ac816534ba4837b09fc439f0c0 (diff)
downloademacs-2a1f9f8dfee82aa08d544ec776e11025642eb4a8.tar.gz
emacs-2a1f9f8dfee82aa08d544ec776e11025642eb4a8.zip
Fix nil value of 'elisp-flymake-byte-compile-executable'
* lisp/progmodes/elisp-mode.el (elisp-flymake-byte-compile--executable): Properly check for nil, and simplify code. (Bug#79380)
-rw-r--r--lisp/progmodes/elisp-mode.el31
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index aebc93d1ddb..42653069feb 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -2301,20 +2301,23 @@ variables `invocation-name' and `invocation-directory'."
2301(declare-function project-root "project" (project)) 2301(declare-function project-root "project" (project))
2302(defun elisp-flymake-byte-compile--executable () 2302(defun elisp-flymake-byte-compile--executable ()
2303 "Return absolute file name of the Emacs executable for flymake byte-compilation." 2303 "Return absolute file name of the Emacs executable for flymake byte-compilation."
2304 (let ((filename 2304 (cond
2305 (cond 2305 ((null elisp-flymake-byte-compile-executable)
2306 ((file-name-absolute-p elisp-flymake-byte-compile-executable) 2306 (expand-file-name invocation-name invocation-directory))
2307 elisp-flymake-byte-compile-executable) 2307 ((not (stringp elisp-flymake-byte-compile-executable))
2308 ((stringp elisp-flymake-byte-compile-executable) 2308 (error "Invalid `elisp-flymake-byte-compile-executable': %s"
2309 (when-let* ((pr (project-current))) 2309 elisp-flymake-byte-compile-executable))
2310 (file-name-concat (project-root pr) 2310 ((file-name-absolute-p elisp-flymake-byte-compile-executable)
2311 elisp-flymake-byte-compile-executable)))))) 2311 elisp-flymake-byte-compile-executable)
2312 (if (file-executable-p filename) 2312 (t ; relative file name
2313 filename 2313 (let ((filename (file-name-concat (project-root (project-current))
2314 (when elisp-flymake-byte-compile-executable 2314 elisp-flymake-byte-compile-executable)))
2315 (message "No such `elisp-flymake-byte-compile-executable': %s" 2315 (if (file-executable-p filename)
2316 filename)) 2316 filename
2317 (expand-file-name invocation-name invocation-directory)))) 2317 ;; The user might not have built Emacs yet, so just fall back.
2318 (message "`elisp-flymake-byte-compile-executable' (%s) doesn't exist"
2319 elisp-flymake-byte-compile-executable)
2320 (expand-file-name invocation-name invocation-directory))))))
2318 2321
2319;;;###autoload 2322;;;###autoload
2320(defun elisp-flymake-byte-compile (report-fn &rest _args) 2323(defun elisp-flymake-byte-compile (report-fn &rest _args)