(toplevel): Added autoload setting for wl-acap.
* wl-vars.el (wl-setting): New custom group.
(wl-from): Added wl-setting group.
(wl-user-mail-address-list): Ditto.
(wl-organization): Ditto.
(wl-subscribed-mailing-list): Ditto.
(wl-envelope-from): Ditto.
(wl-smtp-posting-user): Ditto.
(wl-smtp-posting-server): Ditto.
(wl-smtp-posting-port): Ditto.
(wl-smtp-authenticate-type): Ditto.
(wl-pop-before-smtp-user): Ditto.
(wl-pop-before-smtp-server): Ditto.
(wl-pop-before-smtp-port): Ditto.
(wl-pop-before-smtp-authenticate-type): Ditto.
(wl-nntp-posting-server): Ditto.
(wl-nntp-posting-user): Ditto.
(wl-nntp-posting-port): Ditto.
(wl-fetch-confirm-threshold): Ditto.
(wl-prefetch-threshold): Ditto.
(wl-thread-insert-opened): Ditto.
(wl-ldap-server): Ditto.
(wl-ldap-port): Ditto.
(wl-ldap-base): Ditto.
(wl-ldap-objectclass): Ditto.
(wl-use-ldap): Ditto.
(wl-draft-config-alist): Ditto.
(wl-draft-config-matchone): Ditto.
(wl-template-alist): Ditto.
(wl-message-sort-field-list): Ditto.
(wl-message-ignored-field-list): Ditto.
(wl-message-visible-field-list): Ditto.
(wl-interactive-send): Ditto.
(wl-summary-move-order): Ditto.
(wl-auto-select-first): Ditto.
(wl-auto-select-next): Ditto.
(wl-interactive-save-folders): Ditto.
* wl-folder.el (wl-folder): Moved position of `wl-folder-init';
Initialization codes are moved from wl-local-folder-init.
(wl-local-folder-init): Follow the change above.
(wl-folder-init): Call `wl-acap-init' when `wl-use-acap' is non-nil.
* wl-acap.el: New file.
* elmo-imap4.el (elmo-imap4-default-mailbox,
elmo-imap4-default-server
elmo-imap4-default-authenticate-type,
elmo-imap4-default-user,
elmo-imap4-default-port,
elmo-imap4-default-stream-type,
elmo-imap4-stream-type-alist): Moved to elmo-vars.el.
* elmo-pop3.el (elmo-pop3-default-user,
elmo-pop3-default-server,
elmo-pop3-default-authenticate-type,
elmo-pop3-default-port,
elmo-pop3-default-stream-type,
elmo-pop3-stream-type-alist): Ditto.
* elmo-nntp.el (elmo-nntp-default-server,
elmo-nntp-default-user,
elmo-nntp-default-port,
elmo-nntp-default-stream-type,
elmo-nntp-stream-type-alist): Ditto.
* elmo-vars.el: Follow changes above.
(elmo-setting): New custom group; added 'elmo-setting group to
above variables.
* acap.el (acap-parse-response): Don't delete process when BYE
response (It causes hang-up on slow network environment).
(toplevel): Added comment.
* WL-ELS (WL-MODULES): Added wl-acap.
+2001-08-29 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * WL-ELS (WL-MODULES): Added wl-acap.
+
2001-08-28 Katsumi Yamaoka <yamaoka@jpl.org>
* WL-MK: Byte-optimize the function `char-after' for old Emacsen.
wl wl-folder wl-summary wl-message
wl-vars wl-draft wl-util wl-version wl-address wl-addrmgr
wl-highlight wl-demo wl-refile wl-thread
- wl-fldmgr wl-expire wl-template wl-score
+ wl-fldmgr wl-expire wl-template wl-score wl-acap
))
(defconst ELMO-MODULES '(
2001-08-29 Yuuichi Teranishi <teranisi@gohome.org>
+ * elmo-imap4.el (elmo-imap4-default-mailbox,
+ elmo-imap4-default-server
+ elmo-imap4-default-authenticate-type,
+ elmo-imap4-default-user,
+ elmo-imap4-default-port,
+ elmo-imap4-default-stream-type,
+ elmo-imap4-stream-type-alist): Moved to elmo-vars.el.
+
+ * elmo-pop3.el (elmo-pop3-default-user,
+ elmo-pop3-default-server,
+ elmo-pop3-default-authenticate-type,
+ elmo-pop3-default-port,
+ elmo-pop3-default-stream-type,
+ elmo-pop3-stream-type-alist): Ditto.
+
+ * elmo-nntp.el (elmo-nntp-default-server,
+ elmo-nntp-default-user,
+ elmo-nntp-default-port,
+ elmo-nntp-default-stream-type,
+ elmo-nntp-stream-type-alist): Ditto.
+
+ * elmo-vars.el: Follow changes above.
+ (elmo-setting): New custom group; added 'elmo-setting group to
+ above variables.
+
* elmo-version.el (elmo-version): Up to 2.7.3.
* acap.el (acap-parse-response): Don't delete process when BYE
;;
;; (acap-close proc)
;; => t
+;;
+;; Todo:
+;; * Send literal data for STORE.
;;; History:
;;
;;; Code:
(eval-when-compile (require 'cl))
-;;; User options.
-(defcustom elmo-imap4-default-mailbox "inbox"
- "*Default IMAP4 mailbox."
- :type 'string
- :group 'elmo)
-
-(defcustom elmo-imap4-default-server "localhost"
- "*Default IMAP4 server."
- :type 'string
- :group 'elmo)
-
-(defcustom elmo-imap4-default-authenticate-type 'login
- "*Default Authentication type for IMAP4."
- :type 'symbol
- :group 'elmo)
-
-(defcustom elmo-imap4-default-user (or (getenv "USER")
- (getenv "LOGNAME")
- (user-login-name))
- "*Default username for IMAP4."
- :type 'string
- :group 'elmo)
-
-(defcustom elmo-imap4-default-port 143
- "*Default Port number of IMAP."
- :type 'integer
- :group 'elmo)
-
-(defcustom elmo-imap4-default-stream-type nil
- "*Default stream type for IMAP4.
-Any symbol value of `elmo-network-stream-type-alist' or
-`elmo-imap4-stream-type-alist'."
- :type 'symbol
- :group 'elmo)
-
-(defvar elmo-imap4-stream-type-alist nil
- "*Stream bindings for IMAP4.
-This is taken precedence over `elmo-network-stream-type-alist'.")
-
(defvar elmo-imap4-disuse-server-flag-mailbox-regexp "^#mh" ; UW imapd
"Regexp to match IMAP4 mailbox names whose message flags on server should be ignored.
(Except `\\Deleted' flag).")
(require 'elmo)
(require 'elmo-net)
-;; User options
-(defcustom elmo-nntp-default-server "localhost"
- "*Default NNTP server."
- :type 'string
- :group 'elmo)
-
-(defcustom elmo-nntp-default-user nil
- "*Default User of NNTP. nil means no user authentication."
- :type 'string
- :group 'elmo)
-
-(defcustom elmo-nntp-default-port 119
- "*Default Port number of NNTP."
- :type 'integer
- :group 'elmo)
-
-(defcustom elmo-nntp-default-stream-type nil
- "*Default stream type for NNTP.
-Any symbol value of `elmo-network-stream-type-alist' or
-`elmo-nntp-stream-type-alist'."
- :type 'symbol
- :group 'elmo)
-
-(defvar elmo-nntp-stream-type-alist nil
- "*Stream bindings for NNTP.
-This is taken precedence over `elmo-network-stream-type-alist'.")
-
(defvar elmo-nntp-overview-fetch-chop-length 200
"*Number of overviews to fetch in one request in nntp.")
(eval-and-compile
(autoload 'md5 "md5"))
-;; POP3
-(defcustom elmo-pop3-default-user (or (getenv "USER")
- (getenv "LOGNAME")
- (user-login-name))
- "*Default username for POP3."
- :type 'string
- :group 'elmo)
-
-(defcustom elmo-pop3-default-server "localhost"
- "*Default POP3 server."
- :type 'string
- :group 'elmo)
-
-(defcustom elmo-pop3-default-authenticate-type 'user
- "*Default Authentication type for POP3."
- :type 'symbol
- :group 'elmo)
-
-(defcustom elmo-pop3-default-port 110
- "*Default POP3 port."
- :type 'integer
- :group 'elmo)
-
-(defcustom elmo-pop3-default-stream-type nil
- "*Default stream type for POP3.
-Any symbol value of `elmo-network-stream-type-alist' or
-`elmo-pop3-stream-type-alist'."
- :type 'symbol
- :group 'elmo)
-
(defcustom elmo-pop3-default-use-uidl t
"If non-nil, use UIDL on POP3."
:type 'boolean
:group 'elmo)
-(defvar elmo-pop3-stream-type-alist nil
- "*Stream bindings for POP3.
-This is taken precedence over `elmo-network-stream-type-alist'.")
-
(defvar elmo-pop3-use-uidl-internal t
"(Internal switch for using UIDL on POP3).")
(defgroup elmo nil
"ELMO, Elisp Library for Message Orchestration."
:tag "ELMO"
+ :prefix "elmo-"
:group 'news
:group 'mail)
+(defgroup elmo-setting nil
+ "ELMO common settings."
+ :prefix "elmo-"
+ :group 'elmo)
+
;; Local
(defvar elmo-localnews-folder-path "~/News"
"*Local news folder path.")
"A hook called when message is deleted from database.")
(defvar elmo-nntp-post-pre-hook nil
"A hook called just before the nntp posting.")
-(defvar elmo-lang "ja"
- "Language for displayed messages.")
+
+;;; IMAP4
+
+(defcustom elmo-imap4-default-mailbox "inbox"
+ "*Default IMAP4 mailbox."
+ :type 'string
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-imap4-default-server "localhost"
+ "*Default IMAP4 server."
+ :type 'string
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-imap4-default-authenticate-type 'login
+ "*Default Authentication type for IMAP4."
+ :type 'symbol
+ :group 'elmo)
+
+(defcustom elmo-imap4-default-user (or (getenv "USER")
+ (getenv "LOGNAME")
+ (user-login-name))
+ "*Default username for IMAP4."
+ :type 'string
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-imap4-default-port 143
+ "*Default Port number of IMAP."
+ :type 'integer
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-imap4-default-stream-type nil
+ "*Default stream type for IMAP4.
+Any symbol value of `elmo-network-stream-type-alist' or
+`elmo-imap4-stream-type-alist'."
+ :type 'symbol
+ :group 'elmo)
+
+(defvar elmo-imap4-stream-type-alist nil
+ "*Stream bindings for IMAP4.
+This is taken precedence over `elmo-network-stream-type-alist'.")
+
+;;; NNTP
+
+;; User options
+(defcustom elmo-nntp-default-server "localhost"
+ "*Default NNTP server."
+ :type 'string
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-nntp-default-user nil
+ "*Default User of NNTP. nil means no user authentication."
+ :type 'string
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-nntp-default-port 119
+ "*Default Port number of NNTP."
+ :type 'integer
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-nntp-default-stream-type nil
+ "*Default stream type for NNTP.
+Any symbol value of `elmo-network-stream-type-alist' or
+`elmo-nntp-stream-type-alist'."
+ :type 'symbol
+ :group 'elmo)
+
+(defvar elmo-nntp-stream-type-alist nil
+ "*Stream bindings for NNTP.
+This is taken precedence over `elmo-network-stream-type-alist'.")
+
+;;; POP3
+
+;; POP3
+(defcustom elmo-pop3-default-user (or (getenv "USER")
+ (getenv "LOGNAME")
+ (user-login-name))
+ "*Default username for POP3."
+ :type 'string
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-pop3-default-server "localhost"
+ "*Default POP3 server."
+ :type 'string
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-pop3-default-authenticate-type 'user
+ "*Default Authentication type for POP3."
+ :type 'symbol
+ :group 'elmo)
+
+(defcustom elmo-pop3-default-port 110
+ "*Default POP3 port."
+ :type 'integer
+ :group 'elmo
+ :group 'elmo-setting)
+
+(defcustom elmo-pop3-default-stream-type nil
+ "*Default stream type for POP3.
+Any symbol value of `elmo-network-stream-type-alist' or
+`elmo-pop3-stream-type-alist'."
+ :type 'symbol
+ :group 'elmo)
+
+(defvar elmo-pop3-stream-type-alist nil
+ "*Stream bindings for POP3.
+This is taken precedence over `elmo-network-stream-type-alist'.")
+
+(defcustom elmo-lang "ja"
+ "Language for displayed messages."
+ :type 'string
+ :group 'elmo-setting)
(defvar elmo-mime-charset 'iso-2022-jp)
2001-08-29 Yuuichi Teranishi <teranisi@gohome.org>
+ * wl.el (wl): Changed position of `wl-check-environment'.
+ (toplevel): Added autoload setting for wl-acap.
+
+ * wl-vars.el (wl-setting): New custom group.
+ (wl-from): Added wl-setting group.
+ (wl-user-mail-address-list): Ditto.
+ (wl-organization): Ditto.
+ (wl-subscribed-mailing-list): Ditto.
+ (wl-envelope-from): Ditto.
+ (wl-smtp-posting-user): Ditto.
+ (wl-smtp-posting-server): Ditto.
+ (wl-smtp-posting-port): Ditto.
+ (wl-smtp-authenticate-type): Ditto.
+ (wl-pop-before-smtp-user): Ditto.
+ (wl-pop-before-smtp-server): Ditto.
+ (wl-pop-before-smtp-port): Ditto.
+ (wl-pop-before-smtp-authenticate-type): Ditto.
+ (wl-nntp-posting-server): Ditto.
+ (wl-nntp-posting-user): Ditto.
+ (wl-nntp-posting-port): Ditto.
+ (wl-fetch-confirm-threshold): Ditto.
+ (wl-prefetch-threshold): Ditto.
+ (wl-thread-insert-opened): Ditto.
+ (wl-ldap-server): Ditto.
+ (wl-ldap-port): Ditto.
+ (wl-ldap-base): Ditto.
+ (wl-ldap-objectclass): Ditto.
+ (wl-use-ldap): Ditto.
+ (wl-draft-config-alist): Ditto.
+ (wl-draft-config-matchone): Ditto.
+ (wl-template-alist): Ditto.
+ (wl-message-sort-field-list): Ditto.
+ (wl-message-ignored-field-list): Ditto.
+ (wl-message-visible-field-list): Ditto.
+ (wl-interactive-send): Ditto.
+ (wl-summary-move-order): Ditto.
+ (wl-auto-select-first): Ditto.
+ (wl-auto-select-next): Ditto.
+ (wl-interactive-save-folders): Ditto.
+
+ * wl-folder.el (wl-folder): Moved position of `wl-folder-init';
+ Initialization codes are moved from wl-local-folder-init.
+ (wl-local-folder-init): Follow the change above.
+ (wl-folder-init): Call `wl-acap-init' when `wl-use-acap' is non-nil.
+
+ * wl-acap.el: New file.
+
* Version number is increased to 2.7.3.
2001-08-21 Kenichi OKADA <okada@opaopa.org>
--- /dev/null
+;;; wl-acap.el -- ACAP support for Wanderlust.
+
+;; Copyright (C) 2001 Yuuichi Teranishi <teranisi@gohome.org>
+
+;; Author: Yuuichi Teranishi <teranisi@gohome.org>
+;; Keywords: mail, net news
+
+;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen).
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+;;
+
+;;; Commentary:
+
+;;; Code:
+;;
+
+(require 'custom)
+(require 'cus-edit)
+(require 'wl-vars)
+(require 'elmo-vars)
+(require 'acap)
+(require 'slp)
+
+(eval-and-compile
+ (cond
+ ((and (featurep 'xemacs)
+ (module-installed-p 'xemacs-ucs))
+ (require 'xemacs-ucs))
+ ((module-installed-p 'un-define)
+ (require 'un-define))))
+
+(defconst wl-acap-dataset-class "vendor.wanderlust")
+(defconst wl-acap-entry-name "settings")
+
+(defcustom wl-acap-user (or (getenv "USER")
+ (getenv "LOGNAME")
+ (user-login-name))
+ "ACAP user."
+ :type 'string
+ :group 'wl)
+
+(defcustom wl-acap-server nil
+ "ACAP server.
+If nil, SLP is used to find ACAP server.
+If nil and SLP is not available, localhost is assumed."
+ :type 'string
+ :group 'wl)
+
+(defcustom wl-acap-port nil
+ "ACAP server port.
+Only valid when `wl-acap-server' is non-nil.
+If nil, default acap port is used."
+ :type 'string
+ :group 'wl)
+
+(defcustom wl-acap-authenticate-type 'cram-md5
+ "ACAP authenticate type."
+ :type 'symbol
+ :group 'wl)
+
+(defcustom wl-acap-stream-type nil
+ "ACAP stream type."
+ :type 'symbol
+ :group 'wl)
+
+(defcustom wl-acap-extra-options nil
+ "Extra options to be saved on ACAP server."
+ :type '(repeat symbol)
+ :group 'wl)
+
+;; Encoding string as BASE64 is temporal solution.
+;; As far as I know, current implementation of ACAP server
+;; (cyrus-smlacapd 0.5) does not accept literal argument for STORE.
+(defvar wl-acap-base64-encode-options
+ '(wl-template-alist
+ wl-draft-config-alist)
+ "Options which should be encoded with base64 to store ACAP server.")
+
+(defcustom wl-acap-coding-system 'utf-8
+ "Coding system for ACAP."
+ :type 'symbol
+ :group 'wl)
+
+(defun wl-acap-init ()
+ "A candidate for `wl-folder-init-function'."
+ (let ((service (wl-acap-find-acap-service))
+ proc entries settings folder-top type)
+ (setq proc (acap-open (car service)
+ wl-acap-user
+ (upcase (symbol-name wl-acap-authenticate-type))
+ (cdr service)))
+ (setq entries (acap-response-entries
+ (acap-search proc (concat "/"
+ wl-acap-dataset-class
+ "/~/")
+ '((RETURN ("*"))))))
+ (while entries
+ (when (string= (acap-response-entry-entry (car entries))
+ wl-acap-entry-name)
+ (setq settings (car (acap-response-entry-return-data-list
+ (car entries)))
+ entries nil))
+ (setq entries (cdr entries)))
+ (setq settings
+ (delq
+ 'wl-acap-ignored
+ (mapcar (lambda (x)
+ (let ((sym (wl-acap-symbol (car x))))
+ (cond
+ ((and sym (eq sym 'wl-folders))
+ ;; Folders.
+ (setq wl-folder-entity
+ (wl-acap-create-folder-entity (cadr x)))
+ 'wl-acap-ignored)
+ ((and sym (boundp sym))
+ (setq type (custom-variable-type sym))
+ (cons
+ sym
+ (when (cadr x)
+ (cond
+ ((or (eq (car type) 'string)
+ (and (eq (car type) 'choice)
+ (memq 'string type)))
+ (if (memq sym wl-acap-base64-encode-options)
+ (wl-acap-base64-decode-string (cadr x))
+ (cadr x)))
+ (t
+ (if (cadr x)
+ (read
+ (if (memq sym
+ wl-acap-base64-encode-options)
+ (wl-acap-base64-decode-string (cadr x))
+ (read (concat "\"" (cadr x) "\""))))))))))
+ (t 'wl-acap-ignored))))
+ settings)))
+ ;; Setup options.
+ (dolist (setting settings)
+ (set (car setting) (cdr setting)))
+ ;; Database directory becomes specific to the ACAP server.
+ (setq elmo-msgdb-dir (expand-file-name
+ (concat "acap/" (car service) "/" wl-acap-user)
+ elmo-msgdb-dir))
+ (acap-close proc)))
+
+(defun wl-acap-create-folder-entity (string)
+ (with-temp-buffer
+ (message "Initializing folder...")
+ (let (folders)
+ (setq string (elmo-base64-decode-string string))
+ (setq string (decode-coding-string string wl-acap-coding-system))
+ (insert string)
+ (goto-char (point-min))
+ (while (and (not (eobp))
+ (setq entity (wl-create-folder-entity-from-buffer)))
+ (unless (eq entity 'ignore)
+ (wl-append folders (list entity))))
+ (message "Initializing folder...done")
+ (list wl-folder-desktop-name 'group folders))))
+
+(defun wl-acap-find-acap-service ()
+ (or (and wl-acap-server
+ (cons wl-acap-server wl-acap-port))
+ (with-temp-buffer
+ (message "Searching ACAP server...")
+ (prog1 (let ((response (condition-case nil
+ (slp-findsrvs "acap")
+ (error))))
+ (when response
+ ;; Only the first service entry is used.
+ (setq response (car (slp-response-body response)))
+ (cons (slp-response-srv-url-host response)
+ (slp-response-srv-url-port response))))
+ (message "Searching ACAP server...done.")))
+ (cons "localhost" nil)))
+
+(defun wl-acap-name (option)
+ (let ((name (symbol-name option))
+ prefix)
+ (cond ((string-match "^wl-" name)
+ (setq name (substring name (match-end 0))
+ prefix "wl"))
+ ((string-match "^elmo-" name)
+ (setq name (substring name (match-end 0))
+ prefix "elmo")))
+ (concat
+ wl-acap-dataset-class "." prefix "."
+ (mapconcat 'capitalize (split-string name "-") ""))))
+
+(defun wl-acap-symbol (name)
+ (let (case-fold-search li)
+ (when (string-match (concat "^" (regexp-quote wl-acap-dataset-class)
+ "\\.\\([^\\.]+\\)\\.") name)
+ (setq li (list (match-string 1 name))
+ name (substring name (match-end 0)))
+ (while (string-match "^[A-Z][a-z0-9]*" name)
+ (setq li (cons (match-string 0 name) li))
+ (setq name (substring name (match-end 0))))
+ (intern (mapconcat 'downcase (nreverse li) "-")))))
+
+(defun wl-acap-list-options ()
+ (nconc (mapcar 'car (append (custom-group-members 'wl-setting nil)
+ (custom-group-members 'elmo-setting nil)))
+ wl-acap-extra-options))
+
+(defun wl-acap-store-folders (proc)
+ (with-temp-buffer
+ (insert-file-contents wl-folders-file)
+ (acap-store
+ proc
+ (list (concat "/" wl-acap-dataset-class "/~/"
+ wl-acap-entry-name)
+ (concat wl-acap-dataset-class ".wl.Folders")
+ (wl-acap-base64-encode-string (buffer-string))))))
+
+(defun wl-acap-base64-encode-string (string)
+ (elmo-base64-encode-string
+ (encode-coding-string string wl-acap-coding-system)
+ 'no-line-break))
+
+(defun wl-acap-base64-decode-string (string)
+ (decode-coding-string
+ (elmo-base64-decode-string string )
+ wl-acap-coding-system))
+
+(defun wl-acap-store ()
+ "Store Wanderlust configuration to the ACAP server."
+ (interactive)
+ (wl-load-profile)
+ (let ((service (wl-acap-find-acap-service))
+ proc settings type)
+ (setq proc (acap-open (car service)
+ wl-acap-user
+ (upcase (symbol-name wl-acap-authenticate-type))
+ (cdr service)))
+ (dolist (option (wl-acap-list-options))
+ (setq settings
+ (cons (wl-acap-name option) settings)
+ settings
+ (cons (when (symbol-value option)
+ (setq type (custom-variable-type option))
+ (cond
+ ((or (eq (car type) 'string)
+ (and (eq (car type) 'choice)
+ (memq 'string type)))
+ (if (memq option wl-acap-base64-encode-options)
+ (wl-acap-base64-encode-string
+ (symbol-value option))
+ (symbol-value option)))
+ (t (if (memq option wl-acap-base64-encode-options)
+ (wl-acap-base64-encode-string
+ (prin1-to-string (symbol-value option)))
+ (prin1-to-string (symbol-value option))))))
+ settings)))
+ (unwind-protect
+ (progn
+ (message "Storing settings...")
+ (acap-store proc
+ (nconc
+ (list
+ (concat
+ "/" wl-acap-dataset-class "/~/" wl-acap-entry-name))
+ (nreverse settings)))
+ (message "Storing folders...")
+ (wl-acap-store-folders proc))
+ (acap-close proc))
+ (if (interactive-p)
+ (message "Store completed."))))
+
+(provide 'wl-acap)
+
+;;; wl-acap.el ends here
(defun wl-folder (&optional arg)
(interactive "P")
(let (initialize folder-buf)
+ (unless (get-buffer wl-folder-buffer-name)
+ (wl-folder-init))
(if (setq folder-buf (get-buffer wl-folder-buffer-name))
(if wl-folder-use-frame
(let (select-frame)
(switch-to-buffer (get-buffer-create wl-folder-buffer-name)))
(set-buffer wl-folder-buffer-name)
(wl-folder-mode)
- (wl-folder-init)
+ ;; Initialization.
+ (setq wl-folder-entity-id 0)
+ (wl-folder-entity-assign-id wl-folder-entity)
+ (setq wl-folder-entity-hashtb
+ (wl-folder-create-entity-hashtb wl-folder-entity))
+ (setq wl-folder-elmo-folder-hashtb (elmo-make-hash wl-folder-entity-id))
+ (setq wl-folder-group-alist
+ (wl-folder-create-group-alist wl-folder-entity))
+ (setq wl-folder-newsgroups-hashtb
+ (wl-folder-create-newsgroups-hashtb wl-folder-entity))
+ (wl-folder-init-info-hashtb)
(let ((inhibit-read-only t)
(buffer-read-only nil))
(erase-buffer)
(defvar wl-folder-init-function 'wl-local-folder-init)
(defun wl-folder-init ()
- "Call `wl-folder-init-function' function."
+ "Return top-level folder entity."
(interactive)
- (funcall wl-folder-init-function))
+ (if wl-use-acap
+ (wl-acap-init)
+ (funcall wl-folder-init-function)))
(defun wl-local-folder-init ()
"Initialize local folder."
(message "Initializing folder...")
- (save-excursion
- (set-buffer wl-folder-buffer-name)
- (let ((entity (wl-folder-create-folder-entity))
- (inhibit-read-only t))
- (setq wl-folder-entity entity)
- (setq wl-folder-entity-id 0)
- (wl-folder-entity-assign-id wl-folder-entity)
- (setq wl-folder-entity-hashtb
- (wl-folder-create-entity-hashtb entity))
- (setq wl-folder-elmo-folder-hashtb (elmo-make-hash wl-folder-entity-id))
- (setq wl-folder-group-alist
- (wl-folder-create-group-alist entity))
- (setq wl-folder-newsgroups-hashtb
- (wl-folder-create-newsgroups-hashtb wl-folder-entity))
- (wl-folder-init-info-hashtb)))
+ (setq wl-folder-entity (wl-folder-create-folder-entity))
(message "Initializing folder...done"))
(defun wl-folder-get-realname (petname)
:prefix "wl-"
:group 'wl)
+(defgroup wl-setting nil
+ "Wanderlust common settings."
+ :prefix "wl-"
+ :group 'wl)
+
;;; Emacsen
(defconst wl-on-xemacs (featurep 'xemacs))
user-mail-address)
"*From string used in draft."
:type 'string
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-user-mail-address-list nil
"*A list of user's mail addresses.
You should set this variable if you use multiple e-mail addresses.
If you don't have multiple e-mail addresses, you don't have to set this."
:type '(repeat string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-organization nil
"Organization name."
:type '(choice (const :tag "none" nil)
string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-tmp-dir "~/tmp/"
"*Default temporary directory to save message, part."
"*Subscribed mailing list.
You had better set this variable if you set 'wl-insert-mail-followup-to' as t."
:type '(repeat string)
- :group 'wl-pref)
+ :group 'wl-pref
+ :group 'wl-setting)
(defcustom wl-demo t
"*Display demo at start time."
If nil, `wl-from' is used."
:type '(choice (const :tag "Same as 'From' field." nil)
string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-draft-add-references t
"*If non-nil, message-id of the cited message is inserted to the
"*SMTP authentication user."
:type '(choice (const :tag "none" nil)
string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-smtp-posting-server nil
"*SMTP server name to send mail (wl-draft-send-mail-with-smtp)."
:type '(choice (const :tag "none" nil)
string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-smtp-posting-port nil
"*SMTP port number in `wl-smtp-posting-server'.
If nil, default SMTP port number(25) is used."
:type '(choice (const :tag "Default (25)" nil)
integer)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-smtp-authenticate-type nil
"*SMTP Authentication type.
(const :tag "CRAM-MD5" "cram-md5")
(const :tag "LOGIN" "login")
(string :tag "Other"))
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-pop-before-smtp-user nil
"*POP3 user name to send mail using POP-before-SMTP.
If nil, `elmo-pop3-default-user' is used.
To use POP-before-SMTP,
-(setq wl-draft-send-mail-function 'wl-draft-send-mail-with-pop-before-smtp)"
+\(setq wl-draft-send-mail-function 'wl-draft-send-mail-with-pop-before-smtp\)"
:type '(choice (const :tag "none" nil)
string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-pop-before-smtp-server nil
"*POP3 server for POP-before-SMTP.
If nil, `elmo-pop3-default-server' is used."
:type '(choice (const :tag "none" nil)
string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-pop-before-smtp-port nil
"*POP3 port for POP-before-SMTP.
If nil, `elmo-pop3-default-port' is used."
:type '(choice (const :tag "none" nil)
integer string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-pop-before-smtp-stream-type nil
"*Stream type for POP-before-SMTP.
:type '(choice (const :tag "none" nil)
(const :tag "APOP" "apop")
(const :tag "POP3" "user"))
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-nntp-posting-server nil
"*NNTP server name to post news.
If nil, `elmo-nntp-default-server' is used."
:type '(choice (const :tag "none" nil)
string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-nntp-posting-user nil
"*NNTP user name to post news for authinfo.
If nil, `elmo-nntp-default-user' is used.
If nil, don't authenticate."
:type '(choice (const :tag "none" nil)
string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-nntp-posting-port nil
"*NNTP port to post news.
If nil, `elmo-nntp-default-port' is used."
:type '(choice (const :tag "none" nil)
integer string)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-nntp-posting-stream-type nil
"*Stream type for posting Netnews.
If nil, `elmo-nntp-default-stream-type' is used."
(defcustom wl-fetch-confirm-threshold 30000
"*Confirm fetching if message size is larger than this value."
:type 'integer
- :group 'wl-pref)
+ :group 'wl-pref
+ :group 'wl-setting)
(defcustom wl-prefetch-confirm t
"*Confirm prefetching if message size is larger than `wl-prefetch-threshold'."
when `wl-prefetch-confirm' is non-nil."
:type '(choice (integer :tag "Threshold (bytes)")
(const :tag "No limitation" nil))
- :group 'wl-pref)
+ :group 'wl-pref
+ :group 'wl-setting)
(defcustom wl-cache-prefetch-threshold 30000
"*Quit forward cache prefetching if message size is larger than this value."
(defcustom wl-thread-insert-opened nil
"*Non-nil forces to insert thread as opened in updating."
:type 'boolean
- :group 'wl-summary)
+ :group 'wl-summary
+ :group 'wl-setting)
(defcustom wl-thread-open-reading-thread t
"*Non-nil forces to open reading thread."
(defcustom wl-ldap-server "localhost"
"*LDAP server."
:type '(string :tag "Server")
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-ldap-port nil
"*LDAP port."
:type '(choice (const :tag "Default port" nil)
integer)
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-ldap-base "c=US"
"*LDAP base."
:type '(string :tag "Base")
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-ldap-objectclass "person"
"*LDAP objectclass."
:type 'string
- :group 'wl)
+ :group 'wl
+ :group 'wl-setting)
(defcustom wl-use-ldap nil
"*If non-nil, use LDAP for address completion."
:type 'boolean
+ :group 'wl
+ :group 'wl-setting)
+
+(defcustom wl-use-acap nil
+ "*If non-nil, use ACAP for configuration."
+ :type 'boolean
:group 'wl)
(defcustom wl-folder-info-save t
(choice (cons (sexp :tag "Field(Variable)")
(sexp :tag "Value"))
(sexp :tag "Function")))))
- :group 'wl-draft)
+ :group 'wl-draft
+ :group 'wl-setting)
(defcustom wl-draft-config-matchone nil
"*If non-nil, applied only one element of `wl-draft-config-alist'."
:type 'boolean
- :group 'wl-draft)
+ :group 'wl-draft
+ :group 'wl-setting)
(defcustom wl-template-alist nil
"Alist of template."
(choice (cons (sexp :tag "Field(Variable)")
(sexp :tag "Value"))
(sexp :tag "Function")))))
- :group 'wl-draft)
+ :group 'wl-draft
+ :group 'wl-setting)
(defcustom wl-template-visible-select t
"*If non-nil, select template with visible."
(defcustom wl-message-sort-field-list '("Return-Path" "Received" "^To" "^Cc"
"Newsgroups" "Subject" "^From")
- "*Sort order of header fields. Each elements are regexp of field name.
-(Not valid on tm.)"
+ "*Sort order of header fields. Each elements are regexp of field name."
:type '(repeat (string :tag "Field Regexp"))
- :group 'wl-pref)
+ :group 'wl-pref
+ :group 'wl-setting)
(defcustom wl-message-ignored-field-list nil
"All fields that match this list will be hidden in message buffer.
Each elements are regexp of field-name."
:type '(repeat (string :tag "Field Regexp"))
- :group 'wl-pref)
+ :group 'wl-pref
+ :group 'wl-setting)
(defcustom wl-message-visible-field-list nil
"All fields that match this list will be displayed in message buffer.
Each elements are regexp of field-name."
:type '(repeat (string :tag "Field Regexp"))
- :group 'wl-pref)
+ :group 'wl-pref
+ :group 'wl-setting)
(defcustom wl-folder-window-width 20
"*Width of folder window."
(defcustom wl-interactive-send nil
"*If non-nil, require your confirmation when sending draft message."
:type 'boolean
- :group 'wl-pref)
+ :group 'wl-pref
+ :group 'wl-setting)
(defcustom wl-interactive-exit t
"*If non-nil, require your confirmation when exiting WL."
If this variable is `new', precede \"N\" mark."
:type '(radio (const new)
(const unread))
- :group 'wl-summary)
+ :group 'wl-summary
+ :group 'wl-setting)
(defvar wl-summary-move-direction-downward t)
(defcustom wl-auto-select-first nil
"*If non-nil, display selected first message when enter summary."
:type 'boolean
- :group 'wl-pref)
+ :group 'wl-pref
+ :group 'wl-setting)
(defcustom wl-auto-select-next nil
"*If non-nil, offer to go to the next folder from the end of the previous.
(const :tag "on" t)
(const unread)
(const skip-no-unread))
- :group 'wl-pref)
+ :group 'wl-pref
+ :group 'wl-setting)
(defcustom wl-cache-prefetch-folder-type-list '(imap4 nntp)
"*All folder types that match this list prefetch next message,
(defcustom wl-interactive-save-folders t
"*Non-nil require your confirmation when save folders."
:type 'boolean
- :group 'wl-folder)
+ :group 'wl-folder
+ :group 'wl-setting)
(defcustom wl-fldmgr-make-backup t
"*Non-nil make backup file when save folders."
(unless wl-init
(wl-load-profile))
(elmo-init)
- (let (demo-buf)
+ (let (demo-buf check)
(unless wl-init
(if wl-demo (setq demo-buf (wl-demo)))
- (condition-case nil
- (progn
- (message "Checking environment...")
- (wl-check-environment arg)
- (message "Checking environment...done"))
- (error)
- (quit)))
+ (setq check t))
(wl-init)
(condition-case obj
(progn
(wl-plugged-init (wl-folder arg))
+ (if check
+ (condition-case nil
+ (progn
+ (message "Checking environment...")
+ (wl-check-environment arg)
+ (message "Checking environment...done"))
+ (error)
+ (quit)))
(unless arg
(run-hooks 'wl-auto-check-folder-pre-hook)
(wl-folder-auto-check)
wl-fldmgr-save-folders wl-fldmgr-set-petname wl-fldmgr-sort
wl-fldmgr-subscribe wl-fldmgr-subscribe-region
wl-fldmgr-unsubscribe wl-fldmgr-unsubscribe-region wl-fldmgr-yank )
+ ("wl-acap" wl-acap-init)
+ ("wl-acap" :interactive t wl-acap-store)
("wl-fldmgr"
(wl-fldmgr-mode-map keymap)
wl-fldmgr-add-entity-hashtb)