diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2005-05-16 11:34:49 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2005-05-16 11:34:49 +0000 |
commit | 027a4b6b3fd229f8aea323f59cb246d99deb8a75 (patch) | |
tree | c92da7d3049376d7bd687db6bc5c8dce82ed9335 /lisp/calendar | |
parent | 216d380630ec8be9569a56687f0e08b89ee97c47 (diff) | |
download | emacs-027a4b6b3fd229f8aea323f59cb246d99deb8a75.tar.gz |
Replace `string-to-int' by `string-to-number'.
Diffstat (limited to 'lisp/calendar')
-rw-r--r-- | lisp/calendar/appt.el | 4 | ||||
-rw-r--r-- | lisp/calendar/cal-bahai.el | 8 | ||||
-rw-r--r-- | lisp/calendar/cal-hebrew.el | 8 | ||||
-rw-r--r-- | lisp/calendar/cal-islam.el | 8 | ||||
-rw-r--r-- | lisp/calendar/calendar.el | 4 | ||||
-rw-r--r-- | lisp/calendar/diary-lib.el | 20 | ||||
-rw-r--r-- | lisp/calendar/solar.el | 2 |
7 files changed, 27 insertions, 27 deletions
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index d007e5b4546..c3f29e3d371 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el @@ -633,11 +633,11 @@ hour and minute parts." (min 0)) (string-match "[:.]\\([0-9][0-9]\\)" time2conv) - (setq min (string-to-int + (setq min (string-to-number (match-string 1 time2conv))) (string-match "[0-9]?[0-9][:.]" time2conv) - (setq hr (string-to-int + (setq hr (string-to-number (match-string 0 time2conv))) ;; convert the time appointment time into 24 hour time diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el index 2bcfaf648ec..7e6149d8e94 100644 --- a/lisp/calendar/cal-bahai.el +++ b/lisp/calendar/cal-bahai.el @@ -340,13 +340,13 @@ nongregorian-diary-marking-hook." (buffer-substring (match-beginning m-name-pos) (match-end m-name-pos)))) - (mm (string-to-int + (mm (string-to-number (if m-pos (buffer-substring (match-beginning m-pos) (match-end m-pos)) ""))) - (dd (string-to-int + (dd (string-to-number (if d-pos (buffer-substring (match-beginning d-pos) @@ -365,14 +365,14 @@ nongregorian-diary-marking-hook." (calendar-bahai-from-absolute (calendar-absolute-from-gregorian (calendar-current-date))))) - (y (+ (string-to-int y-str) + (y (+ (string-to-number y-str) (* 100 (/ current-y 100))))) (if (> (- y current-y) 50) (- y 100) (if (> (- current-y y) 50) (+ y 100) y))) - (string-to-int y-str))))) + (string-to-number y-str))))) (if dd-name (mark-calendar-days-named (cdr (assoc-string (substring dd-name 0 3) diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el index f66b4966e57..8f9f7723d5d 100644 --- a/lisp/calendar/cal-hebrew.el +++ b/lisp/calendar/cal-hebrew.el @@ -718,13 +718,13 @@ is provided for use as part of the nongregorian-diary-marking-hook." (buffer-substring (match-beginning m-name-pos) (match-end m-name-pos)))) - (mm (string-to-int + (mm (string-to-number (if m-pos (buffer-substring (match-beginning m-pos) (match-end m-pos)) ""))) - (dd (string-to-int + (dd (string-to-number (if d-pos (buffer-substring (match-beginning d-pos) @@ -743,14 +743,14 @@ is provided for use as part of the nongregorian-diary-marking-hook." (calendar-hebrew-from-absolute (calendar-absolute-from-gregorian (calendar-current-date))))) - (y (+ (string-to-int y-str) + (y (+ (string-to-number y-str) (* 100 (/ current-y 100))))) (if (> (- y current-y) 50) (- y 100) (if (> (- current-y y) 50) (+ y 100) y))) - (string-to-int y-str))))) + (string-to-number y-str))))) (if dd-name (mark-calendar-days-named (cdr (assoc-string dd-name diff --git a/lisp/calendar/cal-islam.el b/lisp/calendar/cal-islam.el index 1ac6f0677b1..786c71f24ce 100644 --- a/lisp/calendar/cal-islam.el +++ b/lisp/calendar/cal-islam.el @@ -337,13 +337,13 @@ provided for use as part of the nongregorian-diary-marking-hook." (buffer-substring (match-beginning m-name-pos) (match-end m-name-pos)))) - (mm (string-to-int + (mm (string-to-number (if m-pos (buffer-substring (match-beginning m-pos) (match-end m-pos)) ""))) - (dd (string-to-int + (dd (string-to-number (if d-pos (buffer-substring (match-beginning d-pos) @@ -362,14 +362,14 @@ provided for use as part of the nongregorian-diary-marking-hook." (calendar-islamic-from-absolute (calendar-absolute-from-gregorian (calendar-current-date))))) - (y (+ (string-to-int y-str) + (y (+ (string-to-number y-str) (* 100 (/ current-y 100))))) (if (> (- y current-y) 50) (- y 100) (if (> (- current-y y) 50) (+ y 100) y))) - (string-to-int y-str))))) + (string-to-number y-str))))) (if dd-name (mark-calendar-days-named (cdr (assoc-string dd-name diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 305ecc1e9bc..45754110319 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -2574,7 +2574,7 @@ ERROR is t, otherwise just returns nil." (if (not (looking-at " ")) (re-search-backward "[^0-9]")) (list month - (string-to-int (buffer-substring (1+ (point)) (+ 4 (point)))) + (string-to-number (buffer-substring (1+ (point)) (+ 4 (point)))) year)) (if (looking-at "\\*") (save-excursion @@ -2964,7 +2964,7 @@ calendar window has been prepared." (make-local-variable 'calendar-starred-day) (forward-char 1) (setq calendar-starred-day - (string-to-int + (string-to-number (buffer-substring (point) (- (point) 2)))) (delete-char -2) (insert "**") diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 1832e0cd0fb..312b8841cf9 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -205,7 +205,7 @@ Valid TYPEs are: string, symbol, int, stringtnil, tnil." (let (ret) (setq ret (cond ((eq type 'string) attrvalue) ((eq type 'symbol) (read attrvalue)) - ((eq type 'int) (string-to-int attrvalue)) + ((eq type 'int) (string-to-number attrvalue)) ((eq type 'stringtnil) (cond ((string= "t" attrvalue) t) ((string= "nil" attrvalue) nil) @@ -908,13 +908,13 @@ diary entries." (buffer-substring-no-properties (match-beginning m-name-pos) (match-end m-name-pos)))) - (mm (string-to-int + (mm (string-to-number (if m-pos (buffer-substring-no-properties (match-beginning m-pos) (match-end m-pos)) ""))) - (dd (string-to-int + (dd (string-to-number (if d-pos (buffer-substring-no-properties (match-beginning d-pos) @@ -931,7 +931,7 @@ diary entries." (let* ((current-y (extract-calendar-year (calendar-current-date))) - (y (+ (string-to-int y-str) + (y (+ (string-to-number y-str) (* 100 (/ current-y 100))))) (if (> (- y current-y) 50) @@ -939,7 +939,7 @@ diary entries." (if (> (- current-y y) 50) (+ y 100) y))) - (string-to-int y-str)))) + (string-to-number y-str)))) (save-excursion (setq entry (buffer-substring-no-properties (point) (line-end-position)) @@ -1149,22 +1149,22 @@ be used instead of a colon (:) to separate the hour and minute parts." (cond ((string-match ; Military time "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]?\\([0-9][0-9]\\)\\(\\>\\|[^ap]\\)" s) - (+ (* 100 (string-to-int + (+ (* 100 (string-to-number (substring s (match-beginning 1) (match-end 1)))) - (string-to-int (substring s (match-beginning 2) (match-end 2))))) + (string-to-number (substring s (match-beginning 2) (match-end 2))))) ((string-match ; Hour only XXam or XXpm "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)\\([ap]\\)m\\>" s) - (+ (* 100 (% (string-to-int + (+ (* 100 (% (string-to-number (substring s (match-beginning 1) (match-end 1))) 12)) (if (equal ?a (downcase (aref s (match-beginning 2)))) 0 1200))) ((string-match ; Hour and minute XX:XXam or XX:XXpm "\\`[ \t\n\\^M]*\\([0-9]?[0-9]\\)[:.]\\([0-9][0-9]\\)\\([ap]\\)m\\>" s) - (+ (* 100 (% (string-to-int + (+ (* 100 (% (string-to-number (substring s (match-beginning 1) (match-end 1))) 12)) - (string-to-int (substring s (match-beginning 2) (match-end 2))) + (string-to-number (substring s (match-beginning 2) (match-end 2))) (if (equal ?a (downcase (aref s (match-beginning 3)))) 0 1200))) (t diary-unknown-time)))) ; Unrecognizable diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index e1c4950b24b..8401aeb9bfd 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el @@ -227,7 +227,7 @@ Needed for polar areas, in order to know whether the day lasts 0 or 24 hours.") Returns nil if nothing was entered." (let ((x (read-string prompt ""))) (if (not (string-equal x "")) - (string-to-int x)))) + (string-to-number x)))) ;; The condition-case stuff is needed to catch bogus arithmetic ;; exceptions that occur on some machines (like Sparcs) |