;; 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)))
(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)
(setq wl-alias-auto-alist
(elmo-object-load (expand-file-name
wl-alias-auto-file-name
- elmo-msgdb-dir)))))
+ elmo-msgdb-directory)))))
(setq wl-addrbook-alist (wl-addrbook-make-alist))
;; wl-alias-auto-alist is used independently so must use copy-alist
(if wl-addrbook-alist
(wl-addrbook-make-hashtb)
(add-hook 'kill-emacs-hook (function wl-addrbook-clean-up))
(add-hook 'wl-exit-hook (function wl-addrbook-clean-up))
- (message "Updating addrbook...done."))
+ (message "Updating addrbook...done"))
(defun wl-addrbook-clean-up ()
(remove-hook 'kill-emacs-hook (function wl-addrbook-clean-up))
(when wl-alias-auto-file-name
(elmo-object-save (expand-file-name
wl-alias-auto-file-name
- elmo-msgdb-dir)
+ elmo-msgdb-directory)
wl-alias-auto-alist)
(setq wl-alias-auto-alist nil)
(setq wl-addrbook-hashtb nil)))
;;
(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)
;;; Show nick name of Addrbook in summary.
;;;
-(defsubst wl-addrbook-get-names (names)
- (let (addrs)
- (mapconcat
- (function
- (lambda (name)
- (or (wl-addrbook-nickname-get
- (wl-address-header-extract-address name))
- (and (setq addrs (std11-extract-address-components name))
- (or (car addrs) (cadr addrs))))))
- (wl-parse-addresses names)
- ",")))
-
-(eval-when-compile (defvar-maybe entity nil)) ; silence byte compiler.
-(defun wl-summary-addrbook-from (from)
- "A candidate for wl-summary-from-function.
-Show destination in summary matched by `wl-summary-show-dest-folder-regexp'.
-And use Addrbook for get user name."
- (let ((fromaddr (wl-address-header-extract-address from))
- dest)
- (or
- (and (eq major-mode 'wl-summary-mode)
- (string-match wl-summary-showto-folder-regexp
- wl-summary-buffer-folder-name)
- (wl-address-user-mail-address-p fromaddr)
- (cond ((setq dest (elmo-msgdb-overview-entity-get-to entity))
- (concat "To:" (eword-decode-string (wl-addrbook-get-names dest))))
- ((setq dest (elmo-msgdb-overview-entity-get-extra-field
- entity "newsgroups"))
- (concat "Ng:" dest))))
- (wl-addrbook-nickname-get fromaddr)
- from)))
+(defun wl-addrbook-get-nickname (mailbox)
+ "For `wl-summary-get-petname-function'."
+ (wl-addrbook-nickname-get
+ (wl-address-header-extract-address mailbox)))
(provide 'wl-addrbook)