From: Vibhav Pant Date: Sun, 5 Feb 2017 17:02:21 +0000 (+0530) Subject: bytecomp.el: Use macroexp-const-p instead of bc-cond-valid-obj2-p. X-Git-Tag: emacs-26.0.90~859 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2db473bda8be72cf3c1e4694d70ce48f60492b0e;p=emacs.git bytecomp.el: Use macroexp-const-p instead of bc-cond-valid-obj2-p. * lisp/emacs-lisp/bytecomp.el (byte-compile-cond-vars): Use (macroexp-cons-p) instead of (byte-compile-cond-valid-obj2-p) to make sure that obj1/obj2 can be compared with `eq'. --- diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index bddf04af678..5aef82691c6 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -4001,19 +4001,13 @@ that suppresses all warnings during execution of BODY." (byte-compile-out-tag donetag)))) (setq byte-compile--for-effect nil)) -(defun byte-compile-cond-valid-obj2-p (obj) - (cond - ((consp obj) - (and (eq (car obj) 'quote) - (= (length obj) 2) - (symbolp (cadr obj)))) - ((symbolp obj) (keywordp obj)) - (t t))) - (defun byte-compile-cond-vars (obj1 obj2) + ;; We make sure that of OBJ1 and OBJ2, one of them is a symbol, + ;; and the other is a constant expression whose value can be + ;; compared with `eq' (with `macroexp-const-p'). (or - (and (symbolp obj1) (byte-compile-cond-valid-obj2-p obj2) (cons obj1 obj2)) - (and (symbolp obj2) (byte-compile-cond-valid-obj2-p obj1) (cons obj2 obj1)))) + (and (symbolp obj1) (macroexp-const-p obj2) (cons obj1 obj2)) + (and (symbolp obj2) (macroexp-const-p obj1) (cons obj2 obj1)))) (defun byte-compile-cond-jump-table-info (clauses) "If CLAUSES is a `cond' form where: