From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#5744: 23.1.92; doc string of `version<' etc. Date: Sat, 27 Mar 2010 15:37:18 +0300 Message-ID: <83mxxuey9t.fsf@gnu.org> References: <4E614B66A7BE41B496EA061D77C80C2E@us.oracle.com> <87pr2yriq4.fsf@gmail.com> <9C18B608A91D4DE5B54FC6ACB722141C@us.oracle.com> <83y6hmhgb9.fsf@gnu.org> <3416E1927C6447259BD811B918EB8142@us.oracle.com> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1269694694 17088 80.91.229.12 (27 Mar 2010 12:58:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 27 Mar 2010 12:58:14 +0000 (UTC) Cc: 5744-done@debbugs.gnu.org, stepnem@gmail.com To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 27 13:58:09 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NvVZs-0008FH-IJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Mar 2010 13:58:08 +0100 Original-Received: from localhost ([127.0.0.1]:40628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvVZh-0005AE-Rd for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Mar 2010 08:57:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvVY3-00047l-IW for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2010 08:55:31 -0400 Original-Received: from [140.186.70.92] (port=39037 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvVY1-00045u-NW for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2010 08:55:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvVXz-0003e2-RN for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2010 08:55:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45949) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvVXz-0003dq-Cx for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2010 08:55:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NvVI6-0001r9-77 for bug-gnu-emacs@gnu.org; Sat, 27 Mar 2010 08:39:02 -0400 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Mar 2010 12:39:02 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org Mail-Followup-To: 5744@debbugs.gnu.org, Eli Zaretskii X-GNU-PR-Message: cc-closed 5744 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5744-done@debbugs.gnu.org id=D5744.12696934947080 (code D ref 5744); Sat, 27 Mar 2010 12:39:02 +0000 Original-Received: (at 5744-done) by debbugs.gnu.org; 27 Mar 2010 12:38:14 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvVHJ-0001q7-Kg for submit@debbugs.gnu.org; Sat, 27 Mar 2010 08:38:14 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvVHG-0001pt-Hd for 5744-done@debbugs.gnu.org; Sat, 27 Mar 2010 08:38:11 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KZX00A00XPWOC00@a-mtaout20.012.net.il> for 5744-done@debbugs.gnu.org; Sat, 27 Mar 2010 15:37:15 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.176.135]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KZX00A5OXQ27P20@a-mtaout20.012.net.il>; Sat, 27 Mar 2010 15:37:15 +0300 (IDT) In-reply-to: <3416E1927C6447259BD811B918EB8142@us.oracle.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 27 Mar 2010 08:39:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35775 Archived-At: > From: "Drew Adams" > Cc: , <5744@debbugs.gnu.org> > Date: Sat, 20 Mar 2010 14:12:18 -0700 > > > With versions, it might be better to use "older" and "newer" instead. > > Good point. > > (And the rest of the doc string will (should) make clear just what string > comparison is involved, as already discussed.) Fixed (on the Emacs-23 branch) with this patch: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-03-26 08:58:41 +0000 +++ lisp/ChangeLog 2010-03-27 12:31:04 +0000 @@ -1,3 +1,10 @@ +2010-03-27 Eli Zaretskii + + * subr.el (version-regexp-alist, version-to-list) + (version-list-<, version-list-=, version-list-<=) + (version-list-not-zero, version<, version<=, version=): Doc fix. + (Bug#5744). + 2010-03-26 YAMAMOTO Mitsuharu Nick Roberts === modified file 'lisp/subr.el' --- lisp/subr.el 2010-03-03 03:58:26 +0000 +++ lisp/subr.el 2010-03-27 12:31:04 +0000 @@ -3573,11 +3573,11 @@ Usually the separator is \".\", but it c ("^[-_+ ]cvs$" . -3) ; treat "1.2.3-CVS" as alpha release ("^[-_+ ]?b\\(eta\\)?$" . -2) ("^[-_+ ]?\\(pre\\|rc\\)$" . -1)) - "*Specify association between non-numeric version part and a priority. + "*Specify association between non-numeric version and its priority. This association is used to handle version string like \"1.0pre2\", \"0.9alpha1\", etc. It's used by `version-to-list' (which see) to convert the -non-numeric part to an integer. For example: +non-numeric part of a version string to an integer. For example: String Version Integer List Version \"1.0pre2\" (1 0 -1 2) @@ -3595,15 +3595,15 @@ Each element has the following form: Where: REGEXP regexp used to match non-numeric part of a version string. - It should begin with a `^' anchor and end with a `$' to + It should begin with the `^' anchor and end with a `$' to prevent false hits. Letter-case is ignored while matching REGEXP. -PRIORITY negative integer which indicate the non-numeric priority.") +PRIORITY a negative integer specifying non-numeric priority of REGEXP.") (defun version-to-list (ver) - "Convert version string VER into an integer list. + "Convert version string VER into a list of integers. The version syntax is given by the following EBNF: @@ -3617,17 +3617,17 @@ The version syntax is given by the follo The NUMBER part is optional if SEPARATOR is a match for an element in `version-regexp-alist'. -As an example of valid version syntax: +Examples of valid version syntax: 1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta -As an example of invalid version syntax: +Examples of invalid version syntax: 1.0prepre2 1.0..7.5 22.8X3 alpha3.2 .5 -As an example of version convertion: +Examples of version conversion: - String Version Integer List Version + Version String Version as a List of Integers \"1.0.7.5\" (1 0 7 5) \"1.0pre2\" (1 0 -1 2) \"1.0PRE2\" (1 0 -1 2) @@ -3673,12 +3673,12 @@ See documentation for `version-separator (defun version-list-< (l1 l2) - "Return t if integer list L1 is lesser than L2. + "Return t if L1, a list specification of a version, is lower than L2. -Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0), -etc. That is, the trailing zeroes are irrelevant. Also, integer -list (1) is greater than (1 -1) which is greater than (1 -2) -which is greater than (1 -3)." +Note that a version specified by the list (1) is equal to (1 0), +\(1 0 0), (1 0 0 0), etc. That is, the trailing zeros are insignificant. +Also, a version given by the list (1) is higher than (1 -1), which in +turn is higher than (1 -2), which is higher than (1 -3)." (while (and l1 l2 (= (car l1) (car l2))) (setq l1 (cdr l1) l2 (cdr l2))) @@ -3694,12 +3694,12 @@ which is greater than (1 -3)." (defun version-list-= (l1 l2) - "Return t if integer list L1 is equal to L2. + "Return t if L1, a list specification of a version, is equal to L2. -Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0), -etc. That is, the trailing zeroes are irrelevant. Also, integer -list (1) is greater than (1 -1) which is greater than (1 -2) -which is greater than (1 -3)." +Note that a version specified by the list (1) is equal to (1 0), +\(1 0 0), (1 0 0 0), etc. That is, the trailing zeros are insignificant. +Also, a version given by the list (1) is higher than (1 -1), which in +turn is higher than (1 -2), which is higher than (1 -3)." (while (and l1 l2 (= (car l1) (car l2))) (setq l1 (cdr l1) l2 (cdr l2))) @@ -3715,7 +3715,7 @@ which is greater than (1 -3)." (defun version-list-<= (l1 l2) - "Return t if integer list L1 is lesser than or equal to L2. + "Return t if L1, a list specification of a version, is lower or equal to L2. Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0), etc. That is, the trailing zeroes are irrelevant. Also, integer @@ -3735,9 +3735,9 @@ which is greater than (1 -3)." (t (<= 0 (version-list-not-zero l2))))) (defun version-list-not-zero (lst) - "Return the first non-zero element of integer list LST. + "Return the first non-zero element of LST, which is a list of integers. -If all LST elements are zeroes or LST is nil, return zero." +If all LST elements are zeros or LST is nil, return zero." (while (and lst (zerop (car lst))) (setq lst (cdr lst))) (if lst @@ -3747,31 +3747,31 @@ If all LST elements are zeroes or LST is (defun version< (v1 v2) - "Return t if version V1 is lesser than V2. + "Return t if version V1 is lower (older) than V2. Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\", -etc. That is, the trailing \".0\"s are irrelevant. Also, version string \"1\" -is greater than \"1pre\" which is greater than \"1beta\" which is greater than -\"1alpha\"." +etc. That is, the trailing \".0\"s are insignificant. Also, version +string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", +which is higher than \"1alpha\"." (version-list-< (version-to-list v1) (version-to-list v2))) (defun version<= (v1 v2) - "Return t if version V1 is lesser than or equal to V2. + "Return t if version V1 is lower (older) than or equal to V2. Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\", -etc. That is, the trailing \".0\"s are irrelevant. Also, version string \"1\" -is greater than \"1pre\" which is greater than \"1beta\" which is greater than -\"1alpha\"." +etc. That is, the trailing \".0\"s are insignificant.. Also, version +string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", +which is higher than \"1alpha\"." (version-list-<= (version-to-list v1) (version-to-list v2))) (defun version= (v1 v2) "Return t if version V1 is equal to V2. Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\", -etc. That is, the trailing \".0\"s are irrelevant. Also, version string \"1\" -is greater than \"1pre\" which is greater than \"1beta\" which is greater than -\"1alpha\"." +etc. That is, the trailing \".0\"s are insignificant.. Also, version +string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", +which is higher than \"1alpha\"." (version-list-= (version-to-list v1) (version-to-list v2)))