From 195b91a3db2e1e2d09ad24c3fd060218c49a25f3 Mon Sep 17 00:00:00 2001 From: Josiah Schwab Date: Fri, 17 Feb 2017 14:52:06 -0800 Subject: [PATCH] Add example of matching maildir and its sub-directories in contexts Inspired by this mu-discuss thread: https://groups.google.com/d/msg/mu-discuss/rAT2YJPEwsA/eYmoGJbUCgAJ --- mu4e/mu4e.texi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mu4e/mu4e.texi b/mu4e/mu4e.texi index e652ca28..428c0e25 100644 --- a/mu4e/mu4e.texi +++ b/mu4e/mu4e.texi @@ -2508,11 +2508,11 @@ when starting; see the discussion in the previous section. :name "Work" :enter-func (lambda () (mu4e-message "Switch to the Work context")) ;; no leave-func - ;; we match based on the contact-fields of the message + ;; we match based on the maildir of the message + ;; this matches maildir /Arkham and its sub-directories :match-func (lambda (msg) - (when msg - (mu4e-message-contact-field-matches msg - :to "aderleth@@miskatonic.example.com"))) + (when msg + (string-match-p "^/Arkham" (mu4e-message-field msg :maildir)))) :vars '( ( user-mail-address . "aderleth@@miskatonic.example.com" ) ( user-full-name . "Alice Derleth" ) ( mu4e-compose-signature .