# HG changeset patch # User Aidan Kehoe # Date 1434035351 -3600 # Node ID ffb5abc8dc4e37878272e66a6b39c928ba03d89c # Parent 1152e0091f8c5bd799917f50d4254efeff2a55c8 Fix a bug in the #'equalp compiler macro. lisp/ChangeLog addition: 2015-06-11 Aidan Kehoe * cl-macs.el (equalp): Fix a bug in this compiler macro when passed constants in a certain order. tests/ChangeLog addition: 2015-06-11 Aidan Kehoe * automated/lisp-tests.el: Add a test looking for a bug just fixed in the equalp compiler macro. diff -r 1152e0091f8c -r ffb5abc8dc4e lisp/ChangeLog --- a/lisp/ChangeLog Wed Jun 03 20:13:07 2015 +0100 +++ b/lisp/ChangeLog Thu Jun 11 16:09:11 2015 +0100 @@ -1,3 +1,9 @@ +2015-06-11 Aidan Kehoe + + * cl-macs.el (equalp): + Fix a bug in this compiler macro when passed constants in a + certain order. + 2015-06-03 Aidan Kehoe * code-files.el (load): diff -r 1152e0091f8c -r ffb5abc8dc4e lisp/cl-macs.el --- a/lisp/cl-macs.el Wed Jun 03 20:13:07 2015 +0100 +++ b/lisp/cl-macs.el Thu Jun 11 16:09:11 2015 +0100 @@ -3722,8 +3722,7 @@ ;; zero-length. (cond ((member x '("" #* [])) - ;; No need to protect against multiple evaluation here: - `(and (member ,original-y '("" #* [])) t)) + `(and (member ,(find x (cdr form) :test-not #'eq) '("" #* [])) t)) (t form))) ((unordered-check (and (numberp x) (not (cl-const-expr-p y)))) `(,@let-form diff -r 1152e0091f8c -r ffb5abc8dc4e tests/ChangeLog --- a/tests/ChangeLog Wed Jun 03 20:13:07 2015 +0100 +++ b/tests/ChangeLog Thu Jun 11 16:09:11 2015 +0100 @@ -1,3 +1,9 @@ +2015-06-11 Aidan Kehoe + + * automated/lisp-tests.el: + Add a test looking for a bug just fixed in the equalp compiler + macro. + 2015-06-03 Aidan Kehoe * automated/file-tests.el: diff -r 1152e0091f8c -r ffb5abc8dc4e tests/automated/lisp-tests.el --- a/tests/automated/lisp-tests.el Wed Jun 03 20:13:07 2015 +0100 +++ b/tests/automated/lisp-tests.el Thu Jun 11 16:09:11 2015 +0100 @@ -2390,6 +2390,8 @@ (Assert-equalp "hi there" "Hi There" "checking equalp isn't case-sensitive") + (Assert (not (equalp (emacs-version) #*)) + "checking a bug with constants and equalp is fixed.") (Assert-equalp 99 99.0 "checking equalp compares numerical values of different types")