Would a more sophisticated notmuch-fcc-dirs be acceptable?

Rob Browning rlb at defaultvalue.org
Sun Sep 26 19:22:48 PDT 2010


Rob Browning <rlb at defaultvalue.org> writes:

> I'd also like to fcc to a directory outside of message-directory

At least for this part, one possiblity would be to just use the chosen
directory literally (don't prepend message-directory) whenever it's an
absolute path according to file-name-absolute-p.

For example:

diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 32e7d0d..3c5d6c4 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -87,11 +87,13 @@
          ;; if we found no hit, use the first entry as default fallback
          (unless subdir (setq subdir (car (car notmuch-fcc-dirs)))))
 
-  ;; if there is no fcc header yet, add ours
-  (unless (message-fetch-field "fcc")
-    (message-add-header (concat "Fcc: "
-                                (file-name-as-directory message-directory)
-                                subdir)))
+      ;; if there is no fcc header yet, add ours
+      (unless (message-fetch-field "fcc")
+        (let ((path (if (file-name-absolute-p subdir)
+                        subdir
+                      (concat (file-name-as-directory message-directory)
+                              subdir))))
+          (message-add-header (concat "Fcc: " path))))
 
   ;; finally test if fcc points to a valid maildir
   (let ((fcc-header (message-fetch-field "fcc")))


If this seems reasonable, I'd be happy to work up a formal patch.

Thanks
-- 
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4


More information about the notmuch mailing list