From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 09:00:49 2022 Received: (at submit) by debbugs.gnu.org; 3 Sep 2022 13:00:49 +0000 Received: from localhost ([127.0.0.1]:41171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUSlV-000074-1J for submit@debbugs.gnu.org; Sat, 03 Sep 2022 09:00:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:39956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUSlT-00006u-Ae for submit@debbugs.gnu.org; Sat, 03 Sep 2022 09:00:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUSlT-0002Kf-5I for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2022 09:00:47 -0400 Received: from mail.choca.pics ([2001:910:1410:500::1]:34722) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUSlR-0002OO-8m for bug-gnu-emacs@gnu.org; Sat, 03 Sep 2022 09:00:46 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 95D4E181942B2 for ; Sat, 3 Sep 2022 15:00:40 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id H1JWJG8L57me for ; Sat, 3 Sep 2022 15:00:40 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 03FDA181942BF for ; Sat, 3 Sep 2022 15:00:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id PeISs30aCHy0 for ; Sat, 3 Sep 2022 15:00:39 +0200 (CEST) Received: from localhost (153.226.95.79.rev.sfr.net [79.95.226.153]) by mail.choca.pics (Postfix) with ESMTPSA id B0046181942B2 for ; Sat, 3 Sep 2022 15:00:39 +0200 (CEST) From: Damien Cassou To: bug-gnu-emacs@gnu.org Subject: Improve documentation of seq-position Date: Sat, 03 Sep 2022 15:00:38 +0200 Message-ID: <87mtbgfw95.fsf@cassou.me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2001:910:1410:500::1; envelope-from=damien@cassou.me; helo=mail.choca.pics X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) 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: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch Fix documentation of `seq-position' according to Eli Zaretskii's recommendation. -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Improve-documentation-of-seq-position.patch >From 093cb247148a965e5cd80056eff38d3ef6f288bb Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 3 Sep 2022 14:56:53 +0200 Subject: [PATCH] Improve documentation of seq-position * doc/lispref/sequences.texi (Sequence Functions): * lisp/emacs-lisp/seq.el (seq-position): Use more standard wording in the documentation of `seq-position'. --- doc/lispref/sequences.texi | 2 +- lisp/emacs-lisp/seq.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 1f6f80521c..cc956952d6 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -863,7 +863,7 @@ Sequence Functions @end defun @defun seq-position sequence elt &optional function - This function returns the index of the first element in + This function returns the (zero-based) index of the first element in @var{sequence} that is equal to @var{elt}. If the optional argument @var{function} is non-@code{nil}, it is a function of two arguments to use instead of the default @code{equal}. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index b6f0f66e5b..a121256146 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -435,8 +435,8 @@ seq-set-equal-p ;;;###autoload (cl-defgeneric seq-position (sequence elt &optional testfn) - "Return the index of the first element in SEQUENCE that is equal to ELT. -Equality is defined by TESTFN if non-nil or by `equal' if nil." + "Return the (zero-based) index of the first element in SEQUENCE that is equal to ELT. +Equality is defined by the function TESTFN, which defaults to `equal'." (let ((index 0)) (catch 'seq--break (seq-doseq (e sequence) -- 2.36.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 09:30:55 2022 Received: (at 57561) by debbugs.gnu.org; 3 Sep 2022 13:30:55 +0000 Received: from localhost ([127.0.0.1]:41207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUTEd-00030y-Gz for submit@debbugs.gnu.org; Sat, 03 Sep 2022 09:30:55 -0400 Received: from quimby.gnus.org ([95.216.78.240]:47418) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUTEb-00030j-Az for 57561@debbugs.gnu.org; Sat, 03 Sep 2022 09:30:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=NGKAGUUZOieZijkARYM1byuSFJrWJei/1jUqVNSh7rc=; b=N78c+xU9CI7sBLPZwdoEqfsjM3 P00GJHljBQhx/pBHkVhVapKcbNdOCsQHquiv5ATgTfLC0fE7/Ejdwx21S6bjL85mrEvlRoFyLRH0b Wo/ErYwCuGxQlt7Mi8/AYdmNMk7V30IefixKKNLl2N+eAQwYym45BxzwFrwmdibmWmvc=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUTES-0007zl-5I; Sat, 03 Sep 2022 15:30:46 +0200 From: Lars Ingebrigtsen To: Damien Cassou Subject: Re: bug#57561: Improve documentation of seq-position In-Reply-To: <87mtbgfw95.fsf@cassou.me> (Damien Cassou's message of "Sat, 03 Sep 2022 15:00:38 +0200") References: <87mtbgfw95.fsf@cassou.me> X-Now-Playing: The Cure's _Pornography (1)_: "One Hundred Years" Date: Sat, 03 Sep 2022 15:30:40 +0200 Message-ID: <87r10sbn5r.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Damien Cassou writes: > - "Return the index of the first element in SEQUENCE that is equal to ELT. > -Equality is defined by TESTFN if non-nil or by `equal' if nil." > + "Return the (zero-based) index of the first element [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57561 Cc: 57561@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: -3.3 (---) Damien Cassou writes: > - "Return the index of the first element in SEQUENCE that is equal to ELT. > -Equality is defined by TESTFN if non-nil or by `equal' if nil." > + "Return the (zero-based) index of the first element in SEQUENCE that is equal to ELT. This makes the first line too long. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 10:24:34 2022 Received: (at 57561) by debbugs.gnu.org; 3 Sep 2022 14:24:34 +0000 Received: from localhost ([127.0.0.1]:42566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUU4Y-0004hy-5L for submit@debbugs.gnu.org; Sat, 03 Sep 2022 10:24:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUU4W-0004hk-RO for 57561@debbugs.gnu.org; Sat, 03 Sep 2022 10:24:33 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUU4Q-0004UL-BR; Sat, 03 Sep 2022 10:24:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=EhzvCzaebdYRjTajBzBvY3yuLSq7GF2igK4xw2GDTjI=; b=jwf07MdmGY1g bMWLZk9npAvrNm01Mz4aTqJsjKCsiAfmEWgEszNhcd6c6MXXd/swkLUq255lB9Nh1Tpo21/wcRf5l czQERn4bWLAMdR+1KTv9kQJzKgZElEWentk6+FW9YGzx8rl4za2NIbqUIGvkAgVZjyI4Vn5ljyK7E zPoJjrXtYgq2mMJ90RQ6rqJe7mpLr+9ZwNgsrTItTL8wNjUbIS8nvOEity1NYGfQx8rwBrj/M5TZY bDZ2Dl9/J7wiYYkrLfYJ8yuRtsR4zCdiahgvxwSywwgsUIXLMzs2IiskLe4OfNRr4eCbpYP+OtUYU Wd35j0S8f9k66JF4bveL6A==; Received: from [87.69.77.57] (port=4158 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUU4P-00085h-Ll; Sat, 03 Sep 2022 10:24:26 -0400 Date: Sat, 03 Sep 2022 17:23:58 +0300 Message-Id: <834jxoo7sx.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <87r10sbn5r.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 03 Sep 2022 15:30:40 +0200) Subject: Re: bug#57561: Improve documentation of seq-position References: <87mtbgfw95.fsf@cassou.me> <87r10sbn5r.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57561 Cc: damien@cassou.me, 57561@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: -3.3 (---) > Cc: 57561@debbugs.gnu.org > From: Lars Ingebrigtsen > Date: Sat, 03 Sep 2022 15:30:40 +0200 > > Damien Cassou writes: > > > - "Return the index of the first element in SEQUENCE that is equal to ELT. > > -Equality is defined by TESTFN if non-nil or by `equal' if nil." > > + "Return the (zero-based) index of the first element in SEQUENCE that is equal to ELT. > > This makes the first line too long. Yes. The usual fix would be Return the (zero-based) index of the first element in SEQUENCE equal to ELT. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 12:53:01 2022 Received: (at 57561) by debbugs.gnu.org; 3 Sep 2022 16:53:01 +0000 Received: from localhost ([127.0.0.1]:42815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUWOD-0004Vt-5I for submit@debbugs.gnu.org; Sat, 03 Sep 2022 12:53:01 -0400 Received: from mail.choca.pics ([80.67.172.235]:47648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUWOA-0004Vh-SP for 57561@debbugs.gnu.org; Sat, 03 Sep 2022 12:52:59 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 8B5E5181942A0; Sat, 3 Sep 2022 18:52:56 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id mNpULBKgv3EI; Sat, 3 Sep 2022 18:52:55 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 9FEB5181942A3; Sat, 3 Sep 2022 18:52:55 +0200 (CEST) X-Virus-Scanned: amavisd-new at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id r7to5wyo_bFp; Sat, 3 Sep 2022 18:52:55 +0200 (CEST) Received: from localhost (153.226.95.79.rev.sfr.net [79.95.226.153]) by mail.choca.pics (Postfix) with ESMTPSA id 43A55181942A0; Sat, 3 Sep 2022 18:52:55 +0200 (CEST) From: Damien Cassou To: Lars Ingebrigtsen Subject: Re: bug#57561: Improve documentation of seq-position In-Reply-To: <87r10sbn5r.fsf@gnus.org> References: <87mtbgfw95.fsf@cassou.me> <87r10sbn5r.fsf@gnus.org> Date: Sat, 03 Sep 2022 18:52:54 +0200 Message-ID: <87h71ofli1.fsf@cassou.me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57561 Cc: 57561@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: -1.0 (-) --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Damien Cassou writes: >> - "Return the index of the first element in SEQUENCE that is equal to ELT. >> -Equality is defined by TESTFN if non-nil or by `equal' if nil." >> + "Return the (zero-based) index of the first element in SEQUENCE that is equal to ELT. > > This makes the first line too long. Indeed. I applied the change suggested by Eli. Also, the same sentence appeared several times in the file so the patch changes them all. -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Improve-documentation-of-seq-position.patch >From c198f7233081ddaee0e0f7c9872f58f602e37186 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 3 Sep 2022 14:56:53 +0200 Subject: [PATCH] Improve documentation of seq-position * doc/lispref/sequences.texi (Sequence Functions): * lisp/emacs-lisp/seq.el (seq-position): Use more standard wording in the documentation of `seq-position'. --- doc/lispref/sequences.texi | 2 +- lisp/emacs-lisp/seq.el | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 1f6f80521c..cc956952d6 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -863,7 +863,7 @@ Sequence Functions @end defun @defun seq-position sequence elt &optional function - This function returns the index of the first element in + This function returns the (zero-based) index of the first element in @var{sequence} that is equal to @var{elt}. If the optional argument @var{function} is non-@code{nil}, it is a function of two arguments to use instead of the default @code{equal}. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index b6f0f66e5b..23fed13c5d 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -409,7 +409,7 @@ seq-count (cl-defgeneric seq-contains (sequence elt &optional testfn) "Return the first element in SEQUENCE that is equal to ELT. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (declare (obsolete seq-contains-p "27.1")) (seq-some (lambda (e) (when (funcall (or testfn #'equal) elt e) @@ -418,7 +418,7 @@ seq-contains (cl-defgeneric seq-contains-p (sequence elt &optional testfn) "Return non-nil if SEQUENCE contains an element equal to ELT. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (catch 'seq--break (seq-doseq (e sequence) (let ((r (funcall (or testfn #'equal) e elt))) @@ -429,14 +429,14 @@ seq-contains-p (cl-defgeneric seq-set-equal-p (sequence1 sequence2 &optional testfn) "Return non-nil if SEQUENCE1 and SEQUENCE2 contain the same elements. This does not depend on the order of the elements. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (and (seq-every-p (lambda (item1) (seq-contains-p sequence2 item1 testfn)) sequence1) (seq-every-p (lambda (item2) (seq-contains-p sequence1 item2 testfn)) sequence2))) ;;;###autoload (cl-defgeneric seq-position (sequence elt &optional testfn) - "Return the index of the first element in SEQUENCE that is equal to ELT. -Equality is defined by TESTFN if non-nil or by `equal' if nil." + "Return the (zero-based) index of the first element in SEQUENCE equal to ELT. +Equality is defined by the function TESTFN, which defaults to `equal'." (let ((index 0)) (catch 'seq--break (seq-doseq (e sequence) @@ -502,7 +502,7 @@ seq-partition ;;;###autoload (cl-defgeneric seq-union (sequence1 sequence2 &optional testfn) "Return a list of all elements that appear in either SEQUENCE1 or SEQUENCE2. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (let* ((accum (lambda (acc elt) (if (seq-contains-p acc elt testfn) acc @@ -514,7 +514,7 @@ seq-union ;;;###autoload (cl-defgeneric seq-intersection (sequence1 sequence2 &optional testfn) "Return a list of the elements that appear in both SEQUENCE1 and SEQUENCE2. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (seq-reduce (lambda (acc elt) (if (seq-contains-p sequence2 elt testfn) (cons elt acc) @@ -524,7 +524,7 @@ seq-intersection (cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn) "Return a list of the elements that appear in SEQUENCE1 but not in SEQUENCE2. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (seq-reduce (lambda (acc elt) (if (seq-contains-p sequence2 elt testfn) acc -- 2.36.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 03 12:56:35 2022 Received: (at 57561) by debbugs.gnu.org; 3 Sep 2022 16:56:35 +0000 Received: from localhost ([127.0.0.1]:42906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUWRe-0004hV-P6 for submit@debbugs.gnu.org; Sat, 03 Sep 2022 12:56:35 -0400 Received: from mail.choca.pics ([80.67.172.235]:47710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUWRd-0004hN-1L for 57561@debbugs.gnu.org; Sat, 03 Sep 2022 12:56:33 -0400 Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 3D4CA181942A0; Sat, 3 Sep 2022 18:56:32 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id pg9i_sQPjVgF; Sat, 3 Sep 2022 18:56:31 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 5E55A181942A3; Sat, 3 Sep 2022 18:56:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id YWe_mlT_73D4; Sat, 3 Sep 2022 18:56:31 +0200 (CEST) Received: from localhost (153.226.95.79.rev.sfr.net [79.95.226.153]) by mail.choca.pics (Postfix) with ESMTPSA id 03754181942A0; Sat, 3 Sep 2022 18:56:30 +0200 (CEST) From: Damien Cassou To: Lars Ingebrigtsen Subject: Re: bug#57561: Improve documentation of seq-position In-Reply-To: <87h71ofli1.fsf@cassou.me> References: <87mtbgfw95.fsf@cassou.me> <87r10sbn5r.fsf@gnus.org> <87h71ofli1.fsf@cassou.me> Date: Sat, 03 Sep 2022 18:56:30 +0200 Message-ID: <87edwsflc1.fsf@cassou.me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 57561 Cc: 57561@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: -1.0 (-) --=-=-= Content-Type: text/plain Damien Cassou writes: > Indeed. I applied the change suggested by Eli. Also, the same sentence > appeared several times in the file so the patch changes them all. Here is the correct patch (the comment was changed). I'm sorry for the noise. -- Damien Cassou "Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Improve-documentation-of-several-functions-in-seq.el.patch >From 1d1cd3180cabe814332a87090449c98fee556870 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Sat, 3 Sep 2022 14:56:53 +0200 Subject: [PATCH] Improve documentation of several functions in seq.el Use more standard wording in the documentation of `seq-position'. * doc/lispref/sequences.texi (Sequence Functions): * lisp/emacs-lisp/seq.el (seq-contains): (seq-contains-p): (seq-set-equal-p): (seq-position): (seq-union): (seq-intersection): (seq-difference): Use more standard wording in the docstrings. --- doc/lispref/sequences.texi | 2 +- lisp/emacs-lisp/seq.el | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 1f6f80521c..cc956952d6 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -863,7 +863,7 @@ Sequence Functions @end defun @defun seq-position sequence elt &optional function - This function returns the index of the first element in + This function returns the (zero-based) index of the first element in @var{sequence} that is equal to @var{elt}. If the optional argument @var{function} is non-@code{nil}, it is a function of two arguments to use instead of the default @code{equal}. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index b6f0f66e5b..23fed13c5d 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -409,7 +409,7 @@ seq-count (cl-defgeneric seq-contains (sequence elt &optional testfn) "Return the first element in SEQUENCE that is equal to ELT. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (declare (obsolete seq-contains-p "27.1")) (seq-some (lambda (e) (when (funcall (or testfn #'equal) elt e) @@ -418,7 +418,7 @@ seq-contains (cl-defgeneric seq-contains-p (sequence elt &optional testfn) "Return non-nil if SEQUENCE contains an element equal to ELT. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (catch 'seq--break (seq-doseq (e sequence) (let ((r (funcall (or testfn #'equal) e elt))) @@ -429,14 +429,14 @@ seq-contains-p (cl-defgeneric seq-set-equal-p (sequence1 sequence2 &optional testfn) "Return non-nil if SEQUENCE1 and SEQUENCE2 contain the same elements. This does not depend on the order of the elements. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (and (seq-every-p (lambda (item1) (seq-contains-p sequence2 item1 testfn)) sequence1) (seq-every-p (lambda (item2) (seq-contains-p sequence1 item2 testfn)) sequence2))) ;;;###autoload (cl-defgeneric seq-position (sequence elt &optional testfn) - "Return the index of the first element in SEQUENCE that is equal to ELT. -Equality is defined by TESTFN if non-nil or by `equal' if nil." + "Return the (zero-based) index of the first element in SEQUENCE equal to ELT. +Equality is defined by the function TESTFN, which defaults to `equal'." (let ((index 0)) (catch 'seq--break (seq-doseq (e sequence) @@ -502,7 +502,7 @@ seq-partition ;;;###autoload (cl-defgeneric seq-union (sequence1 sequence2 &optional testfn) "Return a list of all elements that appear in either SEQUENCE1 or SEQUENCE2. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (let* ((accum (lambda (acc elt) (if (seq-contains-p acc elt testfn) acc @@ -514,7 +514,7 @@ seq-union ;;;###autoload (cl-defgeneric seq-intersection (sequence1 sequence2 &optional testfn) "Return a list of the elements that appear in both SEQUENCE1 and SEQUENCE2. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (seq-reduce (lambda (acc elt) (if (seq-contains-p sequence2 elt testfn) (cons elt acc) @@ -524,7 +524,7 @@ seq-intersection (cl-defgeneric seq-difference (sequence1 sequence2 &optional testfn) "Return a list of the elements that appear in SEQUENCE1 but not in SEQUENCE2. -Equality is defined by TESTFN if non-nil or by `equal' if nil." +Equality is defined by the function TESTFN, which defaults to `equal'." (seq-reduce (lambda (acc elt) (if (seq-contains-p sequence2 elt testfn) acc -- 2.36.2 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 07:00:45 2022 Received: (at 57561) by debbugs.gnu.org; 4 Sep 2022 11:00:45 +0000 Received: from localhost ([127.0.0.1]:43514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUnMr-0007Jl-GM for submit@debbugs.gnu.org; Sun, 04 Sep 2022 07:00:45 -0400 Received: from quimby.gnus.org ([95.216.78.240]:56588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUnMp-0007JY-EM for 57561@debbugs.gnu.org; Sun, 04 Sep 2022 07:00:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xRaZtjUNjEJcddezfk5hXL3CnzsNMEA4Gug3k2pSrR0=; b=Oq3FBX+gchU+94n4DPDbKyHd5d ELPzLxP1hWA8ljSyxzOP8NYaVHA7gblRgh37c77XYp7SUovtm1bOX7dbCKLWnkaWeeF0WSO1WbIdv Irc0GfHSOpmc4Z66VP9HrqWJpkMcuSA5SjJEuaK7Q8VvVybPky47yZ5tt9DlTjFE4tG4=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUnMg-0000bI-Sz; Sun, 04 Sep 2022 13:00:37 +0200 From: Lars Ingebrigtsen To: Damien Cassou Subject: Re: bug#57561: Improve documentation of seq-position In-Reply-To: <87edwsflc1.fsf@cassou.me> (Damien Cassou's message of "Sat, 03 Sep 2022 18:56:30 +0200") References: <87mtbgfw95.fsf@cassou.me> <87r10sbn5r.fsf@gnus.org> <87h71ofli1.fsf@cassou.me> <87edwsflc1.fsf@cassou.me> X-Now-Playing: The Beatles's _The Beatles (1)_: "Don't Pass Me By" Date: Sun, 04 Sep 2022 13:00:34 +0200 Message-ID: <87sfl79zfx.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Damien Cassou writes: > Here is the correct patch (the comment was changed). I'm sorry for the > noise. Thanks; pushed to Emacs 29. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57561 Cc: 57561@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: -3.3 (---) Damien Cassou writes: > Here is the correct patch (the comment was changed). I'm sorry for the > noise. Thanks; pushed to Emacs 29. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 04 07:03:30 2022 Received: (at control) by debbugs.gnu.org; 4 Sep 2022 11:03:30 +0000 Received: from localhost ([127.0.0.1]:43523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUnPW-0007Or-9N for submit@debbugs.gnu.org; Sun, 04 Sep 2022 07:03:30 -0400 Received: from quimby.gnus.org ([95.216.78.240]:56646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oUnPU-0007Oe-M5 for control@debbugs.gnu.org; Sun, 04 Sep 2022 07:03:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=gHb2fLPuF7uZDiMmAN3/Z8mcmZWizu4k5RW+qjNd3DA=; b=l6lCnSYBBdsFgNq9iSZ48hFvca eUjfwsPNIr+DPmC4y2spgFuZAPkP2lm4KoNS5TLoHN1ce6P9p61qD+hTejXfDbf6rhrSaiqCrcdHn X8uar6oONBiVG97z85DbCPX3MvB7n6C6wlpACvjCgNiWYrr61/1zfxQ/gVYdLGnFSTaA=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oUnPM-0000eJ-RB for control@debbugs.gnu.org; Sun, 04 Sep 2022 13:03:22 +0200 Date: Sun, 04 Sep 2022 13:03:20 +0200 Message-Id: <87r10r9zbb.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #57561 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: close 57561 29.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) 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: -3.3 (---) close 57561 29.1 quit From unknown Thu Aug 14 22:19:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 02 Oct 2022 11:24:06 +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