.bashrc: $PS1: +Termux exception.
[nethome.git] / .muttrc.addons
index fa43908..be5d45e 100644 (file)
@@ -1,12 +1,13 @@
 # System-wide personalization for Mutt
 ######################################
 
-folder-hook ""        set sort=threads
-folder-hook "!"       set sort=mailbox-order
-folder-hook "=sent"   set sort=mailbox-order
-folder-hook "=spam"   set sort=mailbox-order
-folder-hook "=err"    set sort=mailbox-order
-folder-hook "=input$" set sort=mailbox-order
+# '!' an '=' are expand only as the very first characters.
+# regexes are processed.
+# '$' must follow alpha or '{' to get interpreted as a variable.
+folder-hook ""                   set sort=threads;set pager_index_lines=10
+folder-hook "!$"                 set sort=mailbox-order;push "*<Tab>";set pager_index_lines=0
+folder-hook "=(=|err|rhbug)"     set sort=mailbox-order;push "*<Tab>";set pager_index_lines=0
+folder-hook "=(sent|spam|input)" set sort=mailbox-order;push "*";set pager_index_lines=0
 bind index <Tab> next-new
 bind pager <Tab> next-new
 bind index <Esc><Tab> previous-new
@@ -16,7 +17,8 @@ bind pager \` next-unread
 bind index <Esc>\` previous-unread
 bind pager <Esc>\` previous-unread
 unset strict_threads
-set editor="vim -c 'set noai' -c 'set ts=8'"
+# tw=78 is for gq and RFC 2822 section 2.1.1.
+set editor="vim -c 'set noai' -c 'set ts=8' -c 'set tw=78'"
 set send_charset="us-ascii:iso-2022-jp:utf-8"
 set charset="utf-8"
 set autoedit
@@ -51,37 +53,60 @@ set date_format="!%a, %d %b %Y %H:%M:%S %z" # RFC 2822: 3.3.
 # but %d will place +0000 for %z and thus brokes the timestamp
 set attribution="On %D, %n wrote:"
 unset markers
+# Mailman; FIXME: Patch Mutt to extend it multiline.
+color body brightred default "^_______________________________________________\r?\n$"
+macro index <Esc>m "l~N|~O\n"
+macro pager <Esc>f ":set pager_index_lines=0\n
+macro pager <Esc>g ":set pager_index_lines=10\n"
 
 
 # Mail command
 ##############
 bind index \ca mail
-macro index M ":my_hdr X-Priority: 1\n:my_hdr Importance: high\n:set dsn_return=hdrs\n:set dsn_notify=failure,delay,success\n^a" "DSN and Priority-1 classed compose of a new mail message"
-macro index m ":unmy_hdr X-Priority Importance\n:unset dsn_return dsn_notify\n^a" "Standard compose of a new mail message"
+macro index M ":set dsn_return=hdrs\n:set dsn_notify=failure,delay,success\n^a" "DSN compose of a new mail message"
+macro index m ":unset dsn_return dsn_notify\n^a" "Standard compose of a new mail message"
 # quote 'macro' argument to prevent: macro: too many arguments
-folder-hook ""      "macro index S \":unset wait_key\n|spamassassin --report\n:set wait_key\ns=spamo-mutt\n\""
-folder-hook "=spam" "macro index S \":unset wait_key\n|spamassassin --report\n:set wait_key\nWN\ct~T\n\""
-folder-hook ""      "macro pager S \":unset wait_key\n|spamassassin --report\n:set wait_key\ns=spamo-mutt\n\""
-folder-hook "=spam" "macro pager S \":unset wait_key\n|spamassassin --report\n:set wait_key\n\""
-folder-hook ""      "macro index H \":unset wait_key\n|spamassassin --revoke\n:set wait_key\nWN\ct~T\n\""
-folder-hook ""      "macro pager H \":unset wait_key\n|spamassassin --revoke\n:set wait_key\n\""
+# `spamassassin {--report|--revoke}' calls `sa-learn {--spam|--ham}' automatically.
+set pipe_split
+folder-hook ""      "macro index S \":unset wait_key\n|spamassassin --report&\n:set wait_key\ns=spamo-mutt\n\""
+folder-hook "=spam" "macro index S \":unset wait_key\n|spamassassin --report&\n:set wait_key\nWN\ct~T\n\""
+folder-hook ""      "macro pager S \":unset wait_key\n|spamassassin --report&\n:set wait_key\ns=spamo-mutt\n\""
+folder-hook "=spam" "macro pager S \":unset wait_key\n|spamassassin --report&\n:set wait_key\n\""
+folder-hook ""      "macro index H \":unset wait_key\n|spamassassin --revoke \n:set wait_key\nWN\ct~T\n\""
+folder-hook ""      "macro pager H \":unset wait_key\n|spamassassin --revoke \n:set wait_key\n\""
 macro editor \ew "^a  [^e]^a"
 
 # GPG
 #####
-source /home/lace/.muttrc-gpg.rc
+source ~/.muttrc-gpg.rc
 unset pgp_show_unusable
 set pgp_replyencrypt
 set pgp_replysignencrypted
 
 # Ignore headers
 ################
-ignore received content- mime-version status x-status message-id sender
-ignore references return-path lines precedence x-authentication-warning
-ignore list-help list-subscribe list-unsubscribe list-post list-archive
-ignore x-mimetrack priority x-priority importance x-mime-autoconverted
-ignore x-accept-language resent-message-id x-sender x-antirelay
-ignore x-msmail-priority x-mimeole x-pop3-rcpt delivered-to
+unignore *
+ignore received: content-transfer-encoding: content-length: Content-Disposition:
+ignore mime-version: status: x-status: sender:
+ignore references: lines: x-authentication-warning:
+ignore list-help: list-subscribe: list-unsubscribe: list-post:
+ignore x-loop: errors-to: x-beenthere: X-Mailman-Version: X-Sieve:
+ignore x-mimetrack: priority: x-priority: importance: precedence: x-mime-autoconverted:
+ignore x-accept-language: x-sender: x-antirelay:
+ignore x-msmail-priority: x-mimeole: x-pop3-rcpt: delivered-to:
+ignore face: organization: x-scanned-by: x-bugzilla-
+ignore DKIM-Signature: DomainKey-Signature: X-RedHat-Spam-Score:
+ignore Authentication-Results: X-Virus-Found: X-Spam-SWARE-Status: X-HELO:
+ignore X-Google-DKIM-Signature: X-Gm-Message-State: X-Received: X-IsSubscribed:
+ignore ARC-Seal: ARC-Message-Signature: ARC-Authentication-Results: Received-SPF: DMARC-Filter: DKIM-Filter: Auto-Submitted: X-Greylist:
+ignore X-Spam-Status X-Spam-Checker-Version X-AuditID X-MTR Msgkey X-EPLocale X-EPWebmail-Msg-Type X-EPWebmail-Reply-Demand
+ignore X-EPApproval-Locale X-EPHeader X-EPTrCode X-EPTrName X-MLAttribute X-RootMTR X-ParentMTR X-ArchiveUser X-CPGSPASS
+ignore X-Brightmail-Tracker X-ClientProxiedBy X-MS-PublicTrafficType X-MS-Office365-Filtering-Correlation-Id X-Microsoft-Antispam
+ignore X-Microsoft-Exchange-Diagnostics X-MS-TrafficTypeDiagnostic X-Microsoft-Antispam-PRVS
+ignore X-Exchange-Antispam-Report-Test X-Exchange-Antispam-Report-CFA-Test SpamDiagnosticOutput SpamDiagnosticMetadata
+ignore X-Forefront-PRVS X-Forefront-Antispam-Report X-MS-Exchange-CrossTenant-OriginalArrivalTime
+ignore X-MS-Exchange-CrossTenant-FromEntityHeader X-MS-Exchange-Transport-CrossTenantHeadersStamped X-OriginatorOrg
+color header brightyellow black ^(From|Subject|To|Cc|Bcc|Message-ID):
 
 # Colors
 ########
@@ -97,9 +122,9 @@ color message brightcyan black
 color normal white black
 color attachment brightmagenta black
 color search black green  # how to hilite search patterns in the pager
-color header brightyellow black ^(From|Subject):
 color body brightyellow black "(ftp|http)://[^ ]+"  # point out URLs
 color body brightcyan black [-a-z_0-9.]+@[-a-z_0-9.]+ # e-mail addresses
 color underline brightgreen black
 mono header underline ^(From|Subject):
 mono quoted bold
+macro index V ":color index black white .*\n:color header black white ^(From|Subject|To|Cc|Bcc|Message-ID):\n:color hdrdefault black white\n:color quoted cyan white\n:color signature brightred white\n:color indicator brightyellow red\n:color error brightred white\n:color status brightyellow blue\n:color tree brightmagenta white  # the thread tree in the index menu\n:color tilde brightmagenta white\n:color message brightcyan white\n:color normal black white\n:color attachment brightmagenta white\n:color search black green  # how to hilite search patterns in the pager\n:color body brightyellow white '(ftp|http)://[^ ]+'  # point out URLs\n:color body black white [-a-z_0-9.]+@[-a-z_0-9.]+ # e-mail addresses\n:color underline brightgreen white\n\cl"