-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emacs30: add a patch to fix upstream bug 67916
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67916 (cherry picked from commit 1898307)
- Loading branch information
1 parent
a4f9170
commit 95f75b5
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
pkgs/applications/editors/emacs/inhibit-lexical-cookie-warning-67916-30.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From: Lin Jian <[email protected]> | ||
Bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67916 | ||
|
||
Inhibit lexical cookie warning for *-pkg.el files (bug#67916) | ||
|
||
Users may use byte-compile-error-on-warn to turn compilation warnings | ||
into errors to make sure their Emacs lisp packages are warning-free. | ||
Emacs bug 67916 makes that difficult because the Emacs-generated file | ||
*-pkg.el emits a compilation warning about missing lexical cookie. | ||
|
||
There is an upstream patch to fix this. That patch makes Emacs also | ||
generate the needed lexical cookie when generating *-pkg.el files. | ||
However, that patch has stalled. | ||
|
||
This patch takes an easier but less accurate approach by inhibiting | ||
lexical cookie warning for *-pkg.el files. Given that not all | ||
*-pkg.el files are generated by Emacs, to reduce impact, this patch | ||
also checks no-byte-compile. | ||
|
||
--- a/lisp/emacs-lisp/bytecomp.el | ||
+++ b/lisp/emacs-lisp/bytecomp.el | ||
@@ -2266,6 +2266,8 @@ See also `emacs-lisp-byte-compile-and-load'." | ||
filename buffer-file-name)) | ||
;; Don't inherit lexical-binding from caller (bug#12938). | ||
(unless (or (local-variable-p 'lexical-binding) | ||
+ (and (string-suffix-p "-pkg.el" filename) | ||
+ (with-current-buffer input-buffer no-byte-compile)) | ||
bytecomp--inhibit-lexical-cookie-warning) | ||
(let ((byte-compile-current-buffer (current-buffer))) | ||
(displaying-byte-compile-warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters