[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/
From: |
Stefan Monnier |
Subject: |
Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths) |
Date: |
Fri, 14 Dec 2018 08:27:12 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> Oh, I didn't know about load-history. So is this usable?
>
> (defun moderately-trusted-p (file)
> (catch 'done
> (let ((file (expand-file-name file))
> (lhist load-history)
> (lpath load-path)
> probe)
> (and
> (string-match "\\.elc?$" file)
^
\\'
> (while (setq probe (pop lhist))
> (when (and (car probe)
> (equal (file-name-sans-extension file)
> (file-name-sans-extension (car probe))))
> (throw 'done t)))
> (while (setq probe (pop lpath))
> (when (equal (file-name-as-directory
> (file-name-directory file))
> (file-name-as-directory probe))
> (throw 'done t)))))))
LGTM
> Or do you want to write this in C for speed? Where should this be
> plugged into? load in lread.c directly?
I don't understand the question. AFAIK this would only be used within
bytecomp.el when processing a `defmacro` in order to decide whether it
should be added to byte-compile-macro-environment or not.
> We should still hand load-path and load-history, or a part of
> load-history down to the flymake'in slave emacs, right?
Ah, right, we'd then need to pass the `car` of load-history entries to
the slave.
Stefan
- Re: [Emacs-diffs] scratch/allow-custom-load-paths-in-elisp-flymake 4ef9711: Allow custom load paths in elisp's byte-compilation Flymake, (continued)
- Re: [Emacs-diffs] scratch/allow-custom-load-paths-in-elisp-flymake 4ef9711: Allow custom load paths in elisp's byte-compilation Flymake, João Távora, 2018/12/05
- Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), João Távora, 2018/12/08
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), Stefan Monnier, 2018/12/08
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), João Távora, 2018/12/09
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), Stefan Monnier, 2018/12/09
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), João Távora, 2018/12/10
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), Stefan Monnier, 2018/12/11
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), João Távora, 2018/12/14
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), Stefan Monnier, 2018/12/14
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), João Távora, 2018/12/14
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths),
Stefan Monnier <=
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), João Távora, 2018/12/14
- Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths), Stefan Monnier, 2018/12/14
- Sandboxing (was: Safety of elisp-flymake-byte-compile), Stefan Monnier, 2018/12/11
- Re: Sandboxing, João Távora, 2018/12/13