unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths)
Date: Fri, 14 Dec 2018 13:38:39 +0000	[thread overview]
Message-ID: <jjbtvjg5iu8.fsf@gmail.com> (raw)
In-Reply-To: <jwv1s6kp7if.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 14 Dec 2018 08:27:12 -0500")

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

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

Oh, right... of course, never mind.  Can you do that bit?  I suppose we
have to check some new var byte-compile-just-checking-p and
(moderately-trusted-p byte-compile-current-file), right?

Is it in `byte-compile-file-form-defalias'

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

And not the load-path?

João



  reply	other threads:[~2018-12-14 13:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181204233600.7907.75252@vcs0.savannah.gnu.org>
     [not found] ` <20181204233601.273DD209DC@vcs0.savannah.gnu.org>
2018-12-05  4:34   ` [Emacs-diffs] scratch/allow-custom-load-paths-in-elisp-flymake 4ef9711: Allow custom load paths in elisp's byte-compilation Flymake Stefan Monnier
2018-12-05 15:14     ` João Távora
2018-12-05 20:00     ` Glenn Morris
2018-12-05 20:40       ` João Távora
2018-12-08 13:23         ` Safety of elisp-flymake-byte-compile (Was Re: [Emacs-diffs] scratch/allow-custom-load-paths) João Távora
2018-12-08 15:36           ` Stefan Monnier
2018-12-10  0:20             ` João Távora
2018-12-10  2:22               ` Stefan Monnier
2018-12-10 23:17                 ` João Távora
2018-12-11 14:03                   ` Stefan Monnier
2018-12-14 12:00                     ` João Távora
2018-12-14 12:15                       ` Stefan Monnier
2018-12-14 13:09                         ` João Távora
2018-12-14 13:27                           ` Stefan Monnier
2018-12-14 13:38                             ` João Távora [this message]
2018-12-14 14:13                               ` Stefan Monnier
2018-12-11 19:30                   ` Sandboxing (was: Safety of elisp-flymake-byte-compile) Stefan Monnier
2018-12-14  1:35                     ` Sandboxing João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jjbtvjg5iu8.fsf@gmail.com \
    --to=joaotavora@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).