aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/elisp-mode.el25
1 files changed, 18 insertions, 7 deletions
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 39df9efda2c..8c9b5d2c4ac 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1669,6 +1669,16 @@ Calls REPORT-FN directly."
1669(defvar-local elisp-flymake--byte-compile-process nil 1669(defvar-local elisp-flymake--byte-compile-process nil
1670 "Buffer-local process started for byte-compiling the buffer.") 1670 "Buffer-local process started for byte-compiling the buffer.")
1671 1671
1672(defvar elisp-flymake-byte-compile-load-path (list "./")
1673 "Like `load-path' but used by `elisp-flymake-byte-compile'.
1674The default value contains just \"./\" which includes the default
1675directory of the buffer being compiled, and nothing else.")
1676
1677(put 'elisp-flymake-byte-compile-load-path 'safe-local-variable
1678 (lambda (x) (and (listp x) (catch 'tag
1679 (dolist (path x t) (unless (stringp path)
1680 (throw 'tag nil)))))))
1681
1672;;;###autoload 1682;;;###autoload
1673(defun elisp-flymake-byte-compile (report-fn &rest _args) 1683(defun elisp-flymake-byte-compile (report-fn &rest _args)
1674 "A Flymake backend for elisp byte compilation. 1684 "A Flymake backend for elisp byte compilation.
@@ -1688,13 +1698,14 @@ current buffer state and calls REPORT-FN when done."
1688 (make-process 1698 (make-process
1689 :name "elisp-flymake-byte-compile" 1699 :name "elisp-flymake-byte-compile"
1690 :buffer output-buffer 1700 :buffer output-buffer
1691 :command (list (expand-file-name invocation-name invocation-directory) 1701 :command `(,(expand-file-name invocation-name invocation-directory)
1692 "-Q" 1702 "-Q"
1693 "--batch" 1703 "--batch"
1694 ;; "--eval" "(setq load-prefer-newer t)" ; for testing 1704 ;; "--eval" "(setq load-prefer-newer t)" ; for testing
1695 "-L" default-directory 1705 ,@(mapcan (lambda (path) (list "-L" path))
1696 "-f" "elisp-flymake--batch-compile-for-flymake" 1706 elisp-flymake-byte-compile-load-path)
1697 temp-file) 1707 "-f" "elisp-flymake--batch-compile-for-flymake"
1708 ,temp-file)
1698 :connection-type 'pipe 1709 :connection-type 'pipe
1699 :sentinel 1710 :sentinel
1700 (lambda (proc _event) 1711 (lambda (proc _event)