]> git.eshelyaron.com Git - emacs.git/commitdiff
Switch add-to-ordered-list to eql
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 30 Dec 2020 03:48:13 +0000 (04:48 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 30 Dec 2020 03:48:13 +0000 (04:48 +0100)
* doc/lispref/lists.texi (List Variables): Update documentation.

* lisp/subr.el (add-to-ordered-list): Switch to eql (bug#45539).

doc/lispref/lists.texi
etc/NEWS
lisp/subr.el

index ae793d5e15efb19cdbe18b94426a67dd2bd44a17..2e5b193d840651e1d83bb1119676a2c8db578b05 100644 (file)
@@ -812,7 +812,7 @@ This function sets the variable @var{symbol} by inserting
 @var{element} into the old value, which must be a list, at the
 position specified by @var{order}.  If @var{element} is already a
 member of the list, its position in the list is adjusted according
-to @var{order}.  Membership is tested using @code{eq}.
+to @var{order}.  Membership is tested using @code{eql}.
 This function returns the resulting list, whether updated or not.
 
 The @var{order} is typically a number (integer or float), and the
index 0231c16711243f4a034f875b85a6979895b0b5e2..e4189998340fa51e0dc84ceff3dc45b1ede421e5 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1861,6 +1861,8 @@ directory instead of the default directory.
 \f
 * Incompatible Lisp Changes in Emacs 28.1
 
+** 'add-to-ordered-list' now uses 'eql' instead of 'eq'.
+
 ** 'set-process-buffer' now updates the process mark.
 The mark will be set to point to the end of the new buffer.
 
index 384dbb25cf88a2ac780fd17c9c0e015989c9ec32..b3f00cc1782fb443487b780db53d808e4c5e1955 100644 (file)
@@ -1973,7 +1973,7 @@ can do the job."
 
 (defun add-to-ordered-list (list-var element &optional order)
   "Add ELEMENT to the value of LIST-VAR if it isn't there yet.
-The test for presence of ELEMENT is done with `eq'.
+The test for presence of ELEMENT is done with `eql'.
 
 The resulting list is reordered so that the elements are in the
 order given by each element's numeric list order.  Elements
@@ -1993,7 +1993,7 @@ The return value is the new value of LIST-VAR."
   (let ((ordering (get list-var 'list-order)))
     (unless ordering
       (put list-var 'list-order
-           (setq ordering (make-hash-table :weakness 'key :test 'eq))))
+           (setq ordering (make-hash-table :weakness 'key))))
     (when order
       (puthash element (and (numberp order) order) ordering))
     (unless (memq element (symbol-value list-var))