emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp/calc calc.el


From: Jay Belanger
Subject: [Emacs-diffs] emacs/lisp/calc calc.el
Date: Fri, 23 Oct 2009 01:39:04 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Jay Belanger <jpb>      09/10/23 01:39:04

Modified files:
        lisp/calc      : calc.el 

Log message:
        (math-read-number, math-read-number-simple): Use `save-match-data'.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/calc/calc.el?cvsroot=emacs&r1=1.134&r2=1.135

Patches:
Index: calc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calc/calc.el,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -b -r1.134 -r1.135
--- calc.el     6 Oct 2009 02:42:32 -0000       1.134
+++ calc.el     23 Oct 2009 01:39:04 -0000      1.135
@@ -3526,6 +3526,7 @@
 (defun math-read-number (s &optional decimal)
   "Convert the string S into a Calc number."
   (math-normalize
+   (save-match-data
    (cond
 
     ;; Integers (most common case)
@@ -3580,13 +3581,14 @@
                (list 'float (nth 1 mant) (+ (nth 2 mant) exp)))))))
 
     ;; Syntax error!
-    (t nil))))
+      (t nil)))))
 
 ;;; Parse a very simple number, keeping all digits.
 (defun math-read-number-simple (s)
   "Convert the string S into a Calc number.
 S is assumed to be a simple number (integer or float without an exponent)
 and all digits are kept, regardless of Calc's current precision."
+  (save-match-data
    (cond
     ;; Integer
     ((string-match "^[0-9]+$" s)
@@ -3607,7 +3609,7 @@
        (list 'float (math-read-number-simple (concat int frac))
              (- (length frac)))))
     ;; Syntax error!
-    (t nil)))
+     (t nil))))
 
 (defun math-match-substring (s n)
   (if (match-beginning n)




reply via email to

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