* test-utf7.el (test-utf7-encode-string-alpha): Fix indent.
[elisp/wanderlust.git] / elmo / elmo-date.el
index 1f330fa..7d986ea 100644 (file)
 (require 'path-util)
 (require 'timezone)
 (require 'elmo-vars)
+(eval-when-compile (require 'cl))
 
 (defmacro elmo-match-substring (pos string from)
   "Substring of POSth matched string of STRING."
-  (` (substring (, string)
-               (+ (match-beginning (, pos)) (, from))
-               (match-end (, pos)))))
+  `(substring ,string
+             (+ (match-beginning ,pos) ,from)
+             (match-end ,pos)))
 
 (defmacro elmo-match-string (pos string)
   "Substring POSth matched STRING."
-  (` (substring (, string) (match-beginning (, pos)) (match-end (, pos)))))
+  `(substring ,string (match-beginning ,pos) (match-end ,pos)))
 
 (defmacro elmo-match-buffer (pos)
   "Substring POSth matched from the current buffer."
-  (` (buffer-substring-no-properties
-      (match-beginning (, pos)) (match-end (, pos)))))
+  `(buffer-substring-no-properties
+    (match-beginning ,pos) (match-end ,pos)))
 
 ;; from subr.el
 (defun elmo-replace-in-string (str regexp newtext &optional literal)
@@ -71,24 +72,23 @@ Otherwise treat \\ in NEWTEXT string as special:
             (substring str prev-start match)
             (cond (literal newtext)
                   (t (mapconcat
-                      (function
-                       (lambda (c)
-                         (if special
-                             (progn
-                               (setq special nil)
-                               (cond ((eq c ?\\) "\\")
-                                     ((eq c ?&)
-                                      (elmo-match-string 0 str))
-                                     ((and (>= c ?0) (<= c ?9))
-                                      (if (> c (+ ?0 (length
-                                                      (match-data))))
-                                          ;; Invalid match num
-                                          (error "Invalid match num: %c" c)
-                                        (setq c (- c ?0))
-                                        (elmo-match-string c str)))
-                                     (t (char-to-string c))))
-                           (if (eq c ?\\) (progn (setq special t) nil)
-                             (char-to-string c)))))
+                      (lambda (c)
+                        (if special
+                            (progn
+                              (setq special nil)
+                              (cond ((eq c ?\\) "\\")
+                                    ((eq c ?&)
+                                     (elmo-match-string 0 str))
+                                    ((and (>= c ?0) (<= c ?9))
+                                     (if (> c (+ ?0 (length
+                                                     (match-data))))
+                                         ;; Invalid match num
+                                         (error "Invalid match num: %c" c)
+                                       (setq c (- c ?0))
+                                       (elmo-match-string c str)))
+                                    (t (char-to-string c))))
+                          (if (eq c ?\\) (progn (setq special t) nil)
+                            (char-to-string c))))
                       newtext ""))))))
     (concat rtn-str (substring str start))))
 
@@ -115,7 +115,7 @@ Otherwise treat \\ in NEWTEXT string as special:
             (timezone-fix-time (current-time-string) (current-time-zone)
                                nil)))
          (number
-          (string-to-int
+          (string-to-number
            (if (match-beginning 1)
                (elmo-match-string 1 description)
              "0")))
@@ -202,14 +202,14 @@ Otherwise treat \\ in NEWTEXT string as special:
 
 (defmacro elmo-date-make-sortable-string (datevec)
   "Make a sortable string from DATEVEC."
-  (` (timezone-make-sortable-date
-      (aref (, datevec) 0)
-      (aref (, datevec) 1)
-      (aref (, datevec) 2)
-      (timezone-make-time-string
-       (aref (, datevec) 3)
-       (aref (, datevec) 4)
-       (aref (, datevec) 5)))))
+  `(timezone-make-sortable-date
+    (aref ,datevec 0)
+    (aref ,datevec 1)
+    (aref ,datevec 2)
+    (timezone-make-time-string
+     (aref ,datevec 3)
+     (aref ,datevec 4)
+     (aref ,datevec 5))))
 
 (defsubst elmo-datevec-to-time (datevec)
   (encode-time (aref datevec 5) (aref datevec 4) (aref datevec 3)