emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112062: * lisp/calc/calc-ext.el (mat


From: Jay Belanger
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112062: * lisp/calc/calc-ext.el (math-read-number-fancy): Check for an explicit
Date: Sat, 16 Mar 2013 19:19:09 -0500
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112062
committer: Jay Belanger <address@hidden>
branch nick: trunk
timestamp: Sat 2013-03-16 19:19:09 -0500
message:
  * lisp/calc/calc-ext.el (math-read-number-fancy): Check for an explicit
    radix before checking for HMS forms.
modified:
  lisp/ChangeLog
  lisp/calc/calc-ext.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-16 22:08:22 +0000
+++ b/lisp/ChangeLog    2013-03-17 00:19:09 +0000
@@ -1,3 +1,8 @@
+2013-03-17  Jay Belanger  <address@hidden>
+
+       * calc/calc-ext.el (math-read-number-fancy): Check for an explicit
+       radix before checking for HMS forms.
+
 2013-03-16  Leo Liu  <address@hidden>
 
        * progmodes/scheme.el: Add indentation and font-locking for λ.

=== modified file 'lisp/calc/calc-ext.el'
--- a/lisp/calc/calc-ext.el     2013-01-01 09:11:05 +0000
+++ b/lisp/calc/calc-ext.el     2013-03-17 00:19:09 +0000
@@ -2945,50 +2945,6 @@
       (and x sigma (math-scalarp x) (math-anglep sigma)
           (list 'sdev x sigma))))
 
-   ;; Hours (or degrees)
-   ((or (string-match "^\\([^#^]+\\)address@hidden(.*\\)$" s)
-       (string-match "^\\([^#^]+\\)[dD][eE]?[gG]?\\(.*\\)$" s))
-    (let* ((hours (math-match-substring s 1))
-          (minsec (math-match-substring s 2))
-          (hours (math-read-number hours))
-          (minsec (if (> (length minsec) 0) (math-read-number minsec) 0)))
-      (and hours minsec
-          (math-num-integerp hours)
-          (not (math-negp hours)) (not (math-negp minsec))
-          (cond ((math-num-integerp minsec)
-                 (and (Math-lessp minsec 60)
-                      (list 'hms hours minsec 0)))
-                ((and (eq (car-safe minsec) 'hms)
-                      (math-zerop (nth 1 minsec)))
-                 (math-add (list 'hms hours 0 0) minsec))
-                (t nil)))))
-
-   ;; Minutes
-   ((string-match "^\\([^'#^]+\\)[mM']\\(.*\\)$" s)
-    (let* ((minutes (math-match-substring s 1))
-          (seconds (math-match-substring s 2))
-          (minutes (math-read-number minutes))
-          (seconds (if (> (length seconds) 0) (math-read-number seconds) 0)))
-      (and minutes seconds
-          (math-num-integerp minutes)
-          (not (math-negp minutes)) (not (math-negp seconds))
-          (cond ((math-realp seconds)
-                 (and (Math-lessp minutes 60)
-                      (list 'hms 0 minutes seconds)))
-                ((and (eq (car-safe seconds) 'hms)
-                      (math-zerop (nth 1 seconds))
-                      (math-zerop (nth 2 seconds)))
-                 (math-add (list 'hms 0 minutes 0) seconds))
-                (t nil)))))
-
-   ;; Seconds
-   ((string-match "^\\([^\"#^]+\\)[sS\"]$" s)
-    (let ((seconds (math-read-number (math-match-substring s 1))))
-      (and seconds (math-realp seconds)
-          (not (math-negp seconds))
-          (Math-lessp seconds 60)
-          (list 'hms 0 0 seconds))))
-
    ;; Integer+fraction with explicit radix
    ((string-match 
"^\\([0-9]+\\)\\(#\\|\\^\\^\\)\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]*\\)[:/]\\([0-9a-zA-Z]\\)$"
 s)
     (let ((radix (string-to-number (math-match-substring s 1)))
@@ -3061,6 +3017,50 @@
     (let ((digs (math-match-substring s 1)))
       (math-read-radix digs 16)))
 
+   ;; Hours (or degrees)
+   ((or (string-match "^\\([^#^]+\\)address@hidden(.*\\)$" s)
+       (string-match "^\\([^#^]+\\)[dD][eE]?[gG]?\\(.*\\)$" s))
+    (let* ((hours (math-match-substring s 1))
+          (minsec (math-match-substring s 2))
+          (hours (math-read-number hours))
+          (minsec (if (> (length minsec) 0) (math-read-number minsec) 0)))
+      (and hours minsec
+          (math-num-integerp hours)
+          (not (math-negp hours)) (not (math-negp minsec))
+          (cond ((math-num-integerp minsec)
+                 (and (Math-lessp minsec 60)
+                      (list 'hms hours minsec 0)))
+                ((and (eq (car-safe minsec) 'hms)
+                      (math-zerop (nth 1 minsec)))
+                 (math-add (list 'hms hours 0 0) minsec))
+                (t nil)))))
+
+   ;; Minutes
+   ((string-match "^\\([^'#^]+\\)[mM']\\(.*\\)$" s)
+    (let* ((minutes (math-match-substring s 1))
+          (seconds (math-match-substring s 2))
+          (minutes (math-read-number minutes))
+          (seconds (if (> (length seconds) 0) (math-read-number seconds) 0)))
+      (and minutes seconds
+          (math-num-integerp minutes)
+          (not (math-negp minutes)) (not (math-negp seconds))
+          (cond ((math-realp seconds)
+                 (and (Math-lessp minutes 60)
+                      (list 'hms 0 minutes seconds)))
+                ((and (eq (car-safe seconds) 'hms)
+                      (math-zerop (nth 1 seconds))
+                      (math-zerop (nth 2 seconds)))
+                 (math-add (list 'hms 0 minutes 0) seconds))
+                (t nil)))))
+
+   ;; Seconds
+   ((string-match "^\\([^\"#^]+\\)[sS\"]$" s)
+    (let ((seconds (math-read-number (math-match-substring s 1))))
+      (and seconds (math-realp seconds)
+          (not (math-negp seconds))
+          (Math-lessp seconds 60)
+          (list 'hms 0 0 seconds))))
+
    ;; Fraction using "/" instead of ":"
    ((string-match "^\\([0-9]+\\)/\\([0-9/]+\\)$" s)
     (math-read-number (concat (math-match-substring s 1) ":"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]