]> code.delx.au - gnu-emacs/blobdiff - lisp/mh-e/mh-e.el
Update reference for threading RFC.
[gnu-emacs] / lisp / mh-e / mh-e.el
index d7ec1f7926bdbbd0b251df785388821d2562ade7..0c134e8544ac11611a7d1daf1c7647c8d16e0795 100644 (file)
@@ -1,13 +1,11 @@
 ;;; mh-e.el --- GNU Emacs interface to the MH mail system
 
-;; Copyright (C) 1985, 1986, 1987, 1988,
-;;   1990, 1992, 1993, 1994, 1995, 1997, 1999,
-;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1985-1988, 1990, 1992-1995, 1997, 1999-2013 Free
+;; Software Foundation, Inc.
 
 ;; Author: Bill Wohler <wohler@newt.com>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
-;; Version: 8.2
+;; Version: 8.5+bzr
 ;; Keywords: mail
 
 ;; This file is part of GNU Emacs.
@@ -29,7 +27,7 @@
 
 ;; MH-E is an Emacs interface to the MH mail system.
 
-;; MH-E is supported in GNU Emacs 21 and 22, as well as XEmacs 21
+;; MH-E is supported in GNU Emacs 21 and higher, as well as XEmacs 21
 ;; (except for versions 21.5.9-21.5.16). It is compatible with MH
 ;; versions 6.8.4 and higher, all versions of nmh, and GNU mailutils
 ;; 1.0 and higher. Gnus is also required; version 5.10 or higher is
 ;; Provide functions to the rest of MH-E. However, mh-e.el must not
 ;; use any definitions in files that require mh-e from mh-loaddefs,
 ;; for if it does it will introduce a require loop.
