diff options
| author | João Távora | 2018-11-10 12:58:08 +0000 |
|---|---|---|
| committer | João Távora | 2018-12-04 23:34:36 +0000 |
| commit | 4ef97113b24045e87ee05acb48bb2befad84d47a (patch) | |
| tree | ac08b635ae6b793bff3b9ec4c4f8a53795478be1 | |
| parent | 12e922156c86a26fa4bb2cb9e7d2b3fd639e4707 (diff) | |
| download | emacs-scratch/allow-custom-load-paths-in-elisp-flymake.tar.gz emacs-scratch/allow-custom-load-paths-in-elisp-flymake.zip | |
Allow custom load paths in elisp's byte-compilation Flymakescratch/allow-custom-load-paths-in-elisp-flymake
* lisp/progmodes/elisp-mode.el
(elisp-flymake-byte-compile-load-path): New variable.
(elisp-flymake-byte-compile): Use new variable
| -rw-r--r-- | lisp/progmodes/elisp-mode.el | 25 |
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'. | ||
| 1674 | The default value contains just \"./\" which includes the default | ||
| 1675 | directory 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) |