From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#45539: 26.3; `add-to-ordered-list': Add optional arg for :test predicate for hash table Date: Wed, 30 Dec 2020 09:55:55 -0800 (PST) Message-ID: References: <1af7f2ac-0e6c-4c8a-860b-22148265d8aa@default> <87y2hgosxo.fsf@gnus.org> <64015d41-a84f-4ff6-a5a1-ab5d92aa20e5@default> <87k0szpyaj.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37267"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45539@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 30 18:57:25 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kufiv-0009Yg-4I for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Dec 2020 18:57:25 +0100 Original-Received: from localhost ([::1]:54778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kufit-0005mF-Qd for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Dec 2020 12:57:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kufiY-0005m5-Nn for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2020 12:57:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kufiY-0006yC-96 for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2020 12:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kufiY-0001pK-7J for bug-gnu-emacs@gnu.org; Wed, 30 Dec 2020 12:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Dec 2020 17:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45539 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 45539-submit@debbugs.gnu.org id=B45539.16093509696935 (code B ref 45539); Wed, 30 Dec 2020 17:57:02 +0000 Original-Received: (at 45539) by debbugs.gnu.org; 30 Dec 2020 17:56:09 +0000 Original-Received: from localhost ([127.0.0.1]:50935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kufhg-0001nl-LK for submit@debbugs.gnu.org; Wed, 30 Dec 2020 12:56:08 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:57316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kufhd-0001nB-3J for 45539@debbugs.gnu.org; Wed, 30 Dec 2020 12:56:07 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0BUHnPuB150314; Wed, 30 Dec 2020 17:55:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=Q/vd+EcPrUzPITQ/nRcE0cPlXLuVICI76d8PWFDP+U4=; b=zQTBNiekHNz0RnCATuXyyVqiKwQ4JaN3HFCAo2p9m9/s/eQ7qmBid//fey7OJvKBD4rj UjrlNA38t3kjzSZYbAUsVyPdmdgGr7BY6om3+iFRydIzJNnf9DeHr9ORMJjCPvgbq2Kj +VBYAywTxKT8x1jAQO0XsPTAcDsnDN2pf7CjDcW5o2FIjckSxGKr54rqIkYkQ6YYg6fs bU/s1brFEOuIRyC9nTh+5nGBsO1f3knVLbEcKCKOZQ6az7sRnKgVBxPDsSGYXdP0mnyW MIn9fpjQ48fhC01CvrMaw9cDyX2jSFJ1on0ly+NesCgpsypKAiaeoHcPSrlvhjAi/95y yA== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 35nvkqsc48-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 30 Dec 2020 17:55:58 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0BUHo1Kx009782; Wed, 30 Dec 2020 17:55:58 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 35pext23gu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Dec 2020 17:55:57 +0000 Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0BUHtu5a006599; Wed, 30 Dec 2020 17:55:56 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5095.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9850 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 spamscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012300111 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9850 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 adultscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012300111 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197043 Archived-At: Let me know if you want a separate bug for the following. The doc for this function does not, I think, convey what it's really about.= And part of the reason for that, I guess, is that it hasn't (until now) a= llowed for list-element comparisons other than `eq'. What this function is really about, I think, is this: a list with unique el= ements - no duplicates. With your fix of this bug, "unique" will be defined by the new TEST arg (pr= edicate). Until then, "unique" is defined by `eq'. This is important, as it means that this function is not only for adding an= element at a given list position. It's about having a list of unique elem= ents, and being able to not only add (or remove) but also _change the posit= ion_ of an existing element. That's not obvious from the current doc, but it seems to be the raison d'et= re for this. You have a list of 314,159 elements, and you want to change the value of th= e 2,067th element? Use this function to do that. Think of your Netflix DVD queue. You can add or remove elements, of course= . But more importantly, you can move the DVD that's currently at position = 147 to position 3. It's vital to understanding this function that users know that the list has= no duplicates. Otherwise, the repositioning makes no sense. And "no dupl= icates" depends on the meaning of "unique", i.e., the TEST-predicate option= al arg or `eq' by default.