bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#38072: when `byte-compile-file' finds out that a file is `no-byte-co


From: Stefan Kangas
Subject: bug#38072: when `byte-compile-file' finds out that a file is `no-byte-compile', it ignores `load' parameter
Date: Sat, 5 Sep 2020 00:30:38 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

tags 38072 + patch
thanks

Paul Pogonyshev <pogonyshev@gmail.com> writes:

> After (byte-compile-file "..." t) one normally expects that the file
> is loaded, all its functions and variables are visible etc.  However,
> if file contains local variable `no-byte-compile', not only
> compilation is cancelled, `byte-compile-file' also doesn't load the
> file.
>
> Expected: if `byte-compile-file' cancels byte-compilation and `load'
> is non-nil, it should load the uncompiled source instead.

The fix is pretty simple (see attached), but I'm not sure what the
correct behavior is here.

The doc string of `byte-compile-file' says:

    Compile a file of Lisp code named FILENAME into a file of byte code.
    The output file’s name is generated by passing FILENAME to the
    function ‘byte-compile-dest-file’ (which see).
    With prefix arg (noninteractively: 2nd arg), LOAD the file after compiling.
                                                               ^^^^^^^^^^^^^^^

So should we load the file if we did not compile the file?  I'm thinking
yes, and I don't see what it could hurt to change it to load the file.
If the user uses a prefix arg or the LOAD argument from Lisp, surely
that was the intention.

But on the other hand the text above seems deliberate, somehow?  (And
AFAICT the behavior has been not to load the file since pretty much
forever, possibly since byte-compilation was first added.)

Any other opinions here?

Best regards,
Stefan Kangas

Attachment: 0001-Ensure-byte-compile-file-loads-file-with-non-nil-loa.patch
Description: Text Data


reply via email to

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