Mercurial > hg > xemacs-beta
changeset 4462:34b42224a066
Make the #'add-to-list implementation a little conciser and clearer for XEmacs
2008-05-14 Aidan Kehoe <kehoea@parhasard.net>
* subr.el (add-to-list): Implement the same logic with a more
concise syntax; thank you Stephen, in
http://mid.gmane.org/87ablomdwx.fsf@uwakimon.sk.tsukuba.ac.jp .
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Wed, 14 May 2008 23:55:13 +0200 |
parents | 42fad34efb3f |
children | 5c651a4e8ed3 |
files | lisp/ChangeLog lisp/subr.el |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed May 14 23:47:58 2008 +0200 +++ b/lisp/ChangeLog Wed May 14 23:55:13 2008 +0200 @@ -1,3 +1,9 @@ +2008-05-14 Aidan Kehoe <kehoea@parhasard.net> + + * subr.el (add-to-list): Implement the same logic with a more + concise syntax; thank you Stephen, in + http://mid.gmane.org/87ablomdwx.fsf@uwakimon.sk.tsukuba.ac.jp . + 2008-02-25 bpalmer <bpalmer@gmail.com> * subr.el(add-to-list): add support for `compare-fn' to sync with
--- a/lisp/subr.el Wed May 14 23:47:58 2008 +0200 +++ b/lisp/subr.el Wed May 14 23:55:13 2008 +0200 @@ -402,9 +402,8 @@ into a hook function that will be run only after loading the package. `eval-after-load' provides one way to do this. In some cases other hooks, such as major mode hooks, can do the job." - (if (if (not compare-fn) - (member element (symbol-value list-var)) - (member* element (symbol-value list-var) :test compare-fn)) + (if (member* (member* element (symbol-value list-var) + :test (or compare-fn #'equal))) (symbol-value list-var) (set list-var (if append