aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2005-09-24 10:41:18 +0000
committerEli Zaretskii <[email protected]>2005-09-24 10:41:18 +0000
commitd74a5c919c2b1dddfd72e9220db5009d1b41ded7 (patch)
tree984032d3b1dec36cd4e1e5ba08c2bcc829ca77c5
parentf9ac21e7fbd2bac1b6d610429e3031ca33d553c6 (diff)
(version-regexp-alist): Extend valid syntax for version strings:
allow any of the characters -,_,+ to separate the alpha/beta/rc part from the version part. Doc fix. (version-to-list): Doc fix. Bind case-fold-search to t, as advertised.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/subr.el18
2 files changed, 21 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 111f9b5fde..e4ba2de150 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2005-09-24 Eli Zaretskii <[email protected]>
+
+ * subr.el (version-regexp-alist): Extend valid syntax for version
+ strings: allow any of the characters -,_,+ to separate the
+ alpha/beta/rc part from the version part. Doc fix.
+ (version-to-list): Doc fix. Bind case-fold-search to t, as
+ advertised.
+
2005-09-23 David Reitter <[email protected]>
* mail/mailclient.el: New file.
diff --git a/lisp/subr.el b/lisp/subr.el
index ab0b052dae..7bebfd30c0 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2862,9 +2862,11 @@ Usually the separator is \".\", but it can be any other string.")
(defvar version-regexp-alist
- '(("^a\\(lpha\\)?$" . -3)
- ("^b\\(eta\\)?$" . -2)
- ("^\\(pre\\|rc\\)$" . -1))
+ '(("^[-_+]?a\\(lpha\\)?$" . -3)
+ ("^[-_+]$" . -3) ; treat "1.2.3-20050920" and "1.2-3" as alpha releases
+ ("^[-_+]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.
This association is used to handle version string like \"1.0pre2\",
@@ -2887,6 +2889,9 @@ 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
+ prevent false hits. Letter-case is ignored while matching
+ REGEXP.
PRIORITY negative integer which indicate the non-numeric priority.")
@@ -2903,9 +2908,12 @@ The version syntax is given by the following EBNF:
SEPARATOR ::= `version-separator' (which see)
| `version-regexp-alist' (which see).
+The NUMBER part is optional if SEPARATOR is a match for an element
+in `version-regexp-alist'.
+
As an example of valid version syntax:
- 1.0pre2 1.0.7.5 22.8beta3 0.9alpha1
+ 1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta
As an example of invalid version syntax:
@@ -2928,7 +2936,7 @@ See documentation for `version-separator' and `version-regexp-alist'."
(error "Invalid version string: '%s'" ver))
(save-match-data
(let ((i 0)
- case-fold-search ; ignore case in matching
+ (case-fold-search t) ; ignore case in matching
lst s al)
(while (and (setq s (string-match "[0-9]+" ver i))
(= s i))