* wl-addrmgr.el (wl-addrmgr-replace-field): Use `point-at-bol'.
[elisp/wanderlust.git] / wl / wl-summary.el
index 5bd0f5b..a11dd16 100644 (file)
@@ -69,9 +69,9 @@
 
 (defvar wl-summary-buffer-elmo-folder nil)
 
-(defmacro wl-summary-buffer-folder-name ()
-  `(and wl-summary-buffer-elmo-folder
-       (elmo-folder-name-internal wl-summary-buffer-elmo-folder)))
+(defun wl-summary-buffer-folder-name ()
+  (and wl-summary-buffer-elmo-folder
+       (elmo-folder-name-internal wl-summary-buffer-elmo-folder)))
 
 (defvar wl-summary-buffer-disp-msg    nil)
 (defvar wl-summary-buffer-disp-folder nil)
 (defvar wl-temp-mark)
 (defvar wl-persistent-mark)
 
-(defmacro wl-summary-sticky-buffer-name (name)
-  `(concat wl-summary-buffer-name ":" ,name))
+(defun wl-summary-sticky-buffer-name (name)
+  (concat wl-summary-buffer-name ":" name))
 
 (defun wl-summary-default-subject (subject-string)
   (if (string-match "^[ \t]*\\[[^:]+[,: ][0-9]+\\][ \t]*" subject-string)
@@ -605,9 +605,9 @@ See also variable `wl-use-petname'."
       (setq wl-summary-buffer-message-ring
            (cdr wl-summary-buffer-message-ring)))))
 
