emacs-overlay/overlays/bytecomp-revert.patch
2024-03-29 13:18:19 -07:00

30 lines
1.3 KiB
Diff

diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 2b5eb34e571..8dbf431b52b 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3443,8 +3443,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))
(bytecomp--actually-important-return-value-p form)
(byte-compile-warning-enabled-p
'ignored-return-value (car form)))
@@ -4399,8 +4397,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.44.0