This commit was manufactured by cvs2svn to create branch 'elmo-imap4-new-
[elisp/wanderlust.git] / utils / wl-addrbook.el
index 36f80fd..e03b94b 100644 (file)
@@ -26,7 +26,7 @@
   "*Regular expression for \".im/Addrbook\".")
 (defvar wl-addrbook-override-by-newone t
   "If non-nil, the 'user' entry in 'wl-alias-auto-alist'
-is override by a new entry of (user different-address). 
+is override by a new entry of (user different-address).
 This means that addresses in To: and Cc: in Draft mode are
 always learned with an exception 'user' is defined in Addrbook.
 If nil,  the old 'user' entry remains.")
@@ -100,8 +100,8 @@ If nil,  the old 'user' entry remains.")
 
 ;; hash table for wl-addrbook-alist
 (defmacro wl-addrbook-hashtb ()
-  (` (or wl-addrbook-hashtb
-        (setq wl-addrbook-hashtb (elmo-make-hash 1021)))))
+  '(or wl-addrbook-hashtb
+       (setq wl-addrbook-hashtb (elmo-make-hash 1021))))
 
 (defsubst wl-addrbook-get-record-by-addr (addr &optional alist)
   (elmo-get-hash-val (downcase addr) (wl-addrbook-hashtb)))
@@ -137,7 +137,7 @@ If nil,  the old 'user' entry remains.")
   (setq wl-address-init-function 'wl-addrbook-init)
   ;;
   (when wl-summary-use-addrbook-from-func
-    (setq wl-summary-from-function 'wl-summary-addrbook-from))
+    (setq wl-summary-get-petname-function 'wl-addrbook-get-nickname))
   (define-key wl-summary-mode-map "\C-c\C-a" 'wl-summary-addrbook-add)
   (define-key wl-draft-mode-map "\C-i"     'wl-draft-addrbook-header-comp-or-tab)
   (define-key wl-draft-mode-map "\e\t"     'wl-draft-addrbook-expand)
@@ -180,10 +180,10 @@ If nil,  the old 'user' entry remains.")
 ;;
 
 (defmacro wl-alias-get (key)
-  (` (wl-addrbook-alias-get (, key) wl-addrbook-alist)))
+  `(wl-addrbook-alias-get ,key wl-addrbook-alist))
 
 (defmacro wl-alias-next (key)
-  (` (wl-addrbook-alias-next (, key) wl-addrbook-alist)))
+  `(wl-addrbook-alias-next ,key wl-addrbook-alist))
 
 (defalias 'wl-addrbook-alias-hit 'wl-addrbook-get-record-by-alias)
 
@@ -242,7 +242,7 @@ If addresses is a string, expands it recursively."
            (setq wl-alias-auto-alist
                  (cons (list user addr)
                        (delete match-auto wl-alias-auto-alist))))
-          (t 
+          (t
            ;; the old entry remains
            )))
         (match-adbk
@@ -310,7 +310,7 @@ If addresses is a string, expands it recursively."
     (while (re-search-forward ",[ \t]*$" nil t)
       (end-of-line)
       (forward-char 1)
-      (delete-backward-char 1)
+      (delete-char -1)
       (delete-horizontal-space))
     ;; unquote, replace white spaces to "\0".
     (if unquote
@@ -319,11 +319,11 @@ If addresses is a string, expands it recursively."
          (while (re-search-forward "[\"']" nil t)
            (setq qchar (char-before (point)))
            ;; (point) is for backward compatibility
-           (backward-delete-char 1) ;; delete quote
+           (delete-char -1)            ; delete quote
            (setq beg (point))
            (if (not (re-search-forward (char-to-string qchar) nil t))
                (throw 'quote nil) ;; error
-             (backward-delete-char 1) ;; delete quote
+             (delete-char -1)     ; delete quote
              (save-restriction
                (narrow-to-region beg (point))
                (goto-char (point-min))
@@ -365,7 +365,7 @@ If addresses is a string, expands it recursively."
 
 (defun wl-draft-learn-alias ()
   (interactive)
-  (let ((recipients (mapconcat 'identity 
+  (let ((recipients (mapconcat 'identity
                               (delq nil (std11-field-bodies '("To" "Cc")))
                               ",")))
     (mapcar '(lambda (addr)
@@ -400,8 +400,7 @@ it will add an alias."
   (wl-summary-redisplay)
   (let ((buf wl-message-buffer)
        from shortname address addrs name)
-    (save-excursion
-      (set-buffer buf)
+    (with-current-buffer buf
       (setq address (std11-field-body "From"))
       (if (wl-address-user-mail-address-p address)
          (setq address (std11-field-body "To")))
@@ -503,7 +502,7 @@ The keys that are defined for this mode are:
         (set-buffer buf)
         (goto-char (point-min))
         (if (and shortname
-                 (re-search-forward 
+                 (re-search-forward
                   (concat "^" (regexp-quote shortname) "[ \t]*:?[ \t]+") nil t))
             (setq not-uniq t))
         (if not-uniq
@@ -569,7 +568,7 @@ The keys that are defined for this mode are:
 ;; Redistribution and use in source and binary forms, with or without
 ;; modification, are permitted provided that the following conditions
 ;; are met:
-;; 
+;;
 ;; 1. Redistributions of source code must retain the above copyright
 ;;    notice, this list of conditions and the following disclaimer.
 ;; 2. Redistributions in binary form must reproduce the above copyright
@@ -578,7 +577,7 @@ The keys that are defined for this mode are:
 ;; 3. Neither the name of the team nor the names of its contributors
 ;;    may be used to endorse or promote products derived from this software
 ;;    without specific prior written permission.
-;; 
+;;
 ;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
 ;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR