# HG changeset patch # User Aidan Kehoe # Date 1210802113 -7200 # Node ID 34b42224a06634307fb9ea44c0d3805e0f859b7d # Parent 42fad34efb3f4dcf7cc389b6dffcba286f67503d Make the #'add-to-list implementation a little conciser and clearer for XEmacs 2008-05-14 Aidan Kehoe * 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 . diff -r 42fad34efb3f -r 34b42224a066 lisp/ChangeLog --- 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 + + * 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 * subr.el(add-to-list): add support for `compare-fn' to sync with diff -r 42fad34efb3f -r 34b42224a066 lisp/subr.el --- 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