2862 |
|
|
2863 |
|
|
2864 |
(defvar version-regexp-alist |
(defvar version-regexp-alist |
2865 |
'(("^a\\(lpha\\)?$" . -3) |
'(("^[-_+]?a\\(lpha\\)?$" . -3) |
2866 |
("^b\\(eta\\)?$" . -2) |
("^[-_+]$" . -3) ; treat "1.2.3-20050920" and "1.2-3" as alpha releases |
2867 |
("^\\(pre\\|rc\\)$" . -1)) |
("^[-_+]cvs$" . -3) ; treat "1.2.3-CVS" as alpha release |
2868 |
|
("^[-_+]?b\\(eta\\)?$" . -2) |
2869 |
|
("^[-_+]?\\(pre\\|rc\\)$" . -1)) |
2870 |
"*Specify association between non-numeric version part and a priority. |
"*Specify association between non-numeric version part and a priority. |
2871 |
|
|
2872 |
This association is used to handle version string like \"1.0pre2\", |
This association is used to handle version string like \"1.0pre2\", |
2889 |
Where: |
Where: |
2890 |
|
|
2891 |
REGEXP regexp used to match non-numeric part of a version string. |
REGEXP regexp used to match non-numeric part of a version string. |
2892 |
|
It should begin with a `^' anchor and end with a `$' to |
2893 |
|
prevent false hits. Letter-case is ignored while matching |
2894 |
|
REGEXP. |
2895 |
|
|
2896 |
PRIORITY negative integer which indicate the non-numeric priority.") |
PRIORITY negative integer which indicate the non-numeric priority.") |
2897 |
|
|
2908 |
SEPARATOR ::= `version-separator' (which see) |
SEPARATOR ::= `version-separator' (which see) |
2909 |
| `version-regexp-alist' (which see). |
| `version-regexp-alist' (which see). |
2910 |
|
|
2911 |
|
The NUMBER part is optional if SEPARATOR is a match for an element |
2912 |
|
in `version-regexp-alist'. |
2913 |
|
|
2914 |
As an example of valid version syntax: |
As an example of valid version syntax: |
2915 |
|
|
2916 |
1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 |
1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta |
2917 |
|
|
2918 |
As an example of invalid version syntax: |
As an example of invalid version syntax: |
2919 |
|
|
2936 |
(error "Invalid version string: '%s'" ver)) |
(error "Invalid version string: '%s'" ver)) |
2937 |
(save-match-data |
(save-match-data |
2938 |
(let ((i 0) |
(let ((i 0) |
2939 |
case-fold-search ; ignore case in matching |
(case-fold-search t) ; ignore case in matching |
2940 |
lst s al) |
lst s al) |
2941 |
(while (and (setq s (string-match "[0-9]+" ver i)) |
(while (and (setq s (string-match "[0-9]+" ver i)) |
2942 |
(= s i)) |
(= s i)) |