-(eval-and-compile
-  ;; Load it during compilation as well, since it defines the macro
-  ;; mh-require-cl.
-  (load "mh-loaddefs" nil 'nomessage))
+(require 'mh-loaddefs)
 
 (mh-require-cl)
 
 ;; Try to keep variables local to a single file. Provide accessors if
 ;; variables are shared. Use this section as a last resort.
 
-(defconst mh-version "8.2" "Version number of MH-E.")
+(defconst mh-version "8.5+bzr" "Version number of MH-E.")
 
 ;; Variants
 
@@ -235,6 +230,11 @@ User's mail folder directory.")
 (defvar mh-arrow-marker nil
   "Marker for arrow display in fringe.")
 
+(defvar mh-blacklist nil
+  "List of messages to use to train the junk filter.
+This variable can be used by
+`mh-before-commands-processed-hook'.")
+
 (defvar mh-colors-available-flag nil
   "Non-nil means colors are available.")
 
@@ -287,13 +287,20 @@ Elements have the form (SEQUENCE . MESSAGES).")
 (defvar mh-show-buffer nil
   "Buffer that displays message for this folder.")
 
-(defvar mh-showing-mode nil
-  "If non-nil, show the message in a separate window.")
+(define-minor-mode mh-showing-mode
+  "Minor mode to show the message in a separate window."
+  ;; FIXME: maybe this should be moved to mh-show.el.
+  :lighter " Show")
 
 (defvar mh-view-ops nil
   "Stack of operations that change the folder view.
 These operations include narrowing or threading.")
 
+(defvar mh-whitelist nil
+  "List of messages to use to train the junk filter.
+This variable can be used by
+`mh-before-commands-processed-hook'.")
+
 ;; MH-Show Locals (alphabetical)
 
 (defvar mh-globals-hash (make-hash-table)
@@ -345,7 +352,7 @@ Name of the Previous sequence.")
   "Non-nil means that we have \"flists\".")
 
 (defvar mh-index-data-file ".mhe_index"
-  "MH-E specific file where index seach info is stored.")
+  "MH-E specific file where index search info is stored.")
 
 (defvar mh-letter-header-field-regexp "^\\([A-Za-z][A-Za-z0-9-]*\\):")
 
@@ -616,7 +623,8 @@ Output is expected to be shown to user, not parsed by MH-E."
   (mh-exchange-point-and-mark-preserving-active-mark))
 
 ;; Shush compiler.
-(defvar mark-active)                    ; XEmacs
+(mh-do-in-xemacs
+  (defvar mark-active))
 
 (defun mh-exchange-point-and-mark-preserving-active-mark ()
   "Put the mark where point is now, and point where the mark is now.
@@ -933,7 +941,7 @@ finally GNU mailutils MH."
      (t
       (message "Unknown variant %s; use %s"
                variant
-               (mapconcat '(lambda (x) (format "%s" (car x)))
+               (mapconcat (lambda (x) (format "%s" (car x)))
                           (mh-variants) " or "))))))
 
 (defcustom-mh mh-variant 'autodetect
@@ -1179,7 +1187,7 @@ lowercase for mailing lists and uppercase for people."
   "*Non-nil means to expand aliases entered in the minibuffer.
 
 In other words, aliases entered in the minibuffer will be
-expanded to the full address in the message draft. By default,
+expanded to the full address in the message draft.  By default,
 this expansion is not performed."
   :type 'boolean
   :group 'mh-alias
@@ -2217,6 +2225,17 @@ commands."
   :group 'mh-sequences
   :package-version '(MH-E . "7.0"))
 
+(defcustom-mh mh-whitelist-preserves-sequences-flag t
+  "*Non-nil means that sequences are preserved when messages are whitelisted.
+
+If a message is in any sequence (except \"Previous-Sequence:\"
+and \"cur\") when it is whitelisted, then it will still be in
+those sequences in the destination folder. If this behavior is
+not desired, then turn off this option."
+  :type 'boolean
+  :group 'mh-sequences
+  :package-version '(MH-E . "8.4"))
+
 ;;; Reading Your Mail (:group 'mh-show)
 
 (defcustom-mh mh-bury-show-buffer-flag t
@@ -2402,7 +2421,8 @@ of citations entirely, choose \"None\"."
 ;;  "X-Mailer:"                         ;
 ;;  "X-Operator:"                       ; Similar to X-Mailer, so display it
 
-;; Keep fields alphabetized (set sort-fold-case to t first).
+;; Keep fields alphabetized with case folding. Use M-:(setq
+;; sort-fold-case t) from the minibuffer to accomplish this.
 ;; Mention source, if known.
 (defvar mh-invisible-header-fields-internal
   '(
@@ -2420,6 +2440,8 @@ of citations entirely, choose \"None\"."
     "Auto-forwarded:"                   ; RFC 2156
     "Autoforwarded:"                    ; RFC 2156
     "Bestservhost:"
+    "Bounces-To:"
+    "Bounces_to:"
     "Bytes:"
     "Cancel-Key:"                       ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "Cancel-Lock:"                      ; NNTP posts
@@ -2449,7 +2471,7 @@ of citations entirely, choose \"None\"."
     "Followup-To:"                      ; RFC 1036
     "For-Approval:"                     ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "For-Comment:"                      ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
-    "For-Handdling:"                    ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+    "For-Handling:"                     ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "Forwarded:"                        ; MH
     "From "                             ; sendmail
     "Generate-Delivery-Report:"         ; RFC 2156
@@ -2480,7 +2502,7 @@ of citations entirely, choose \"None\"."
     "Original-NNTP-"                    ; mail to news
     "Original-Path:"                    ; mail to news
     "Original-Received:"                ; mail to news
-    "Original-Recipt:"                  ; RFC 2298
+    "Original-Recipient:"               ; RFC 2298
     "Original-To:"                      ; mail to news
     "Original-X-"                       ; mail to news
     "Origination-Client:"               ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
@@ -2510,7 +2532,7 @@ of citations entirely, choose \"None\"."
     "Seal-Send-Time:"
     "See-Also:"                         ; H. Spencer: News Article Format and Transmission, June 1994
     "Sensitivity:"                      ; RFC 2156, 2421
-    "Speach-Act:"                       ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+    "Speech-Act:"                       ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "Status:"                           ; sendmail
     "Supersedes:"                       ; H. Spencer: News Article Format and Transmission, June 1994
     "Telefax:"                          ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
@@ -2525,9 +2547,11 @@ of citations entirely, choose \"None\"."
     "X-Abuse-Info:"
     "X-Accept-Language:"                ; Netscape/Mozilla
     "X-Ack:"
+    "X-ACL-Warn:"                      ; http://www.exim.org
     "X-Admin:"                          ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "X-Administrivia-To:"
     "X-AMAZON"                          ; Amazon.com
+    "X-AnalysisOut:"                    ; Exchange
     "X-AntiAbuse:"                      ; cPanel
     "X-Antivirus-Scanner:"
     "X-AOL-IP:"                         ; AOL WebMail
@@ -2537,18 +2561,30 @@ of citations entirely, choose \"None\"."
     "X-AuditID:"
     "X-Authenticated-Info:"             ; Verizon.net?
     "X-Authenticated-Sender:"           ; AT&T Message Center (webmail)
+    "X-Authentication-Info:"            ; verizon.net?
     "X-Authentication-Warning:"         ; sendmail
     "X-Authority-Analysis:"
+    "X-Auto-Response-Suppress:"         ; Exchange
     "X-Barracuda-"                      ; Barracuda spam scores
+    "X-Bayes-Prob:"                     ; IEEE spam filter
     "X-Beenthere:"                      ; Mailman mailing list manager
+    "X-BFI:"
     "X-Bigfish:"
     "X-Bogosity:"                       ; bogofilter
+    "X-BPS1:"                          ; http://www.boggletools.com
+    "X-BPS2:"                          ; http://www.boggletools.com
     "X-Brightmail-Tracker:"             ; Brightmail
     "X-BrightmailFiltered:"             ; Brightmail
     "X-Bugzilla-"                       ; Bugzilla
+    "X-Cam-"                            ; Cambridge scanners
+    "X-Campaign-Id:"
+    "X-Campaign:"
     "X-Campaignid:"
+    "X-CanIt-Geo:"                      ; IEEE spam filter
+    "X-Cloudmark-SP-"                  ; Cloudmark (www.cloudmark.com)
     "X-Comment:"                        ; AT&T Mailennium
     "X-Complaints-To:"                  ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+    "X-Completed:"
     "X-Confirm-Reading-To:"             ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "X-Content-Filtered-By:"
     "X-ContentStamp:"                   ; NetZero
@@ -2556,18 +2592,23 @@ of citations entirely, choose \"None\"."
     "X-Cr-Hashedpuzzle:"
     "X-Cr-Puzzleid:"
     "X-Cron-Env:"
-    "X-DCC-Usenix-Metrics:"
+    "X-DCC-"                            ; SpamAssassin
     "X-Declude-"                        ; http://www.declude.com/x-note.htm
     "X-Dedicated:"
     "X-Delivered"
+    "X-Destination-ID:"
+    "X-detected-operating-system:"     ; GNU.ORG?
     "X-DH-Virus-"
     "X-DMCA"
+    "X-DocGen-Version:"                        ; DocGen
     "X-Domain:"
     "X-Echelon-Distraction"
     "X-EFL-Spamscore:"                  ; MIT alumni spam filtering
     "X-eGroups-"                        ; Egroups/yahoogroups mailing list manager
     "X-EID:"
     "X-ELNK-Trace:"                     ; Earthlink mailer
+    "X-EM-"                            ; Some ecommerce software
+    "X-Email-Type-Id:"                 ; Paypal http://www.paypal.com
     "X-Enigmail-Version:"
     "X-Envelope-Date:"                  ; GNU mailutils
     "X-Envelope-From:"                  ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
@@ -2577,29 +2618,39 @@ of citations entirely, choose \"None\"."
     "X-Evolution:"                      ; Evolution mail client
     "X-ExtLoop"
     "X-Face:"                           ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+    "X-Facebook"                        ; Facebook
+    "X-FB-SS:"
     "X-fmx-"
     "X-Folder:"                         ; Spam
+    "X-Forwarded-"                      ; Google+
     "X-From-Line"
+    "X-FuHaFi:"                                ; http://www.gmx.net/
+    "X-Generated-By:"                   ; launchpad.net
     "X-Gmail-"                          ; Gmail
     "X-Gnus-Mail-Source:"               ; gnus
     "X-Google-"                         ; Google mail
     "X-Google-Sender-Auth:"
     "X-Greylist:"                       ; milter-greylist-1.2.1
-    "X-Habeas-SWE-"                     ; Spam
+    "X-Habeas-"                                ; http://www.returnpath.net
     "X-Hashcash:"                       ; hashcash
+    "X-Headers-End:"                    ; SpamCop
     "X-HPL-"
     "X-HR-"
     "X-HTTP-UserAgent:"
     "X-Hz"                             ; Hertz
     "X-Identity:"                       ; http://www.declude.com/x-note.htm
+    "X-IEEE-UCE-"                       ; IEEE spam filter
     "X-Image-URL:"
     "X-IMAP:"                           ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "X-Info:"                           ; NTMail
     "X-IronPort-"                       ; IronPort AV
     "X-ISI-4-30-3-MailScanner:"
     "X-J2-"
+    "X-Jira-Fingerprint:"               ; JIRA
+    "X-Junkmail-"                       ; RCN?
     "X-Juno-"                           ; Juno
     "X-Key:"
+    "X-Launchpad-"                      ; plaunchpad.net
     "X-List-Host:"                      ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "X-List-Subscribe:"                 ; Unknown mailing list managers
     "X-List-Unsubscribe:"               ; Unknown mailing list managers
@@ -2608,18 +2659,24 @@ of citations entirely, choose \"None\"."
     "X-Loop:"                           ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "X-Lrde-Mailscanner:"
     "X-Lumos-SenderID:"                 ; Roving ConstantContact
+    "X-mail_abuse_inquiries:"          ; http://www.salesforce.com
     "X-Mail-from:"                      ; fastmail.fm
     "X-MAIL-INFO:"                      ; NetZero
     "X-Mailer_"
+    "X-MailFlowPolicy:"                        ; Cisco Email Security (formerly IronPort; http://www.ironport.com)
     "X-Mailing-List:"                   ; Unknown mailing list managers
+    "X-MailingID:"
     "X-Mailman-Approved-At:"            ; Mailman mailing list manager
     "X-Mailman-Version:"                ; Mailman mailing list manager
     "X-MailScanner"                     ; ListProc(tm) by CREN
     "X-Mailutils-Message-Id"            ; GNU Mailutils
     "X-Majordomo:"                      ; Majordomo mailing list manager
+    "X-Match:"
+    "X-MaxCode-Template:"              ; Paypal http://www.paypal.com
     "X-MB-Message-"                     ; AOL WebMail
     "X-MDaemon-Deliver-To:"
     "X-MDRemoteIP:"
+    "X-ME-Bayesian:"                   ; http://www.newmediadevelopment.net/page.cfm/parent/Client-Area/content/Managing-spam/
     "X-Message-Id"
     "X-Message-Type:"
     "X-MessageWall-Score:"              ; Unknown mailing list manager, AUC TeX
@@ -2632,12 +2689,16 @@ of citations entirely, choose \"None\"."
     "X-MS-"                             ; MS Outlook
     "X-Msmail-"                         ; MS Outlook
     "X-MSMail-Priority"                 ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+    "X-MXL-Hash:"
     "X-NAI-Spam-"                       ; Network Associates Inc. SpamKiller
     "X-News:"                           ; News
     "X-Newsreader:"                     ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "X-No-Archive:"                     ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
     "X-Notes-Item:"                     ; Lotus Notes Domino structured header
+    "X-Notification-"                   ; Google+
+    "X-Notifications:"                  ; Google+
     "X-OperatingSystem:"
+    "X-Oracle-Calendar:"                ; Oracle calendar invitations
     "X-ORBL:"
     "X-Orcl-Content-Type:"
     "X-Organization:"
@@ -2654,6 +2715,7 @@ of citations entirely, choose \"None\"."
     "X-PID:"
     "X-PMG-"
     "X-PMX-Version:"
+    "X-Policyd-Weight:"                 ; policyd-weight (Postfix)
     "X-Postfilter:"
     "X-Priority:"                       ; MS Outlook
     "X-Proofpoint-"                    ; Proofpoint mail filter
@@ -2679,14 +2741,20 @@ of citations entirely, choose \"None\"."
     "X-SBRS:"
     "X-SBRule:"                         ; Spam
     "X-Scanned-By:"
+    "X-Sender-ID:"                      ; Google+
     "X-Sender:"                         ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+    "X-Sendergroup:"                   ; Cisco Email Security (formerly IronPort; http://www.ironport.com)
     "X-Server-Date:"
     "X-Server-Uuid:"
     "X-Service-Code:"
+    "X-SFDC-"                          ; http://www.salesforce.com
     "X-Sieve:"                          ; Sieve filtering
+    "X-SMFBL:"
+    "X-SMHeaderMap:"
     "X-SMTP-"
     "X-Source"
-    "X-Spam-"                           ; Spamassassin
+    "X-Spam-"                           ; SpamAssassin
+    "X-Spam:"                           ; Exchange
     "X-SpamBouncer:"                    ; Spam
     "X-SPF-"
     "X-Status"
@@ -2694,6 +2762,7 @@ of citations entirely, choose \"None\"."
     "X-Submissions-To:"
     "X-Sun-Charset:"
     "X-Telecom-Digest"
+    "X-TM-IMSS-Message-ID:"            ; http://www.trendmicro.com
     "X-Trace:"
     "X-UID"
     "X-UIDL:"                           ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
@@ -2704,15 +2773,23 @@ of citations entirely, choose \"None\"."
     "X-USANET-"                         ; usa.net
     "X-Usenet-Provider"
     "X-UserInfo1:"
+    "X-VGI-OESCD:"
+    "X-VirtualServer:"
+    "X-VirtualServerGroup:"
     "X-Virus-"                          ;
     "X-Vms-To:"
     "X-VSMLoop:"                        ; NTMail
     "X-WebTV-Signature:"
     "X-Wss-Id:"                         ; Worldtalk gateways
     "X-X-Sender:"                       ; http://people.dsv.su.se/~jpalme/ietf/mail-headers/
+    "X-XPT-XSL-Name:"                  ; Paypal http://www.paypal.com
+    "X-xsi-"
+    "X-XWALL-"                         ; http://www.dataenter.co.at/doc/xwall_undocumented_config.htm
+    "X-Y-GMX-Trusted:"                 ; http://www.gmx.net/
     "X-Yahoo"
     "X-Yahoo-Newman-"
     "X-YMail-"
+    "X-ZixNet:"
     "X400-"                             ; X400
     "Xref:"                             ; RFC 1036
     )
@@ -3106,9 +3183,10 @@ annotated messages with `mh-annotate-list'."
 (defcustom-mh mh-before-commands-processed-hook nil
   "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests.
 
-Variables that are useful in this hook include `mh-delete-list'
-and `mh-refile-list' which can be used to see which changes will
-be made to the current folder, `mh-current-folder'."
+Variables that are useful in this hook include `mh-delete-list',
+`mh-refile-list', `mh-blacklist', and `mh-whitelist' which can be
+used to see which changes will be made to the current folder,
+`mh-current-folder'."
   :type 'hook
   :group 'mh-hooks
   :group 'mh-folder
@@ -3138,6 +3216,13 @@ before sending, add the `ispell-message' function."
   :group 'mh-letter
   :package-version '(MH-E . "6.0"))
 
+(defcustom-mh mh-blacklist-msg-hook nil
+  "Hook run by \\<mh-letter-mode-map>\\[mh-junk-blacklist] after marking each message for blacklisting."
+  :type 'hook
+  :group 'mh-hooks
+  :group 'mh-show
+  :package-version '(MH-E . "8.4"))
+
 (defcustom-mh mh-delete-msg-hook nil
   "Hook run by \\<mh-letter-mode-map>\\[mh-delete-msg] after marking each message for deletion.
 
@@ -3191,7 +3276,9 @@ function used to insert the signature with
   :group 'mh-letter
   :package-version '(MH-E . "8.0"))
 
-(defcustom-mh mh-kill-folder-suppress-prompt-hooks '(mh-search-p)
+(mh-define-obsolete-variable-alias 'mh-kill-folder-suppress-prompt-hooks
+  'mh-kill-folder-suppress-prompt-functions "24.3")
+(defcustom-mh mh-kill-folder-suppress-prompt-functions '(mh-search-p)
   "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder].
 
 The hook functions are called with no arguments and should return
@@ -3301,6 +3388,13 @@ sequence."
   :group 'mh-sequences
   :package-version '(MH-E . "6.0"))
 
+(defcustom-mh mh-whitelist-msg-hook nil
+  "Hook run by \\<mh-letter-mode-map>\\[mh-junk-whitelist] after marking each message for whitelisting."
+  :type 'hook
+  :group 'mh-hooks
+  :group 'mh-show
+  :package-version '(MH-E . "8.4"))
+
 \f
 
 ;;; Faces (:group 'mh-faces + group where faces described)
@@ -3519,6 +3613,13 @@ specified colors."
   :group 'mh-folder
   :package-version '(MH-E . "8.0"))
 
+(defface-mh mh-folder-blacklisted
+  (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
+  "Blacklisted message face."
+  :group 'mh-faces
+  :group 'mh-folder
+  :package-version '(MH-E . "8.4"))
+
 (defface-mh mh-folder-body
   (mh-face-data 'mh-folder-msg-number
                 '((((class color))
@@ -3608,6 +3709,13 @@ format `mh-scan-format-nmh' and the regular expression
   :group 'mh-folder
   :package-version '(MH-E . "8.0"))
 
+(defface-mh mh-folder-whitelisted
+  (mh-face-data 'mh-folder-refiled '((t (:inherit mh-folder-refiled))))
+  "Whitelisted message face."
+  :group 'mh-faces
+  :group 'mh-folder
+  :package-version '(MH-E . "8.4"))
+
 (defface-mh mh-letter-header-field (mh-face-data 'mh-letter-header-field)
   "Editable header field value face in draft buffers."
   :group 'mh-faces
@@ -3725,5 +3833,4 @@ The background and foreground are used in the image."
 ;; sentence-end-double-space: nil
 ;; End:
 
-;; arch-tag: cce884de-bd37-4104-9963-e4439d5ed22b
 ;;; mh-e.el ends here