Skip to content

Commit

Permalink
Work around #318
Browse files Browse the repository at this point in the history
  • Loading branch information
leungbk committed May 25, 2023
1 parent 24e553c commit 9a691c7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
30 changes: 30 additions & 0 deletions overlays/bytecomp-revert.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index ac040799a22..42b733b0830 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3521,8 +3521,6 @@ byte-compile-form
(setq form (cons 'progn (cdr form)))
(setq handler #'byte-compile-progn))
((and (or sef (function-get (car form) 'important-return-value))
- ;; Don't warn for arguments to `ignore'.
- (not (eq byte-compile--for-effect 'for-effect-no-warn))
(byte-compile-warning-enabled-p
'ignored-return-value (car form)))
(byte-compile-warn-x
@@ -4464,8 +4462,11 @@ byte-compile-goto-if

(defun byte-compile-ignore (form)
(dolist (arg (cdr form))
- ;; Compile each argument for-effect but suppress unused-value warnings.
- (byte-compile-form arg 'for-effect-no-warn))
+ ;; Compile args for value (to avoid warnings about unused values),
+ ;; emit a discard after each, and trust the LAP peephole optimiser
+ ;; to annihilate useless ops.
+ (byte-compile-form arg)
+ (byte-compile-discard))
(byte-compile-form nil))

;; Return the list of items in CONDITION-PARAM that match PRED-LIST.
--
2.40.1

16 changes: 14 additions & 2 deletions overlays/emacs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,21 @@ let
tree-sitter-yaml
];

emacsGit = super.lib.makeOverridable (mkGitEmacs "emacs-git" ../repos/emacs/emacs-master.json) { withSQLite3 = true; withWebP = true; treeSitterPlugins = defaultTreeSitterPlugins; };
emacsGit = (super.lib.makeOverridable (mkGitEmacs "emacs-git" ../repos/emacs/emacs-master.json) { withSQLite3 = true; withWebP = true; treeSitterPlugins = defaultTreeSitterPlugins; }).overrideAttrs (
oa: {
patches = oa.patches ++ [
# XXX: #318
./bytecomp-revert.patch
]; }
);

emacsPgtk = super.lib.makeOverridable (mkGitEmacs "emacs-pgtk" ../repos/emacs/emacs-master.json) { withSQLite3 = true; withWebP = true; withPgtk = true; treeSitterPlugins = defaultTreeSitterPlugins; };
emacsPgtk = (super.lib.makeOverridable (mkGitEmacs "emacs-pgtk" ../repos/emacs/emacs-master.json) { withSQLite3 = true; withWebP = true; withPgtk = true; treeSitterPlugins = defaultTreeSitterPlugins; }).overrideAttrs (
oa: {
patches = oa.patches ++ [
# XXX: #318
./bytecomp-revert.patch
]; }
);

emacsUnstable = super.lib.makeOverridable (mkGitEmacs "emacs-unstable" ../repos/emacs/emacs-unstable.json) { withSQLite3 = true; withWebP = true; treeSitterPlugins = defaultTreeSitterPlugins; };

Expand Down

0 comments on commit 9a691c7

Please sign in to comment.