aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-06-20 09:48:09 +0000
committerDave Love2000-06-20 09:48:09 +0000
commit26c67de87de7acf661a9c4db059d03774e02102f (patch)
tree9eb77bda89297fce4394a6ff2418d3cb18d7d677
parent2538076d09018b427d06be133ab194ea946e8971 (diff)
downloademacs-26c67de87de7acf661a9c4db059d03774e02102f.tar.gz
emacs-26c67de87de7acf661a9c4db059d03774e02102f.zip
(customize-changed-options): Check arg.
(customize-version-lessp): Don't require decimal point.
-rw-r--r--lisp/cus-edit.el25
1 files changed, 18 insertions, 7 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 42f5d0978be..9005e0a3fec 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -936,7 +936,11 @@ version."
936 936
937 (interactive "sCustomize options changed, since version (default all versions): ") 937 (interactive "sCustomize options changed, since version (default all versions): ")
938 (if (equal since-version "") 938 (if (equal since-version "")
939 (setq since-version nil)) 939 (setq since-version nil)
940 (unless (condition-case nil
941 (numberp (read since-version))
942 (error nil))
943 (signal 'wrong-type-argument (list 'numberp since-version))))
940 (unless since-version 944 (unless since-version
941 (setq since-version customize-changed-options-previous-release)) 945 (setq since-version customize-changed-options-previous-release))
942 (let ((found nil) 946 (let ((found nil)
@@ -987,17 +991,24 @@ version."
987 "*Customize Changed Options*")))) 991 "*Customize Changed Options*"))))
988 992
989(defun customize-version-lessp (version1 version2) 993(defun customize-version-lessp (version1 version2)
994 ;; Why are the versions strings, and given that they are, why aren't
995 ;; they converted to numbers and compared as such here? -- fx
996
990 ;; In case someone made a mistake and left out the quotes 997 ;; In case someone made a mistake and left out the quotes
991 ;; in the :version value. 998 ;; in the :version value.
992 (if (numberp version2) 999 (if (numberp version2)
993 (setq version2 (prin1-to-string version2))) 1000 (setq version2 (prin1-to-string version2)))
994 (let (major1 major2 minor1 minor2) 1001 (let (major1 major2 minor1 minor2)
995 (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version1) 1002 (string-match "\\([0-9]+\\)\\(\\.\\([0-9]+\\)\\)?" version1)
996 (setq major1 (read (match-string 1 version1))) 1003 (setq major1 (read (or (match-string 1 version1)
997 (setq minor1 (read (match-string 2 version1))) 1004 "0")))
998 (string-match "\\([0-9]+\\)[.]\\([0-9]+\\)" version2) 1005 (setq minor1 (read (or (match-string 3 version1)
999 (setq major2 (read (match-string 1 version2))) 1006 "0")))
1000 (setq minor2 (read (match-string 2 version2))) 1007 (string-match "\\([0-9]+\\)\\(\\.\\([0-9]+\\)\\)?" version2)
1008 (setq major2 (read (or (match-string 1 version2)
1009 "0")))
1010 (setq minor2 (read (or (match-string 3 version2)
1011 "0")))
1001 (or (< major1 major2) 1012 (or (< major1 major2)
1002 (and (= major1 major2) 1013 (and (= major1 major2)
1003 (< minor1 minor2))))) 1014 (< minor1 minor2)))))