-(defmacro wl-summary-message-status (&optional number)
-  `(elmo-message-status wl-summary-buffer-elmo-folder
-                       (or ,number (wl-summary-message-number))))
+(defsubst wl-summary-message-status (&optional number)
+  (elmo-message-status wl-summary-buffer-elmo-folder
+                      (or number (wl-summary-message-number))))
 
 (defun wl-summary-update-mark-and-highlight-window (&optional win beg)
   "A function to be called as window-scroll-functions."
@@ -828,6 +828,7 @@ you."
        wl-summary-highlight
        temp persistent)
     (with-temp-buffer
+      (set-buffer-multibyte t)
       (setq wl-summary-buffer-number-column column
            wl-summary-buffer-line-formatter formatter
            wl-summary-buffer-weekday-name-lang lang)
@@ -1430,16 +1431,16 @@ This function is defined by `wl-summary-define-sort-command'." sort-by)
       (setq fields (cdr fields)))
     (setq candidates (elmo-uniq-list candidates))
     (elmo-with-enable-multibyte
-      (mapcar (function
-              (lambda (x)
-                (setq components (std11-extract-address-components x))
-                (cons (nth 1 components)
-                      (and (car components)
-                           (eword-decode-string
-                            (decode-mime-charset-string
-                             (car components)
-                             mime-charset))))))
-             candidates))))
+      (mapcar
+       (lambda (x)
+        (setq components (std11-extract-address-components x))
+        (cons (nth 1 components)
+              (and (car components)
+                   (eword-decode-string
+                    (decode-mime-charset-string
+                     (car components)
+                     mime-charset)))))
+       candidates))))
 
 (defun wl-summary-edit-addresses-subr (the-email name-in-addr)
   ;; returns nil if there's no change.
@@ -1449,7 +1450,7 @@ This function is defined by `wl-summary-define-sort-command'." sort-by)
                 the-email)
        (while (not (or (eq (setq char (read-char)) ?\r)
                        (eq char ?\n)
-                       (eq char ? )
+                       (eq char (string-to-char " "))
                        (eq char ?e)
                        (eq char ?c)
                        (eq char ?d)))
@@ -1459,7 +1460,7 @@ This function is defined by `wl-summary-define-sort-command'." sort-by)
         ((or (eq char ?e)
              (eq char ?\n)
              (eq char ?\r)
-             (eq char ? ))
+             (eq char (string-to-char " ")))
          ;; Change Addresses
          (wl-address-add-or-change
           the-email
@@ -1508,7 +1509,7 @@ Optional argument ADDR-STR is used as a target address if specified."
                  (completing-read
                   (format "Target address (%s): " address)
                   (mapcar
-                   (function (lambda (x) (cons (car x) (car x))))
+                   (lambda (x) (cons (car x) (car x)))
                    candidates)
                   nil nil nil nil address))))
        (when address
@@ -1626,12 +1627,12 @@ If ARG is non-nil, checking is omitted."
   (narrow-to-region
    (save-excursion
      (goto-char beg)
-     (beginning-of-line)
-     (point))
+     (point-at-bol))
    (save-excursion
      (goto-char end)
-     (if (eq (current-column) 0) (beginning-of-line) (end-of-line))
-     (point))))
+     (if (= (current-column) 0)
+        (point-at-bol)
+       (point-at-eol)))))
 
 (defun wl-summary-prefetch-region-no-mark (beg end &optional prefetch-marks)
   (interactive "r")
@@ -2126,7 +2127,7 @@ This function is defined for `window-scroll-functions'"
   (when number
     (let ((pos (point))
          regexp)
-      (setq regexp (concat "\r" (int-to-string number) "[^0-9]"))
+      (setq regexp (concat "\r" (number-to-string number) "[^0-9]"))
       (if (and beg end (or (< pos beg) (< end pos)))
          (progn
            (goto-char beg)
@@ -2587,8 +2588,7 @@ If ARG, without confirm."
   (if wl-use-highlight-mouse-line
       ;; remove 'mouse-face of current line.
       (put-text-property
-       (save-excursion (beginning-of-line)(point))
-       (save-excursion (end-of-line)(point))
+       (point-at-bol) (point-at-eol)
        'mouse-face nil))
   (insert line "\n")
   (save-excursion
@@ -2600,8 +2600,7 @@ If ARG, without confirm."
   (if wl-use-highlight-mouse-line
       ;; remove 'mouse-face of current line.
       (put-text-property
-       (save-excursion (beginning-of-line)(point))
-       (save-excursion (end-of-line)(point))
+       (point-at-bol) (point-at-eol)
        'mouse-face nil))
   (elmo-progress-notify 'wl-summary-insert-line)
   (ignore-errors
@@ -2635,9 +2634,9 @@ If ARG, without confirm."
                      ,alike
                      wl-summary-alike-hashtb))
 
-(defmacro wl-summary-get-alike ()
-  `(elmo-get-hash-val (format "#%d" (wl-count-lines))
-                     wl-summary-alike-hashtb))
+(defsubst wl-summary-get-alike ()
+  (elmo-get-hash-val (format "#%d" (wl-count-lines))
+                    wl-summary-alike-hashtb))
 
 (defun wl-summary-insert-headers (folder func &optional mime-decode)
   (let ((numbers (elmo-folder-list-messages folder 'visible t))
@@ -2680,10 +2679,9 @@ If ARG, without confirm."
          (message "Creating subject cache...")
          (wl-summary-insert-headers
           folder
-          (function
-           (lambda (x)
-             (funcall wl-summary-subject-filter-function
-                      (elmo-message-entity-field x 'subject)))))
+          (lambda (x)
+            (funcall wl-summary-subject-filter-function
+                     (elmo-message-entity-field x 'subject))))
          (message "Creating subject cache...done"))
        (setq match (funcall wl-summary-subject-filter-function
                             (elmo-message-entity-field entity 'subject)))
@@ -3752,7 +3750,7 @@ Return non-nil if the mark is updated"
     (setq range
          (completing-read (format "Range (%s): " default)
                           (mapcar
-                           (function (lambda (x) (cons x x)))
+                           (lambda (x) (cons x x))
                            input-range-list)))
     (if (string= range "")
        default
@@ -4778,7 +4776,7 @@ If ARG is numeric number, decode message as following:
     (if num
        (save-excursion
          (setq filename (expand-file-name
-                         (concat (int-to-string num)
+                         (concat (number-to-string num)
                                  wl-summary-save-file-suffix)
                          wl-save-dir))
          (when (or (null arg)