summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorVibhav Pant <vibhavp@gmail.com>2017-02-05 22:32:21 +0530
committerVibhav Pant <vibhavp@gmail.com>2017-02-05 22:32:21 +0530
commit2db473bda8be72cf3c1e4694d70ce48f60492b0e (patch)
tree2f7cc25e5ccbe797226c9d78e92c0cb161fadf07 /lisp/emacs-lisp/bytecomp.el
parent74a3423b0b92b80d84f6de62d1f2d61c21e4bd90 (diff)
downloademacs-2db473bda8be72cf3c1e4694d70ce48f60492b0e.tar.gz
emacs-2db473bda8be72cf3c1e4694d70ce48f60492b0e.tar.bz2
emacs-2db473bda8be72cf3c1e4694d70ce48f60492b0e.zip
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'.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el16
1 files changed, 5 insertions, 11 deletions
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: