GNU bug report logs - #67920
30.0.50; "*Compile-Log" is not `compilation-mode' if `byte-compile-file' found "no lexical-binding"

Previous Next

Package: emacs;

Reported by: OGAWA Hirofumi <hirofumi <at> mail.parknet.co.jp>

Date: Wed, 20 Dec 2023 06:44:01 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #8 received at 67920 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: OGAWA Hirofumi <hirofumi <at> mail.parknet.co.jp>,
 Mattias Engdegård <mattiase <at> acm.org>
Cc: 67920 <at> debbugs.gnu.org
Subject: Re: bug#67920: 30.0.50;
 "*Compile-Log" is not `compilation-mode' if `byte-compile-file' found
 "no lexical-binding"
Date: Thu, 21 Dec 2023 15:07:15 +0200
> From: OGAWA Hirofumi <hirofumi <at> mail.parknet.co.jp>
> Date: Wed, 20 Dec 2023 15:43:25 +0900
> 
> 
> `byte-compile-file' in current master branch behaves strange if the file
> is not including "-*- lexical-binding: t; -*-" mark.
> 
> (progn
>   (with-temp-file "foo.el" ())
>   (byte-compile-file "foo.el"))
> 
> The above code outputs to "*Compile-Log" with `special-mode' like following
> 
> 	In toplevel form:
> 	foo.el:1:1: Warning: file has no ‘lexical-binding’ directive on its first
> 	    line
> 
> If there is "-*- lexical-binding: t; -*-" mark in the file,
> "*Compile-Log*" is with `compilation-mode' as expected.

Mattias, this seems to be due to your change in commit a3db503351e:
the call to byte-compile-warn-x you added there logs a warning too
early, which has two adverse effects: (a) the compilation directory is
not logged as the directory of the file being compiled (Emacs thinks
it's the original directory where Emacs was started), and (b) the
value of byte-compile-last-logged-file is set to the name of the file
being compiled, which then defeats the logic in byte-compile-log-file
of turning on emacs-lisp-compilation-mode in the log buffer.

Could you please look into this?




This bug report was last modified 1 year and 232 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.