From unknown Sat Aug 16 21:20:45 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#1943: 23.0.60; doc string for substring: mention value is a copy, string is any vector Reply-To: "Drew Adams" , 1943@debbugs.gnu.org Resent-From: "Drew Adams" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 17 Jan 2009 23:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 1943 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123223540719559 (code B ref -1); Sat, 17 Jan 2009 23:45:03 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 17 Jan 2009 23:36:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0HNaiug019552 for ; Sat, 17 Jan 2009 15:36:45 -0800 Received: from mx10.gnu.org ([199.232.76.166]:43772) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LOKhC-0001Vg-RJ for emacs-pretest-bug@gnu.org; Sat, 17 Jan 2009 18:35:18 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LOKiY-0007LH-Qa for emacs-pretest-bug@gnu.org; Sat, 17 Jan 2009 18:36:43 -0500 Received: from acsinet12.oracle.com ([141.146.126.234]:56996) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LOKiY-0007EY-DR for emacs-pretest-bug@gnu.org; Sat, 17 Jan 2009 18:36:42 -0500 Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0HNYXil013935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 17 Jan 2009 23:34:35 GMT Received: from acsmt706.oracle.com (acsmt706.oracle.com [141.146.40.84]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0HNZ6oM024249 for ; Sat, 17 Jan 2009 23:35:07 GMT Received: from dradamslap1 (/24.5.128.33) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 17 Jan 2009 23:35:04 +0000 From: "Drew Adams" To: Date: Sat, 17 Jan 2009 15:35:11 -0800 Message-ID: <003f01c978fc$3ddc4fb0$0200a8c0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 thread-index: Acl4/D1GgU2QgtQuRc++GFL6pVNtQQ== X-Source-IP: acsmt706.oracle.com [141.146.40.84] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.49726B29.025E:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) The doc string for function `substring' could be made clearer. 1. Like the Elisp manual entry for `substring', mention that the value returned does not share with the input STRING object. That is, a copy of the substring is returned, not the substring itself. 2. State more clearly that STRING can be any kind of vector, not just a vector of characters. 3. FROM and TO do not "start" at 0. It is indexing that starts at 0. Better to speak of "zero-based indexing". Something like this: "Return a new string whose characters are a substring of STRING. STRING can be any kind of vector; elements need not be characters. Indexing of STRING is zero-based. The substring starts at index FROM and ends before index TO. If TO is nil, then the substring runs to the end of STRING. If either FROM or TO is negative, then STRING is indexed backward, from its end." In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2009-01-04 on LENNART-69DE564 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include -fno-crossjumping' From unknown Sat Aug 16 21:20:45 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: owner@emacsbugs.donarmstrong.com From: help-debbugs@gnu.org (Emacs bug Tracking System) To: "Drew Adams" Subject: bug#1943 closed by Chong Yidong (Re: 23.0.60; doc string for substring: mention value is a copy, string is any vector) Message-ID: References: <87y6x7nx9h.fsf@cyd.mit.edu> <003f01c978fc$3ddc4fb0$0200a8c0@us.oracle.com> X-Emacs-PR-Message: they-closed 1943 X-Emacs-PR-Package: emacs Reply-To: 1943@debbugs.gnu.org Date: Mon, 19 Jan 2009 15:20:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1232378403-29210-1" This is a multi-part message in MIME format... ------------=_1232378403-29210-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This is an automatic notification regarding your bug report which was filed against the emacs package: #1943: 23.0.60; doc string for substring: mention value is a copy, string i= s any vector It has been closed by Chong Yidong . Their explanation is attached below along with your original report. If this explanation is unsatisfactory and you have not received a better one in a separate message then please contact Chong Yidong by replying to this email. --=20 1943: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D1943 Emacs Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1232378403-29210-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 1943-done) by emacsbugs.donarmstrong.com; 19 Jan 2009 15:14:15 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=none autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0JFECC9027986 for <1943-done@emacsbugs.donarmstrong.com>; Mon, 19 Jan 2009 07:14:13 -0800 Received: by cyd.mit.edu (Postfix, from userid 1000) id 5D65957E221; Mon, 19 Jan 2009 10:14:34 -0500 (EST) From: Chong Yidong To: "Drew Adams" Cc: 1943-done@debbugs.gnu.org Subject: Re: 23.0.60; doc string for substring: mention value is a copy, string is any vector Date: Mon, 19 Jan 2009 10:14:34 -0500 Message-ID: <87y6x7nx9h.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > The doc string for function `substring' could be made clearer. I've rewritten it. Thanks for the report. ------------=_1232378403-29210-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 17 Jan 2009 23:36:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0HNaiug019552 for ; Sat, 17 Jan 2009 15:36:45 -0800 Received: from mx10.gnu.org ([199.232.76.166]:43772) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LOKhC-0001Vg-RJ for emacs-pretest-bug@gnu.org; Sat, 17 Jan 2009 18:35:18 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LOKiY-0007LH-Qa for emacs-pretest-bug@gnu.org; Sat, 17 Jan 2009 18:36:43 -0500 Received: from acsinet12.oracle.com ([141.146.126.234]:56996) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LOKiY-0007EY-DR for emacs-pretest-bug@gnu.org; Sat, 17 Jan 2009 18:36:42 -0500 Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0HNYXil013935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 17 Jan 2009 23:34:35 GMT Received: from acsmt706.oracle.com (acsmt706.oracle.com [141.146.40.84]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n0HNZ6oM024249 for ; Sat, 17 Jan 2009 23:35:07 GMT Received: from dradamslap1 (/24.5.128.33) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 17 Jan 2009 23:35:04 +0000 From: "Drew Adams" To: Subject: 23.0.60; doc string for substring: mention value is a copy, string is any vector Date: Sat, 17 Jan 2009 15:35:11 -0800 Message-ID: <003f01c978fc$3ddc4fb0$0200a8c0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 thread-index: Acl4/D1GgU2QgtQuRc++GFL6pVNtQQ== X-Source-IP: acsmt706.oracle.com [141.146.40.84] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.49726B29.025E:SCFSTAT928724,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) The doc string for function `substring' could be made clearer. 1. Like the Elisp manual entry for `substring', mention that the value returned does not share with the input STRING object. That is, a copy of the substring is returned, not the substring itself. 2. State more clearly that STRING can be any kind of vector, not just a vector of characters. 3. FROM and TO do not "start" at 0. It is indexing that starts at 0. Better to speak of "zero-based indexing". Something like this: "Return a new string whose characters are a substring of STRING. STRING can be any kind of vector; elements need not be characters. Indexing of STRING is zero-based. The substring starts at index FROM and ends before index TO. If TO is nil, then the substring runs to the end of STRING. If either FROM or TO is negative, then STRING is indexed backward, from its end." In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600) of 2009-01-04 on LENNART-69DE564 Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include -fno-crossjumping' ------------=_1232378403-29210-1--