From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 17 23:15:09 2016 Received: (at submit) by debbugs.gnu.org; 18 Feb 2016 04:15:09 +0000 Received: from localhost ([127.0.0.1]:60130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWFzd-0008BK-QP for submit@debbugs.gnu.org; Wed, 17 Feb 2016 23:15:09 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55130) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aWFzZ-0008AX-Ci for submit@debbugs.gnu.org; Wed, 17 Feb 2016 23:15:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWFzQ-0007mr-Cl for submit@debbugs.gnu.org; Wed, 17 Feb 2016 23:14:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_50,DATE_IN_PAST_12_24, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWFzQ-0007mm-9H for submit@debbugs.gnu.org; Wed, 17 Feb 2016 23:14:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWFzM-00083h-KE for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2016 23:14:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWFzI-0007lC-UO for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2016 23:14:48 -0500 Received: from nm5-vm9.bullet.mail.ir2.yahoo.com ([212.82.96.116]:46651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWFzI-0007kt-L3 for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2016 23:14:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1455768883; bh=MgknG472G0G1fn5NdrUKEETKmb+Y2ZLzE6DYKQ3+Hnc=; h=From:To:Subject:Date:From:Subject; b=Ah1aRxjuf3apv1t6x5tqFmVoMQWKtSJ6VmnOphsauYCtoojQPh6Mjnvc8d9pfdlYHX0DZCJJXNaHtEAUvbuHSOcWLX3+sC8rsT4dam+CFM0eSNocjn8P0xKb6Cp5tM5t4PnEKSUweUh6SHXysEOP+5eNs4HjWdGTB+3dLHKLaVTjCnTrVzFH/tV7zCZ06ueMmLY2GYVOsbsC9hDY2wHIKbCGNsii/F85+92Eip95mK2nU0Xkda6OHxVVFjkWjBLagVxMTDvV28Q1ghhiwwV+mpwMgcRYsa8/lu8ravCaJsLR6hUE71jMzKplnWu4Vm04eKiUaLq5NjklF5AmeROlvQ== Received: from [212.82.98.58] by nm5.bullet.mail.ir2.yahoo.com with NNFMP; 18 Feb 2016 04:14:43 -0000 Received: from [46.228.39.76] by tm11.bullet.mail.ir2.yahoo.com with NNFMP; 18 Feb 2016 04:14:43 -0000 Received: from [127.0.0.1] by smtp113.mail.ir2.yahoo.com with NNFMP; 18 Feb 2016 04:14:43 -0000 X-Yahoo-Newman-Id: 655332.89988.bm@smtp113.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: mNaRFcUVM1mNgNnCzcBetJ7OqQ5B7AYSkx1bp3nX6_LTLHX gEvHBY9XnHjP.gWif9RR_S1fvQckQmB5ExU.kyAi_gW94otdGy_IDJb7t_5B PLMfmBfG27e5DiQSsIuVxeq4VshL_bpXrK5V72q70I1Iw3uf0osFtjFkojHw 8gpQdHrTaxq4BcV.gWAklC.TbMIVe3FmURhUZAYOs_awLwX2jgBj8QbHcSfS vnmabl0JvJ3ORzQf_LcDuOk67NuYFm.PMvbbY2.QAxpGhPZfYCS_cED7wg36 gnykVO2Dv4Ai3v.rV.5.u8G_ZBhgkCLrYAoIUH1gIkfzHKdSXKZHptc7aqZf 2mw6KaT2JIJOjVwf9mLO.zEQJnZ5AOMiCU8rq5REFUrJL4Zlvx9BymMzuJ9T MkPDzvKMMEyQia5V8uklf9t39hF1oJTfaH6wWqejolARAL49xUH08ApCVxQa uCGBOY7RW2c5Qlv6O98SPL..i0QJOL9IoUxI5FgPvWpIXi273fT4Yz5XoXJI KJS6_SgeqURrPhciTqzasUrJ7tpc_mZJU0ccEW7OIf9SQ8paT_D57eyQPLLW AQCsV6LWk2iO037HV X-Yahoo-SMTP: 62rWct2swBAqKO_y6KiyXe3pZRcxSSoYuFEwRLrH6M41hw-- User-agent: mu4e 0.9.17; emacs 25.0.50.2 From: Nicolas Richard To: bug-gnu-emacs@gnu.org Subject: 25.0.50; cl-union ignores :test when lists are equal Date: Wed, 17 Feb 2016 09:50:17 +0100 Message-ID: <86oabf67qu.fsf@ulb.ac.be> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.2 (----) --=-=-= Content-Type: text/plain Evaluating (cl-union (list "foo") (list "foo") :test 'eql) returns ("foo") but should return ("foo" "foo") instead. I suggest the following patch. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-cl-union-should-not-ignore-test-argument-when-lists-.patch >From bece6982ebb9cfc145d45d1c11379133717c947b Mon Sep 17 00:00:00 2001 From: Nicolas Richard Date: Wed, 17 Feb 2016 09:08:03 +0100 Subject: [PATCH] cl-union should not ignore :test argument when lists are equal * cl-seq.el (cl-union): Do not ignore :test argument when lists are equal. * test/automated/cl-seq-tests.el: New file. --- lisp/emacs-lisp/cl-seq.el | 2 +- test/automated/cl-seq-tests.el | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 test/automated/cl-seq-tests.el diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index 61ee569..21aec6c 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el @@ -774,7 +774,7 @@ cl-union \nKeywords supported: :test :test-not :key \n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) - ((equal cl-list1 cl-list2) cl-list1) + ((and (not cl-keys) (equal cl-list1 cl-list2)) cl-list1) (t (or (>= (length cl-list1) (length cl-list2)) (setq cl-list1 (prog1 cl-list2 (setq cl-list2 cl-list1)))) diff --git a/test/automated/cl-seq-tests.el b/test/automated/cl-seq-tests.el new file mode 100644 index 0000000..f8c8a43 --- /dev/null +++ b/test/automated/cl-seq-tests.el @@ -0,0 +1,38 @@ +;;; cl-seq-tests.el --- Tests for cl-seq.el functionality -*- lexical-binding: t; -*- + +;; Copyright (C) 2015-2016 Free Software Foundation, Inc. + +;; Author: Nicolas Richard + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(require 'ert) +(require 'cl-seq) + +(ert-deftest cl-union-test-00 () + (let ((str1 "foo") + (str2 "foo")) + (should (equal (cl-union (list str1) (list str2)) + (list str2))) + (should (equal (cl-union (list str1) (list str2) :test 'eql) + (list str1 str2))))) + +(provide 'cl-seq-tests) +;;; cl-seq-tests.el ends here -- 2.4.5 --=-=-= Content-Type: text/plain If ok to apply, on which branch ? In GNU Emacs 25.0.50.2 (i686-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2016-01-17 built on Aurora Repository revision: a0d5b7ae3bb014bb0b1c205d123c597df0e76411 Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: Ubuntu 15.10 Configured using: 'configure --with-x-toolkit=lucid --enable-checking --with-wide-int --cache-file=/tmp/emacs.config.cache 'CFLAGS= -O0 -g3'' --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 22 22:39:41 2016 Received: (at 22729) by debbugs.gnu.org; 23 Feb 2016 03:39:41 +0000 Received: from localhost ([127.0.0.1]:38735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aY3p7-0004A0-5W for submit@debbugs.gnu.org; Mon, 22 Feb 2016 22:39:41 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:60914) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aY3p5-00049q-5i for 22729@debbugs.gnu.org; Mon, 22 Feb 2016 22:39:40 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aY3oa-0007C4-56; Tue, 23 Feb 2016 04:39:08 +0100 From: Lars Ingebrigtsen To: Nicolas Richard Subject: Re: bug#22729: 25.0.50; cl-union ignores :test when lists are equal References: <86oabf67qu.fsf@ulb.ac.be> Date: Tue, 23 Feb 2016 14:39:02 +1100 In-Reply-To: <86oabf67qu.fsf@ulb.ac.be> (Nicolas Richard's message of "Wed, 17 Feb 2016 09:50:17 +0100") Message-ID: <87oab83xk9.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aY3oa-0007C4-56 X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1456803550.31167@6RVxcFDy8R++MM7ma65oBA X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 22729 Cc: 22729@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Nicolas Richard writes: > * cl-seq.el (cl-union): Do not ignore :test argument when lists are equal. Thanks; applied. > * test/automated/cl-seq-tests.el: New file. The test fails: (ert-test-failed ((should (equal (cl-union ... ... :test ...) (list str1 str2))) :form (equal ("foo") ("foo" "foo")) :value nil :explanation (proper-lists-of-different-length 1 2 ("foo") ("foo" "foo") first-mismatch-at 1))) And that's because the two "foo" strings are eql here. Apparently the Emacs reader is being clever... I've fixed that by using non-literal strings and applied. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 22 22:39:45 2016 Received: (at control) by debbugs.gnu.org; 23 Feb 2016 03:39:45 +0000 Received: from localhost ([127.0.0.1]:38738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aY3pB-0004AG-C1 for submit@debbugs.gnu.org; Mon, 22 Feb 2016 22:39:45 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:60920) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aY3p9-0004A9-Uz for control@debbugs.gnu.org; Mon, 22 Feb 2016 22:39:44 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aY3oj-0007CK-RG for control@debbugs.gnu.org; Tue, 23 Feb 2016 04:39:18 +0100 Date: Tue, 23 Feb 2016 14:39:13 +1100 Message-Id: <87mvqs3xjy.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #22729 X-MailScanner-ID: 1aY3oj-0007CK-RG X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1456803558.68042@ro7Y6E2a3h4aIzSSFZ2rTQ X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tags 22729 fixed close 22729 25.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 23 12:29:04 2016 Received: (at 22729) by debbugs.gnu.org; 23 Feb 2016 17:29:04 +0000 Received: from localhost ([127.0.0.1]:41595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYGlh-0004xM-1J for submit@debbugs.gnu.org; Tue, 23 Feb 2016 12:29:04 -0500 Received: from mailrelay112.isp.belgacom.be ([195.238.20.139]:30576) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYGlc-0004x1-P3 for 22729@debbugs.gnu.org; Tue, 23 Feb 2016 12:29:00 -0500 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BeCQB9lcxW/zmmsVtegzqBP6cMCgaBD4sciRaGBwQCAoFHPRABAQEBAQEBZCeEQgEBBFYjEAgDISUPASkeBhOIIb0IAQEBAQEFAgEdhUqFAohvBZcHnE+OSTcrg2U7Log1AQEB Received: from 57.166-177-91.adsl-dyn.isp.belgacom.be (HELO Aurora) ([91.177.166.57]) by relay.skynet.be with ESMTP; 23 Feb 2016 18:26:44 +0100 References: <86oabf67qu.fsf@ulb.ac.be> <87oab83xk9.fsf@gnus.org> User-agent: mu4e 0.9.17; emacs 25.0.50.2 From: Nicolas Richard To: Lars Ingebrigtsen Subject: Re: bug#22729: 25.0.50; cl-union ignores :test when lists are equal In-reply-to: <87oab83xk9.fsf@gnus.org> Date: Tue, 23 Feb 2016 18:26:43 +0100 Message-ID: <864mczl4mk.fsf@members.fsf.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 22729 Cc: 22729@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Lars Ingebrigtsen writes: > And that's because the two "foo" strings are eql here. Apparently the > Emacs reader is being clever... I'm surprised because it didn't fail for me. As a test, this: emacs --batch -Q --eval '(let ((str1 "foo") (str2 "foo")) (message "%S" (eql str1 str2)))' returns nil for me. Nicolas. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 23 20:04:02 2016 Received: (at 22729) by debbugs.gnu.org; 24 Feb 2016 01:04:02 +0000 Received: from localhost ([127.0.0.1]:41832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYNry-0002n7-MF for submit@debbugs.gnu.org; Tue, 23 Feb 2016 20:04:02 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:38959) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYNrt-0002mt-5g for 22729@debbugs.gnu.org; Tue, 23 Feb 2016 20:03:56 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aYNrT-0003FB-VU; Wed, 24 Feb 2016 02:03:28 +0100 From: Lars Ingebrigtsen To: Nicolas Richard Subject: Re: bug#22729: 25.0.50; cl-union ignores :test when lists are equal References: <86oabf67qu.fsf@ulb.ac.be> <87oab83xk9.fsf@gnus.org> <864mczl4mk.fsf@members.fsf.org> Date: Wed, 24 Feb 2016 12:03:24 +1100 In-Reply-To: <864mczl4mk.fsf@members.fsf.org> (Nicolas Richard's message of "Tue, 23 Feb 2016 18:26:43 +0100") Message-ID: <87fuwiq5r7.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aYNrT-0003FB-VU X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1456880609.03197@xdERHlEjrrfjs7Edy8+Gug X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 22729 Cc: 22729@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Nicolas Richard writes: > Lars Ingebrigtsen writes: >> And that's because the two "foo" strings are eql here. Apparently the >> Emacs reader is being clever... > > I'm surprised because it didn't fail for me. > > As a test, this: > emacs --batch -Q --eval '(let ((str1 "foo") (str2 "foo")) (message > "%S" (eql str1 str2)))' > returns nil for me. I was surprised, too, but in the ert test the two strings were definitely eql. Perhaps ert byte-compiles the functions, and the byte compiler is doing the clever string thing? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sat Aug 09 22:37:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 23 Mar 2016 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator