[Mew-dist 16715] defcustom versus defvar

Ryutaroh Matsumoto ryutaroh at example.com
2001年 3月 4日 (日) 20:02:20 JST


Emacs Lispの変数を定義するときdefcustomでもdefvarでも定義できますが、
カスタマイズのための変数はdefcustomで定義するのが最近のやり方みたいな
ので、Mew 1.95b111のカスタマイズ用の変数をdefcustomで定義するパッチを
作ってみました。

defcustomで定義した変数は M-x customize-option で設定できますが、
mew-scan-form や mew-window-configuration のような複雑な型を持つ変数を
CUIで設定すると面白いです。

また M-x customize でカスタマイズできる変数の一覧が出てくるのは結構便
利だと思います。


松本 隆太郎
-------------- next part --------------
diff -ru mew-1.95b111/mew-os2.el mew-1.95b111-custom/mew-os2.el
--- mew-1.95b111/mew-os2.el	Thu Jan  4 15:22:45 2001
+++ mew-1.95b111-custom/mew-os2.el	Sun Mar  4 16:53:42 2001
@@ -11,8 +11,10 @@
 ;;; Code
 (defconst mew-os2-version "mew-os2.el v0.28")
 
-(defvar mew-os2-load-hook nil
- "*Hook called after mew-os2 has been loaded.")
+(defcustom mew-os2-load-hook nil
+ "*Hook called after mew-os2 has been loaded."
+  :group 'mew-env
+  :type 'hook)
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff -ru mew-1.95b111/mew-smime.el mew-1.95b111-custom/mew-smime.el
--- mew-1.95b111/mew-smime.el	Wed Feb 21 17:07:13 2001
+++ mew-1.95b111-custom/mew-smime.el	Sun Mar  4 16:53:41 2001
@@ -3,20 +3,31 @@
 ;;
 
 ;; configuration variables
-(defvar mew-smime-digital-id nil
-  "*Filename containing your digital ID in the PEM format.")
+(defcustom mew-smime-digital-id nil
+  "*Filename containing your digital ID in the PEM format."
+  :group 'mew-privacy
+  :type '(file :must-match t))
 
-(defvar mew-smime-CA-file nil
-  "*Filename containing certificates of the trusted CAs, such as VeriSign.")
+(defcustom mew-smime-CA-file nil
+  "*Filename containing certificates of the trusted CAs, such as VeriSign."
+  :group 'mew-privacy
+  :type '(file :must-match t))
 
-(defvar mew-smime-pubkey-dir nil
-  "*Directory storing public keys of others")
+(defcustom mew-smime-pubkey-dir nil
+  "*Directory storing public keys of others"
+  :group 'mew-privacy
+  :type 'directory)
 
-(defvar mew-smime-encryption-algorithm "-des3"
-  "*Encryption Algorithm")
+(defcustom mew-smime-encryption-algorithm "-des3"
+  "*Encryption Algorithm"
+  :group 'mew-privacy
+  :type 'string)
 
-(defvar mew-smime-additional-certificates nil
-  "*Filename containing additional certificates")
+
+(defcustom mew-smime-additional-certificates nil
+  "*Filename containing additional certificates"
+  :group 'mew-privacy
+  :type '(file :must-match t))
 
 (defun mew-smime-sign-configuration-check ()
   (cond
diff -ru mew-1.95b111/mew-thread.el mew-1.95b111-custom/mew-thread.el
--- mew-1.95b111/mew-thread.el	Wed Feb 28 18:59:07 2001
+++ mew-1.95b111-custom/mew-thread.el	Sun Mar  4 16:59:17 2001
@@ -15,7 +15,7 @@
 ;;; Customizable variables
 ;;;
 
-(defvar mew-use-complete-thread t
+(defcustom mew-use-complete-thread t
   "If non-nil, threads are made using two passes.
 
 First pass -  Repeat the following procedure in numerical order:
@@ -45,19 +45,26 @@
 threads (not making threads). 
 
 Mew doesn't provide any loop detection/avoidance mechanism. So, you
-should understand this risk.")
-
-(defvar mew-thread-indent-string "  "
-  "*A string to be inserted for indentation of thread.")
+should understand this risk."
+  :group 'mew-summary
+  :type 'boolean)
+
+(defcustom mew-thread-indent-string "  "
+  "*A string to be inserted for indentation of thread."
+  :group 'mew-summary
+  :type 'string)
 
 (defvar mew-thread-indent-array nil)
 (defvar mew-thread-indent-array-size 33) ;; devide by 32
 
-(defvar mew-use-fancy-thread nil
+(defcustom mew-use-fancy-thread nil
   "*If non-nil, use fancy style thread visualization.
-See also mew-fancy-thread-indent-strings.")
+See also mew-fancy-thread-indent-strings."
+  :group 'mew-summary
+  :type 'boolean)
+
 
-(defvar mew-fancy-thread-indent-strings [" +" " +" " |" "  "]
+(defcustom mew-fancy-thread-indent-strings [" +" " +" " |" "  "]
   "*Vector of strings to be used for indentation of fancy style thread.
 Valid only if mew-use-fancy-thread is non-nil.
 
@@ -73,10 +80,15 @@
      +Message 4
        +Message 5
 
-All members must have the same length.")
+All members must have the same length."
+  :group 'mew-summary
+  :type 'sexp)
+
+(defcustom mew-use-thread-cursor nil
+  "*If non-nil, move cursor after the indentation of thread."
+  :group 'mew-summary
+  :type 'boolean)
 
-(defvar mew-use-thread-cursor nil
-  "*If non-nil, move cursor after the indentation of thread.")
 
 (defvar mew-thread-indent-length nil)
 (defvar mew-thread-indent-regex nil)
diff -ru mew-1.95b111/mew-vars.el mew-1.95b111-custom/mew-vars.el
--- mew-1.95b111/mew-vars.el	Sat Mar  3 10:22:47 2001
+++ mew-1.95b111-custom/mew-vars.el	Sun Mar  4 19:30:25 2001
@@ -282,73 +282,105 @@
 ;;; Mail Addresses
 ;;;
 
-(defvar mew-mail-address nil
+(defcustom mew-mail-address nil
   "*An email address. Backward-compatibility only. If you don't want to
 use 'mew-config-alist' and want to use an email address whose user part
-is not equal to your login name, use this variable.")
+is not equal to your login name, use this variable."
+  :group 'mew-draft
+  :type '(choice string (const nil)))
 
-(defvar mew-mail-address-list nil
+
+(defcustom mew-mail-address-list nil
   "*The addresses included in this list never appear on the Cc: field
 on a draft buffer. If nil, this value is automatically generated from
-'mew-config-alist'.")
+'mew-config-alist'."
+  :group 'mew-draft
+  :type '(choice (const nil) (repeat string)))
 
-(defvar mew-mail-domain-list nil
+(defcustom mew-mail-domain-list nil
   "*Your e-mail address domain list like 
 (\"Mew.org\" \"iijlab.net\").
 They are used for mail-domain completion in Draft mode(C-cTAB). If
-nil, this value is automatically generated from 'mew-config-alist'.")
+nil, this value is automatically generated from 'mew-config-alist'."
+  :group 'mew-draft
+  :type '(choice (const nil) (repeat string)))
+
 
-(defvar mew-from-list nil
+(defcustom mew-from-list nil
   "*A list of From: for circular completion in Draft mode. If nil,
 this value is automatically generated from 'mew-config-alist'. See
-also 'mew-from'.")
+also 'mew-from'."
+  :group 'mew-draft
+  :type '(choice (const nil) (repeat string)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
 ;;; SMTP
 ;;;
 
-(defvar mew-smtp-server "localhost"
+(defcustom mew-smtp-server "localhost"
   "*The SMTP server name. If you want to use a remote SMTP server,
-set an appropriate value.")
+set an appropriate value."
+  :group 'mew-env
+  :type 'string)
 
-(defvar mew-smtp-port "smtp"
+(defcustom mew-smtp-port "smtp"
   "*The SMTP port. If you want to set it to a numeric value,
-use a string. (e.g. \"25\")")
+use a string. (e.g. \"25\")"
+  :group 'mew-env
+  :type 'string)
 
-(defvar mew-smtp-ssh-server nil
-  "*The name of SSH server which forwards the SMTP port.")
+(defcustom mew-smtp-ssh-server nil
+  "*The name of SSH server which forwards the SMTP port."
+  :group 'mew-env
+  :type '(choice string (const nil)))
 
-(defvar mew-smtp-user (user-login-name)
-  "*A user name to be used SMTP AUTH.")
+(defcustom mew-smtp-user (user-login-name)
+  "*A user name to be used SMTP AUTH."
+  :group 'mew-env
+  :type 'string)
 
-(defvar mew-smtp-auth nil
-  "*If non-nil, SMTP AUTH is used when you send messages.")
+(defcustom mew-smtp-auth nil
+  "*If non-nil, SMTP AUTH is used when you send messages."
+  :group 'mew-env
+  :type 'boolean)
 
-(defvar mew-smtp-auth-list '("CRAM-MD5" "PLAIN" "LOGIN")
+(defcustom mew-smtp-auth-list '("CRAM-MD5" "PLAIN" "LOGIN")
   "*A list of SMTP AUTH methods in the preferred order.
-Currently, \"CRAM-MD5\", \"PLAIN\", and \"LOGIN\" can be used.")
+Currently, \"CRAM-MD5\", \"PLAIN\", and \"LOGIN\" can be used."
+  :group 'mew-env
+  :type '(repeat (choice (const "CRAM-MD5") (const "PLAIN") (const "LOGIN"))))
 
-(defvar mew-smtp-helo-domain "localhost"
-  "*An e-mail domain to tell a SMTP server with HELO/EHLO.")
+(defcustom mew-smtp-helo-domain "localhost"
+  "*An e-mail domain to tell a SMTP server with HELO/EHLO."
+  :group 'mew-env
+  :type 'string)
 
-(defvar mew-smtp-mail-from nil
+(defcustom mew-smtp-mail-from nil
   "*An e-mail address to tell a SMTP server with MAIL FROM:.
-If nil, an address specified by the From: field is used.")
+If nil, an address specified by the From: field is used."
+  :group 'mew-env
+  :type '(choice string (const nil)))
 
-(defvar mew-smtp-msgid-user nil
+(defcustom mew-smtp-msgid-user nil
   "*If non-nil, this value is used to generate a user part
-of Message-ID:.")
+of Message-ID:."
+  :group 'mew-env
+  :type '(choice string (const nil)))
 
-(defvar mew-smtp-msgid-domain nil
+(defcustom mew-smtp-msgid-domain nil
   "*If non-nil, this value is used to generate a domain part
-of Message-ID:.")
+of Message-ID:."
+  :group 'mew-env
+  :type '(choice string (const nil)))
 
-(defvar mew-smtp-keep-connection nil
+(defcustom mew-smtp-keep-connection nil
   "*If non-nil. SMTP connection is maintained for further SMTP
 sessions. Otherwise, SMTP connection is closed after SMTP
 sessions are finished. Set this value to nil in the NAT 
-environment.")
+environment."
+  :group 'mew-env
+  :type 'boolean)
 
 (defvar mew-smtp-timeout-time 4)
 
@@ -357,71 +389,98 @@
 ;;; Retrieving messages
 ;;;
 
-(defvar mew-mailbox-type 'pop
-  "'pop or 'mbox")
+(defcustom mew-mailbox-type 'pop
+  "'pop or 'mbox"
+  :group 'mew-env
+  :type '(choice (const pop) (const mbox)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
 ;;; mbox
 ;;;
 
-(defvar mew-mbox-command nil
+(defcustom mew-mbox-command nil
   "*A command to be execute if 'mew-mailbox-type' is 'mbox. A good
-example is \"inc\".")
+example is \"inc\"."
+  :group 'mew-env
+  :type '(choice string (const nil)))
 
-(defvar mew-mbox-command-arg nil
+(defcustom mew-mbox-command-arg nil
   "*Arguments for 'mew-mbox-command'.
-A good example is \"-truncate -file /var/mail/user\".")
+A good example is \"-truncate -file /var/mail/user\"."
+  :group 'mew-env
+  :type '(choice string (const nil)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
 ;;; POP
 ;;;
 
-(defvar mew-pop-server "localhost"
+(defcustom mew-pop-server "localhost"
   "*The POP server name. If you want to use a remote POP server,
-set an appropriate value.")
+set an appropriate value."
+  :group 'mew-env
+  :type 'string)
 
-(defvar mew-pop-port "pop3"
+(defcustom mew-pop-port "pop3"
   "*The POP3 port. If you want to set it to a numeric value,
-use a string. (e.g. \"110\")")
+use a string. (e.g. \"110\")"
+  :group 'mew-env
+  :type 'string)
 
-(defvar mew-pop-ssh-server nil
-  "*The name of SSH server which forwards the POP3 port.")
+(defcustom mew-pop-ssh-server nil
+  "*The name of SSH server which forwards the POP3 port."
+  :group 'mew-env
+  :type '(choice string (const nil)))
 
-(defvar mew-pop-user (user-login-name)
-  "*The user name on the POP server.")
+(defcustom mew-pop-user (user-login-name)
+  "*The user name on the POP server."
+  :group 'mew-env
+  :type 'string)
 
-(defvar mew-pop-auth 'apop
+(defcustom mew-pop-auth 'apop
   "*The authentication method for POP3. Choose either 'pass or 'apop. 
 'pass means the authentication with USER/PASS (ie plain password).
 'apop means the authentication with APOP.
-t means SASL according to mew-pop-auth-list")
+t means SASL according to mew-pop-auth-list"
+  :group 'mew-env
+  :type '(choice (const apop) (const pass) (const t)))
 
-(defvar mew-pop-auth-list '("CRAM-MD5")
+(defcustom mew-pop-auth-list '("CRAM-MD5")
   "*A list of POP AUTH methods in the preferred order.
-Currently, \"CRAM-MD5\" can be used.")
+Currently, \"CRAM-MD5\" can be used."
+  :group 'mew-env
+  :type '(repeat (choice (const "CRAM-MD5"))))
 
-(defvar mew-pop-delete t
+(defcustom mew-pop-delete t
   "*If nil, messages on the POP server are not deleted after
-retrieval. Otherwise they are deleted.")
+retrieval. Otherwise they are deleted."
+  :group 'mew-env
+  :type 'boolean)
 
-(defvar mew-pop-size (* 54 1024) ;; 4K hdr + 50K bdy
+(defcustom mew-pop-size (* 54 1024) ;; 4K hdr + 50K bdy
   "*The limit of message size to be retrieved by POP.
-0 means no limit, retrives any messages.")
+0 means no limit, retrives any messages."
+  :group 'mew-env
+  :type 'integer)
+
 
-(defvar mew-pop-body-lines 40
+(defcustom mew-pop-body-lines 40
   "*The limit of body lines to get when the size of message
-exceeds 'mew-pop-size'.")
+exceeds 'mew-pop-size'."
+  :group 'mew-env
+  :type 'integer)
 
 (defvar mew-pop-size-over-message
   "[[[TOO LARGE, TRUNCATED BY Mew]]]\n\n")
 
 (defvar mew-pop-timeout-time 4)
 
-(defvar mew-pop-biff-interval 5
+(defcustom mew-pop-biff-interval 5
   "*Minutes of POP biff interval. This should be smaller than 
-'mew-passwd-timer-unit' * 'mew-passwd-lifetime'.")
+'mew-passwd-timer-unit' * 'mew-passwd-lifetime'."
+  :group 'mew-env
+  :type 'integer)
 
 (defvar mew-pop-biff-function (function mew-pop-biff-bark))
 
@@ -440,13 +499,41 @@
 ;;; Scan
 ;;;
 
-(defvar mew-scan-form-header '((-5 num) mark)
+(defcustom mew-scan-form-header '((-5 num) mark)
   "*A list to be appended to scan-form if the first element of
 scan-form is not an integer. Since Mew assumes that
 each line of Summary mode begins with the number of message followed
-by one mark, this variable MUST be consist of 'num and 'mark.")
+by one mark, this variable MUST be consist of 'num and 'mark."
+  :group 'mew-summary
+  :type '(repeat (choice string
+                        (list integer (choice (const num) (const mark)))
+                        (choice (const num) (const mark)))))
+
+(defconst mew-custom-type-of-scan-form
+        '(choice
+          (cons integer
+                (repeat (choice string
+                                (list integer
+                                      (choice (const type) (const time)
+                                              (const date) (const year)
+                                              (const size) (const from)
+                                              (const subj)))
+                                 (choice (const type) (const time)
+                                         (const date) (const year)
+                                         (const size) (const from)
+                                         (const subj)))))
+          (repeat (choice string
+                          (list integer (choice (const type) (const time)
+                                                (const date) (const year)
+                                                (const size) (const from)
+                                                (const subj)))
+                          (choice (const type) (const time)
+                                  (const date) (const year)
+                                  (const size) (const from)
+                                  (const subj))))))
+                          
 
-(defvar mew-scan-form '(type (5 date) " " (14 from) " " (0 subj))
+(defcustom mew-scan-form '(type (5 date) " " (14 from) " " (0 subj))
   "*The format n Summary mode, called scan-form. Scan-form is a list
 of list, symbol, and string.
 
@@ -481,9 +568,11 @@
 An example is as follows:
 	'(type (5 date) \" \" (-4 size) \" \" (14 from) \" \" (0 subj))
 
-You can also set this value in 'mew-scan-form-list'.")
+You can also set this value in 'mew-scan-form-list'."
+  :group 'mew-summary
+  :type mew-custom-type-of-scan-form)
 
-(defvar mew-scan-form-list nil
+(defcustom mew-scan-form-list nil
   "*A list to define 'mew-scan-form' for each folder. Each component
 is (key scan-form column). 
 
@@ -517,15 +606,25 @@
 	 (type (5 date) \" \" (-4 size) \" \" (14 from) \" \" (0 subj)) 33)
 	(t
 	 (type (5 date) \" \" (14 from) \" \" (0 subj)) 28))
-")
+"
+  :group 'mew-summary
+  :type '(choice (const nil)
+                (repeat
+                  (list (choice (const t) string (repeat string))
+                        mew-custom-type-of-scan-form
+                        integer))))
 
-(defvar mew-scan-form-list-string-type 'regex
+(defcustom mew-scan-form-list-string-type 'regex
   "*A value to specify an action if the key is a string in 
-'mew-scan-format-list'. Candidates are 'regex, 'recursive, and 'string.")
+'mew-scan-format-list'. Candidates are 'regex, 'recursive, and 'string."
+  :group 'mew-summary
+  :type '(choice (const regex) (const recursive) (const string)))
 
-(defvar mew-scan-form-list-list-type 'recursive
+(defcustom mew-scan-form-list-list-type 'recursive
   "*A value to specify an action if the key is a list of strings in 
-'mew-scan-format-list'. Candidates are 'regex, 'recursive, and 'string.")
+'mew-scan-format-list'. Candidates are 'regex, 'recursive, and 'string."
+  :group 'mew-summary
+  :type '(choice (const regex) (const recursive) (const string)))
 
 (defvar mew-scan-form-type-alist
   '((regex     . string-match)
@@ -540,11 +639,13 @@
   (or (cdr (assq mew-scan-form-list-list-type mew-scan-form-type-alist))
       (function string=)))
 
-(defvar mew-scan-form-from-me-prefix "To:"
+(defcustom mew-scan-form-from-me-prefix "To:"
   "*The prefix to be prepend to an destination address
-if the message is originated by me.")
+if the message is originated by me."
+  :group 'mew-summary
+  :type 'string)
 
-(defvar mew-scan-form-extract-rule '(nickname)
+(defcustom mew-scan-form-extract-rule '(nickname)
   "*A list to specify what part to extract from the From: field. Each
 element must be 'name, 'comment, 'address, 'nickname, or appropriate
 \"regex\".
@@ -575,33 +676,48 @@
 
 If a element does not match, the next element is applied. If no
 element matches to the From: field, or this value is nil, the whole
-of the From: field is used.")
+of the From: field is used."
+  :group 'mew-summary
+  :type '(repeat (choice regexp (const name) (const comment)
+                         (const address) (const nickname))))
 
-(defvar mew-scan-form-mark-delete nil
+(defcustom mew-scan-form-mark-delete nil
   "*If non-nil, the 'D' mark automatically is put onto
-duplicated messages.")
+duplicated messages."
+  :group 'mew-summary
+  :type 'boolean)
 
-(defvar mew-scan-form-mark-review nil
+(defcustom mew-scan-form-mark-review nil
   "*If non-nil, the '*' mark automatically is put onto
-messages destined to me.")
+messages destined to me."
+  :group 'mew-summary
+  :type 'boolean)
 
-(defvar mew-scan-form-size-0k nil
+(defcustom mew-scan-form-size-0k nil
   "*If non-nil, the size of message is displayed as '0k'
-if the size is less than 1k byte.")
+if the size is less than 1k byte."
+  :group 'mew-summary
+  :type 'boolean)
 
-(defvar mew-scan-form-size-huge t
+(defcustom mew-scan-form-size-huge t
   "*If non-nil, the size of message is displayed as 'HUGE'
 when the size is greater than or equal to 1000 after maximum
-quantization by `mew-scan-form-size-unit'.")
+quantization by `mew-scan-form-size-unit'."
+  :group 'mew-summary
+  :type 'boolean)
 
-(defvar mew-scan-fields
+(defcustom mew-scan-fields
   '("Folder:" "Filename:" "Subject:" "Date:" "From:" "To:"
     "Content-Type:" "Message-Id:" "X-Mew-UIDL:"
     "In-Reply-To:" "References:")
   "*A list which specifies mewls's output.
 The first element MUST be \"Folder:\".
 The second element MUST be \"Filename:\".
-Both \"In-Reply-To:\" and \"References:\" MUST be included for thread.")
+Both \"In-Reply-To:\" and \"References:\" MUST be included for thread."
+  :group 'mew-summary
+  :type '(cons (const "Folder:")
+               (cons (const "Filename:")
+                     (repeat string))))
 
 (defvar mew-scan-fields-alias
   '("FLD" "NUM" "SUBJ" "DATE" "FROM" "TO" "CT" "ID" "UIDL" "IRT" "REF")
@@ -615,10 +731,12 @@
   "*Micro second for mewls to sleep so that the interaction
 between Emacs and mewls smoother.")
 
-(defvar mew-thread-column 28
+(defcustom mew-thread-column 28
   "A position where 'mew-thread-indent-string' is inserted
-fot indentation of thread. You can also set this value in
-'mew-scan-form-list'.")
+for indentation of thread. You can also set this value in
+'mew-scan-form-list'."
+  :group 'mew-summary
+  :type 'integer)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
@@ -651,9 +769,11 @@
   :group 'mew-message
   :type 'integer)
 
-(defvar mew-header-reasonable-size 5000
+(defcustom mew-header-reasonable-size 5000
   "*The max size of header to be inserted to a temporary buffer to
-obtain any fields.")
+obtain any fields."
+  :group 'mew-message
+  :type 'integer)
 
 (defcustom mew-header-max-length 100
   "*If the length of a header exceeds this value, 
@@ -783,7 +903,7 @@
   :group 'mew-summary
   :type 'boolean)
 
-(defvar mew-use-biff nil
+(defcustom mew-use-biff nil
   "*If non-nil, Mew displays \"Mail(n)\" in the mode line if
 your POP server receives messages. This is confirmed by POP
 every 'mew-pop-biff-interval' minutes. 
@@ -791,19 +911,25 @@
 To use this feature, 'mew-use-cached-passwd' should be 't'.
 
 If you want to use the biff functionality against a local spool, use
-'display-time-mode instead. ")
+'display-time-mode instead. "
+  :group 'mew-env
+  :type 'boolean)
 
-(defvar mew-use-biff-bell nil
+(defcustom mew-use-biff-bell nil
   "*If non-nil, Mew beeps when the number of messages in
 your POP server becomes non-zero. To use this feature, 
-'mew-use-biff' should be 't'.")
+'mew-use-biff' should be 't'."
+  :group 'mew-env
+  :type 'boolean)
 
-(defvar mew-use-sender nil
+(defcustom mew-use-sender nil
   "*If From: contains multiple addresses, Mew adds Sender: anyway. 
 If From: contains one address and SMTP MAIL FROM
 ('mew-smtp-mail-from') is different from it, this variable effects.
 If non-nil, Mew adds Sender: and specifies SMTP MAIL FROM to its value.
-Otherwise, Mew doesn't add Sender:.")
+Otherwise, Mew doesn't add Sender:."
+  :group 'mew-draft
+  :type 'boolean)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
@@ -816,7 +942,10 @@
     (draft   (1  0)))
   "*Ratio of windows"
   :group 'mew-env
-  :type 'sexp)
+  :type '(list
+           (list (const summary) (list integer integer))
+           (list (const message) (list integer integer))
+           (list (const draft) (list integer integer))))
 
 (defcustom mew-mode-line-id '("Mew: %12b")
   "*A default value of mode-line-buffer-identification for each Mew mode."
@@ -920,8 +1049,10 @@
   :group 'mew-message
   :type 'boolean)
 
-(defvar mew-summary-display-raw-header nil
-  "*If *non-nil*, '\\<mew-summary-mode-map>\\[mew-summary-display-asis]' displays a header as is.")
+(defcustom mew-summary-display-raw-header nil
+  "*If *non-nil*, '\\<mew-summary-mode-map>\\[mew-summary-display-asis]' displays a header as is."
+  :group 'mew-message
+  :type 'boolean)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
@@ -1054,9 +1185,11 @@
   :group 'mew-cite
   :type 'string)
 
-(defvar mew-draft-cite-label-fill-column nil
+(defcustom mew-draft-cite-label-fill-column nil
   "If *non-nil*, this value is used for 'mew-draft-cite-fill-mode' 
-instead of 'fill-column'.")
+instead of 'fill-column'."
+  :group 'mew-cite
+  :type '(choice integer (const nil)))
 
 (defcustom mew-summary-reply-position 'body
   "If 'body, the cursor locates in the beginning of the body. 
@@ -1071,8 +1204,10 @@
   :group 'mew-cite
   :type 'symbol)
 
-(defvar mew-cite-ignore-mouse-region t
-  "*If *non-nil*, a region specified by mouse is ignored when citing.")
+(defcustom mew-cite-ignore-mouse-region t
+  "*If *non-nil*, a region specified by mouse is ignored when citing."
+  :group 'mew-cite
+  :type 'boolean)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
@@ -1089,17 +1224,19 @@
 	(\"iso-8859-2\" . \"latin-2-postfix\")))
 "
   :group 'mew-draft
-  :type 'sexp)
+  :type '(alist :key-type string :value-type string))
 
 (defun mew-charset-to-input-method (charset)
   (if (stringp charset)
       (cdr (mew-assoc-case-equal
 	    charset mew-charset-input-method-alist 0))))
 
-(defvar mew-charset-m17n "utf-8"
+(defcustom mew-charset-m17n "utf-8"
   "*A charset to be used if multiple character set are found and
 an appropriate charset cannot be chosen. Possible candidates are
-\"utf-8\" and \"iso-2022-jp-2\".")
+\"utf-8\" and \"iso-2022-jp-2\"."
+  :group 'mew-draft
+  :type '(choice (const "utf-8") (const "iso-2022-jp-2")))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
@@ -1344,9 +1481,11 @@
   :group 'mew-folder
   :type '(repeat string))
 
-(defvar mew-touch-folder-p nil
+(defcustom mew-touch-folder-p nil
   "*If non-nil, 'mew-summary-touch-file' is used to store
-time-stamp of a directory")
+time-stamp of a directory"
+  :group 'mew-env
+  :type 'boolean)
 
 (defvar mew-dir-list-function (if (or (memq system-type '(OS/2 emx))
 				      (eq system-type 'windows-nt))
@@ -1364,6 +1503,12 @@
 ;;; Refile
 ;;;
 
+(defconst mew-custome-type-of-guess-alist
+  '(choice (const nil)
+           (repeat
+             (cons string
+                   (repeat (cons regexp string))))))
+
 (defcustom mew-refile-guess-alist nil
   "*If non-nil, mew guesses destination folder by using this hint.
 The format is like this:
@@ -1380,7 +1525,8 @@
             ))
 "
   :group 'mew-refile
-  :type 'sexp)
+  :type mew-custome-type-of-guess-alist)
+
 
 (defcustom mew-refile-ctrl-multi t
   "*If *non-nil*, guess functions guess multi folders."
@@ -1436,9 +1582,11 @@
 ;;; Config
 ;;;
 
-(defvar mew-config-guess-alist nil
+(defcustom mew-config-guess-alist nil
   "*If *non-nil*, this value is used to guess values of the Config: field.
-The syntax is exactly the same as 'mew-refile-guess-alist'.")
+The syntax is exactly the same as 'mew-refile-guess-alist'."
+  :group 'mew-draft
+  :type mew-custome-type-of-guess-alist)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
@@ -1792,9 +1940,11 @@
   :group 'mew-privacy
   :type 'boolean)
 
-(defvar mew-encrypt-to-myself t
+(defcustom mew-encrypt-to-myself t
   "*if non-ni, any message/part to be encrypted is encrypted with
-your public key as well as receivers' one.")
+your public key as well as receivers' one."
+  :group 'mew-privacy
+  :type 'boolean)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
@@ -1881,10 +2031,12 @@
 ;;; External-body
 ;;;
 
-(defvar mew-ext-anon-ftp-method 'ftp
+(defcustom mew-ext-anon-ftp-method 'ftp
   "A method to get the message body for access-type=anon-ftp.
 If 'ftp is specified, ange-ftp or efs is used. If 'http is specified,
-w3 is used.")
+w3 is used."
+  :group 'mew-message
+  :type '(choice (const ftp) (const http)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
@@ -1915,7 +2067,7 @@
 ;;; For broken MUAs
 ;;;
 
-(defvar mew-decode-broken t
+(defcustom mew-decode-broken t
   "If non-nil, Mew decode broken messages.
 
 (1) Decode quoted encoded-words, which violates RFC 2047.
@@ -1959,7 +2111,9 @@
 	Content-Type: text/plain
 
 	ISO-2022-JP text
-")
+"
+  :group 'mew-message
+  :type 'boolean)
 
 (defvar mew-use-name-parameter t)
 (defvar mew-decode-ws-fields '("Subject:"))
diff -ru mew-1.95b111/mew-vars2.el mew-1.95b111-custom/mew-vars2.el
--- mew-1.95b111/mew-vars2.el	Wed Feb 28 20:03:03 2001
+++ mew-1.95b111-custom/mew-vars2.el	Sun Mar  4 18:17:56 2001
@@ -237,6 +237,9 @@
 ;;; Completion
 ;;;
 
+(defconst mew-custom-type-of-field-completion
+  '(alist key-type: string :value-type function))
+
 (defcustom mew-field-completion-switch
   '(("To:"         . mew-complete-address)
     ("Cc:"         . mew-complete-address)
@@ -251,7 +254,7 @@
     ("Newsgroups:" . mew-complete-newsgroups))
   "*Completion function alist concerned with the key."
   :group 'mew-complete
-  :type 'sexp)
+  :type mew-custom-type-of-field-completion)
 
 (defcustom mew-field-circular-completion-switch
   '(("To:"          . mew-circular-complete-domain)
@@ -267,7 +270,7 @@
     ("Resent-From:" . mew-circular-complete-from))
   "*Circular completion function alist concerned with the key."
   :group 'mew-complete
-  :type 'sexp)
+  :type mew-custom-type-of-field-completion)
 
 (defcustom mew-field-expansion-switch
   '(("To:"         . mew-expand-address)
@@ -281,7 +284,7 @@
     ("Resent-Bcc:" . mew-expand-address))
   "*Expansion function alist concerned with the key."
   :group 'mew-complete
-  :type 'sexp)
+  :type mew-custom-type-of-field-completion)
 
 (defsubst mew-field-get-func (key switch)
   (cdr (mew-assoc-match key switch 0)))
@@ -529,7 +532,7 @@
   "*A list of ('body-key-regex' face-for-body).
 This is used to highlight body."
   :group 'mew-highlight
-  :type 'sexp)
+  :type '(repeat (list regexp face)))
 
 (defsubst mew-highlight-body-get-face (key)
   (nth 1 (mew-assoc-match2 key mew-highlight-body-keywords 0)))
@@ -557,7 +560,7 @@
 This is used to fancy highlight body.
 Symbol 'mew-fancy-highlight-body' means to apply fancy face method."
   :group 'mew-highlight
-  :type 'sexp)
+  :type '(repeat (list regexp face)))
 
 (defsubst mew-fancy-highlight-body-get-face (key)
   (nth 1 (mew-assoc-match2 key mew-fancy-highlight-body-keywords 0)))
@@ -654,7 +657,10 @@
 'mew-highlight-header-face-key' is used. If face-for-value is not
 present, mew-highlight-header-face-marginal is used."
   :group 'mew-highlight
-  :type 'sexp)
+  :type '(alist :key-type regexp
+                :value-type
+                  (choice (list boolean)
+                          (list boolean face face))))
 
 ;; cons the position to the spec. 
 (defsubst mew-nspec-by-key (key)
@@ -793,7 +799,7 @@
 ;;; Config-alist
 ;;;
 
-(defvar mew-config-alist nil
+(defcustom mew-config-alist nil
   "*Alist of Config. This is a list of 
 	(<case> (<key> . <value>) (<key> . <value>) ...).
   - <case> is a string of Config case.
@@ -832,7 +838,10 @@
 	(\"default\"
 	 (\"name\"         . \"Kazu Yamamoto\")
 	 (\"mail-domain\"  . \"iijlab.net\"))))
-")
+"
+  :group 'mew-env
+  :type '(alist :key-type string
+                :value-type (repeat (cons string string))))
 
 (defsubst mew-cfent-by-case (case)
   (if (null case)
-------------- next part --------------
テキスト形式以外の添付ファイルを保管しました...
ファイル名: 無し
型:         application/x-pkcs7-signature
サイズ:     3207 バイト
説明:       attachment; filename="smime.p7s"
URL:        <http://www.mew.org/pipermail/mew-dist/attachments/20010304/3e5ce1f0/attachment.bin>


Mew-dist メーリングリストの案内