* wl-vars.el (wl-use-semi): Remove unused variable.
[elisp/wanderlust.git] / wl / wl-vars.el
index b0f0948..e8c7359 100644 (file)
@@ -33,6 +33,7 @@
 
 (require 'elmo-vars)
 (require 'elmo-util)
+(require 'elmo-msgdb)
 (require 'custom)
 
 ;;; Customizable Variables
 
 (defvar wl-cs-cache wl-cs-local)
 
-(defvar wl-use-semi (module-installed-p 'mime-view) ; If nil, use tm.
-  "*Use SEMI or not.")
-
 (defcustom wl-from (and user-mail-address
                        (concat (and (user-full-name)
                                     (concat (elmo-address-quote-specials
@@ -331,6 +329,91 @@ If nil, never search search parent by subject."
                 (const :tag "Don't search parent" nil))
   :group 'wl-summary)
 
+;;; Mark & Action
+(defcustom wl-summary-mark-action-list
+  '(("*"
+     target-mark
+     nil
+     wl-summary-register-target-mark
+     nil
+     wl-highlight-summary-temp-face
+     "Put target mark.")
+    ("d"
+     dispose
+     nil
+     wl-summary-register-temp-mark
+     wl-summary-exec-action-dispose
+     wl-highlight-summary-disposed-face
+     "Dispose messages according to `wl-dispose-folder-alist'.")
+    ("D"
+     delete
+     nil
+     wl-summary-register-temp-mark
+     wl-summary-exec-action-delete
+     wl-highlight-summary-deleted-face
+     "Delete messages immediately.")
+    ("o"
+     refile
+     wl-summary-get-refile-destination
+     wl-summary-set-action-refile
+     wl-summary-exec-action-refile
+     wl-highlight-summary-refiled-face
+     "Refile messages to the other folder.")
+    ("O"
+     copy
+     wl-summary-get-copy-destination
+     wl-summary-register-temp-mark
+     wl-summary-exec-action-copy
+     wl-highlight-summary-copied-face
+     "Copy messages to the other folder.")
+    ("i"
+     prefetch
+     nil
+     wl-summary-register-temp-mark
+     wl-summary-exec-action-prefetch
+     wl-highlight-summary-prefetch-face
+     "Prefetch messages.")
+    ("~"
+     resend
+     wl-summary-get-resend-address
+     wl-summary-register-temp-mark
+     wl-summary-exec-action-resend
+     wl-highlight-summary-resend-face
+     "Resend messages."))
+  "A variable to define Mark & Action.
+Each element of the list should be a list of
+\(MARK
+  SYMBOL
+  ARGUMENT-FUNCTION
+  SET-MARK-FUNCTION
+  EXEC-FUNCTION
+  FACE
+  DOC-STRING)
+
+MARK is a temporal mark string to define.
+SYMBOL is an action name to define.
+ARGUMENT-FUNCTION is a function called to set the argument data for
+SET-MARK-FUNCTION.
+Its argument is (ACTION NUMBER).
+ACTION is same as the SYMBOL.
+NUMBER is the message number to determine the argument data.
+SET-MARK-FUNCTION is a function called to set the mark.
+Its argument is (NUMBER MARK DATA).
+NUMBER is the target message number.
+MARK is the temporary mark string.
+DATA is given by ARGUMENT-FUNCTION.
+EXEC-FUNCTION is a function called to execute the action.
+Its argument is a list of MARK-INFO.
+MARK-INFO is a list of (NUMBER MARK DATA).
+FACE is a face for highlighting."
+  :type '(repeat (string :tag "Temporary mark")
+                (symbol :tag "Set mark function")
+                (symbol :tag "Unset mark function")
+                (symbol :tag "Exec function")
+                (symbol :tag "Face symbol")
+                (string :tag "Document string"))
+  :group 'wl-summary)
+
 ;; Important folders
 (defcustom wl-default-folder "%inbox"
   "*Default folder used in `wl-summary-goto-folder'."
@@ -871,34 +954,59 @@ cdr of each cons cell is used for draft message."
   :type 'boolean
   :group 'wl-folder)
 
-(defcustom wl-summary-unread-mark "!"
-  "Mark for unread message."
-  :type '(string :tag "Mark")
-  :group 'wl-summary-marks)
-(defcustom wl-summary-important-mark "$"
-  "Mark for important message."
+(defcustom wl-summary-flag-priority-list '(new important answered unread)
+ "List of flags reflected with the priority to a persistent mark."
+  :type '(repeat (radio (const :format "%v " new)
+                       (const :format "%v " important)
+                       (const :format "%v " answered)
+                       (const :format "%v " unread)))
+  :group 'wl-summary)
+
+(defcustom wl-summary-new-uncached-mark "N"
+  "Mark for new and uncached message."
   :type '(string :tag "Mark")
   :group 'wl-summary-marks)
-(defcustom wl-summary-new-mark "N"
-  "Mark for new message."
+
+(defcustom wl-summary-new-cached-mark "?"
+  "Mark for new but already cached message."
   :type '(string :tag "Mark")
   :group 'wl-summary-marks)
+
 (defcustom wl-summary-unread-uncached-mark "U"
   "Mark for unread and uncached message."
   :type '(string :tag "Mark")
   :group 'wl-summary-marks)
+
 (defcustom wl-summary-unread-cached-mark "!"
   "Mark for unread but already cached message."
   :type '(string :tag "Mark")
   :group 'wl-summary-marks)
+
 (defcustom wl-summary-read-uncached-mark "u"
   "Mark for read but uncached message."
   :type '(string :tag "Mark")
   :group 'wl-summary-marks)
+
+(defcustom wl-summary-answered-cached-mark "&"
+  "Mark for answered and cached message."
+  :type '(string :tag "Mark")
+  :group 'wl-summary-marks)
+
+(defcustom wl-summary-answered-uncached-mark "A"
+  "Mark for answered but cached message."
+  :type '(string :tag "Mark")
+  :group 'wl-summary-marks)
+
+(defcustom wl-summary-important-mark "$"
+  "Mark for important message."
+  :type '(string :tag "Mark")
+  :group 'wl-summary-marks)
+
 (defcustom wl-summary-score-over-mark "+"
   "Score mark used for messages with high scores."
   :type '(string :tag "Mark")
   :group 'wl-summary-marks)
+
 (defcustom wl-summary-score-below-mark "-"
   "Score mark used for messages with low scores."
   :type '(string :tag "Mark")
@@ -954,7 +1062,7 @@ This variable is local to the summary buffers."
   :group 'wl-score)
 
 (defcustom wl-summary-score-marks
-  (list wl-summary-new-mark)
+  (list wl-summary-new-uncached-mark wl-summary-new-cached-mark)
   "Persistent marks to scoring."
   :type '(repeat (string :tag "Mark"))
   :group 'wl-score)
@@ -1304,6 +1412,11 @@ Available if only `wl-summary-lazy-highlight' is nil."
   :group 'wl-summary
   :group 'wl-highlight)
 
+(defcustom wl-summary-lazy-update-mark (boundp 'window-scroll-functions)
+  "Non-nil forces lazy update mark using `window-scroll-functions'."
+  :type 'boolean
+  :group 'wl-summary)
+
 (defcustom wl-summary-cache-use t
   "Non-nil forces wl-summary to use cache file."
   :type 'boolean
@@ -1384,7 +1497,7 @@ Allowed situations are:
   :group 'wl-summary
   :group 'wl-pref)
 
-(defcustom wl-message-id-use-wl-from nil
+(defcustom wl-message-id-use-wl-from t
   "*Use `wl-from' for domain part of Message-ID if non-nil."
   :type 'boolean
   :group 'wl-pref)
@@ -1413,6 +1526,26 @@ which appear just before @."
   :type 'boolean
   :group 'wl-pref)
 
+(defcustom wl-message-use-header-narrowing t
+  "Use header narrowing when non-nil."
+  :type 'boolean
+  :group 'wl-pref)
+
+(defcustom wl-message-header-narrowing-fields '("to" "cc")
+  "A list of field name to enable header narrowing."
+  :type '(repeat string)
+  :group 'wl-pref)
+
+(defcustom wl-message-header-narrowing-lines 4
+  "Line number to enable the header narrowing."
+  :type 'integer
+  :group 'wl-pref)
+
+(defcustom wl-message-header-narrowing-string "..."
+  "A string used for header narrowing truncation."
+  :type 'string
+  :group 'wl-pref)
+
 (defvar wl-message-mode-line-format-spec-alist
   '((?f (if (memq 'modeline wl-use-folder-petname)
            (wl-folder-get-petname wl-message-buffer-cur-folder)
@@ -1629,6 +1762,12 @@ with wl-highlight-folder-many-face."
   :group 'wl-summary
   :group 'wl-pref)
 
+(defcustom wl-summary-print-argument-within-window nil
+  "*If non-nil, always print argument right side of window."
+  :type 'boolean
+  :group 'wl-summary
+  :group 'wl-pref)
+
 (defcustom wl-summary-pick-field-default "Body"
   "*Default field for pick."
   :type '(radio (const "From")
@@ -1699,13 +1838,47 @@ This wrapper is generated by the mail system when rejecting a letter."
   :type 'regexp
   :group 'wl-draft)
 
+(defcustom wl-draft-preview-attributes t
+  "Non-nil forces to preview the attributes in the `wl-draft-preview-message'.
+Attributes specified in the `wl-draft-preview-attributes-list' are displayed."
+  :type 'boolean
+  :group 'wl-draft)
+
+(defcustom wl-draft-preview-attributes-list '(recipients
+                                             envelope-from
+                                             smtp-posting-server
+                                             smtp-posting-port)
+  "*Attribute symbols to display in the draft preview.
+Candidates are following:
+`recipients'
+`envelope-from'
+`smtp-posting-server'
+`smtp-posting-port'
+`nntp-posting-server'
+`nntp-posting-port'
+Also variables which begin with `wl-' can be specified
+\(`wl-' have to be removed\)"
+  :type '(repeat symbol)
+  :group 'wl-draft)
+
+(defcustom wl-draft-preview-attributes-buffer-lines 5
+  "*Buffer height for the draft attribute preview."
+  :type 'integer
+  :group 'wl-draft)
+
+(defcustom wl-draft-preview-attributes-buffer-name "*Preview Attributes*"
+  "*Buffer name for the draft attribute preview."
+  :type 'string
+  :group 'wl-draft)
+
 (defcustom wl-refile-default-from-folder "+from"
   "*Folder name to refile by `wl-refile-guess-by-from'."
   :type '(string :tag "Folder")
   :group 'wl-pref)
 
 (defcustom wl-summary-auto-refile-skip-marks
-  (list wl-summary-new-mark
+  (list wl-summary-new-uncached-mark
+       wl-summary-new-cached-mark
        wl-summary-unread-uncached-mark
        wl-summary-unread-cached-mark)
   "Persistent marks to skip auto-refiling."
@@ -1713,21 +1886,21 @@ This wrapper is generated by the mail system when rejecting a letter."
   :group 'wl-summary)
 
 (defcustom wl-summary-reserve-mark-list
-  (list "o" "O" "D")
+  (list "o" "O" "D" "d" "i")
   "If a message is already marked as temporal marks in this list,
 the message is not marked by any mark command."
   :type '(repeat (string :tag "Temp-Mark"))
   :group 'wl-summary)
 
 (defcustom wl-summary-skip-mark-list
-  (list "D")
+  (list "D" "d")
   "If a message is already marked as temporal marks in this list,
 the message is skipped at cursor move."
   :type '(repeat (string :tag "Temp-Mark"))
   :group 'wl-summary)
 
 (defcustom wl-summary-incorporate-marks
-  (list wl-summary-new-mark
+  (list wl-summary-new-uncached-mark
        wl-summary-unread-uncached-mark)
   "Persistent marks to prefetch at `wl-summary-incorporate'."
   :type '(repeat (string :tag "Mark"))
@@ -2035,16 +2208,14 @@ e.x.
   :group 'wl-pref)
 
 (defcustom wl-folder-sync-range-alist
-  (list (cons (concat "^" (regexp-quote wl-draft-folder) "$\\|^"
-                     (regexp-quote wl-queue-folder) "$")
-             "all"))
+  (list (cons 'wl-require-update-all-folder-p "all")
+       (cons "^'flag" "all"))
   "*Default sync range alist.  If no matches, `wl-default-sync-range' is used."
-  :type '(repeat (cons (regexp :tag "Folder Regexp")
+  :type '(repeat (cons (choice (regexp :tag "Folder Regexp")
+                              (symbol :tag "A function"))
                       (choice (const "update")
                               (const "all")
                               (const "rescan")
-                              (const "first:")
-                              (const "last:")
                               (const "no-sync")
                               (const :tag "none" nil))))
   :group 'wl-pref)
@@ -2054,8 +2225,6 @@ e.x.
   :type '(choice (const "update")
                 (const "all")
                 (const "rescan")
-                (const "first:")
-                (const "last:")
                 (const "no-sync")
                 (const :tag "none" nil))
   :group 'wl-pref)
@@ -2110,8 +2279,13 @@ or 'skip-no-unread."
   :group 'wl-summary)
 
 (defcustom wl-summary-search-via-nntp 'confirm
-  "*Non-nil, search message via nntp after `wl-summary-jump-to-msg-by-message-id'.  If the value is 'confirm, confirm before search."
-  :type 'boolean
+  "*Non-nil, search message via nntp after `wl-summary-jump-to-msg-by-message-id'.
+If the value is 'confirm, confirm before search, 'force to search via nntp
+regardless of current folder type."
+  :type '(choice (const :tag "confirm" confirm)
+                (const :tag "always" force)
+                (const :tag "in nntp folder" t)
+                (const :tag "never" nil))
   :group 'wl-summary)
 
 (defcustom wl-summary-keep-cursor-command
@@ -2138,8 +2312,9 @@ Sender information in summary mode."
   :type 'string
   :group 'wl-folder)
 
-(defcustom wl-delete-folder-alist '(("^-" . remove))
-  "*Alist of folder and delete policy.
+(defcustom wl-dispose-folder-alist '(("^-" . remove)
+                                    ("^@" . remove))
+  "*Alist of folder and dispose policy.
 Each element is (folder-regexp . policy).
 
 The policy is one of the followings:
@@ -2171,9 +2346,10 @@ POLICY is copy or move."
   :group 'wl-summary
   :group 'wl-pref)
 
-(defcustom wl-folder-hierarchy-access-folders '("^-$" "^-alt$")
+(defcustom wl-folder-hierarchy-access-folders '("^-[^\\.]*\\(:\\|@\\|$\\)"
+                                               "^@$")
   "*Access group REGEXPs to make hierarchy structure."
-  :type '(repeat (string :tag "Folder"))
+  :type '(repeat (string :tag "Regexp"))
   :group 'wl-folder)
 
 (defcustom wl-folder-init-load-access-folders nil
@@ -2314,8 +2490,8 @@ ex.
 
 (defcustom wl-summary-expire-reserve-marks
   (list wl-summary-important-mark
-       wl-summary-new-mark
-       wl-summary-unread-mark
+       wl-summary-new-uncached-mark
+       wl-summary-new-cached-mark
        wl-summary-unread-uncached-mark
        wl-summary-unread-cached-mark)
   "Permanent marks of reserved message when expire.
@@ -2496,7 +2672,12 @@ This variable can also be a regex."
 ;; highilght about mouse
 (defcustom wl-use-highlight-mouse-line (and window-system
                                            (>= emacs-major-version 19))
-  "*Highlight mouse line, if non nil."
+  "*Highlight mouse line, if non-nil."
+  :type 'boolean
+  :group 'wl-highlight)
+
+(defcustom wl-use-flag-folder-help-echo nil
+  "*Display help-echo in the flag folder if non-nil."
   :type 'boolean
   :group 'wl-highlight)
 
@@ -2571,22 +2752,19 @@ a symbol `bitmap', `xbm' or `xpm' in order to force the image format."
 (defvar wl-modeline-biff-state-off wl-biff-state-indicator-off)
 
 ;; Advanced thread view.
-(defvar wl-thread-indent-level 1
+(defvar wl-thread-indent-level (if wl-on-mule 1 2)
   "*Indent level for thread.")
-(defvar wl-thread-have-younger-brother-str "\e$B(2\e(B"
+(defvar wl-thread-have-younger-brother-str (if wl-on-mule "\e$B(2\e(B" "+")
   "*A string for thread branch line.  It should contain one character.")
-(defvar wl-thread-youngest-child-str       "\e$B(1\e(B"
+(defvar wl-thread-youngest-child-str       (if wl-on-mule "\e$B(1\e(B" "+")
   "*A string for thread branch line.  It should contain one character.")
-(defvar wl-thread-vertical-str             "\e$B(-\e(B"
+(defvar wl-thread-vertical-str             (if wl-on-mule "\e$B(-\e(B" "|")
   "*A string for thread branch line.  It should contain one character.")
-(defvar wl-thread-horizontal-str           "\e$B(,\e(B"
+(defvar wl-thread-horizontal-str           (if wl-on-mule "\e$B(,\e(B" "-")
   "*A string for thread branch line.  It should contain one character.")
-(defvar wl-thread-space-str                "\e$B!!\e(B"
+(defvar wl-thread-space-str                (if wl-on-mule "\e$B!!\e(B" " ")
   "*A string for thread branch line.  It should contain one character.")
 
-(defvar wl-highlight-thread-indent-string-regexp "[^[<]*"
-  "* A regexp string for thread indent...for highlight.")
-
 ;; folder icons. filename relative to wl-icon-directory
 (defvar wl-opened-group-folder-icon "opened.xpm"
   "*Icon file for opened group folder.")
@@ -2651,6 +2829,14 @@ a symbol `bitmap', `xbm' or `xpm' in order to force the image format."
 
 ;;;; Obsolete variables.
 
+;; 2003-11-05
+(elmo-define-obsolete-variable 'wl-summary-new-mark
+                              'wl-summary-new-uncached-mark)
+
+;; 2003-07-15 delete -> dispose
+(elmo-define-obsolete-variable 'wl-delete-folder-alist
+                              'wl-dispose-folder-alist)
+
 ;; 2002-12-25
 (elmo-define-obsolete-variable 'wl-draft-reply-myself-with-argument-list
                               'wl-draft-reply-with-argument-list)