emacs-devel
[Top][All Lists]
Advanced

[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: João Távora
Subject: Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths)
Date: Fri, 14 Dec 2018 13:09:23 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (windows-nt)

Stefan Monnier <address@hidden> writes:

> If it is in your load-history, then it also qualifies to be "trusted",
> even if it's not in your load-path.

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)))))))

Or do you want to write this in C for speed?  Where should this be
plugged into?  load in lread.c directly?

We should still hand load-path and load-history, or a part of
load-history down to the flymake'in slave emacs, right?

>>>> At least, the way I understand your solution for the "safe/unsafe" macro
>>>> problem it still doesn't seem to fix the fact that as soon as I type
>>>> "(launch-nuke)" into some already loaded macro in eglot.el, nukes are
>>>> potentially going to be launched by some unsuspecting macro-expansion
>>>> down below.
>>> Yup.  That's the problem with the use of trust as a proxy for safety.
>> Yup x 2.  With Flymake and macro expansions it's like you trust someone
> It's particularly serious when that someone is yourself, because
> when you mess up you can't even point fingers.

Because you probably just blew<M-DEL>chopp<M-DEL>... never mind...

João




reply via email to

[Prev in Thread] Current Thread [Next in Thread]