X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-maildir-fcc.el;h=9f09129defa7892e93e29bcdc02bab3ecafce512;hb=9be8c6802fa5ce7fa61a2656daf337ac935da423;hp=32b8100e7fed0a4d1bfa3ec03cbd9d329ce6fe72;hpb=0f37509cc7e92f2c09fcd7d7f3e2b477e4f29401;p=notmuch diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index 32b8100e..9f09129d 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -1,4 +1,4 @@ -;;; notmuch-maildir-fcc.el --- inserting using a fcc handler +;;; notmuch-maildir-fcc.el --- inserting using a fcc handler -*- lexical-binding: t -*- ;; Copyright © Jesse Rosenthal ;; @@ -29,6 +29,8 @@ (defvar notmuch-maildir-fcc-count 0) +;;; Options + (defcustom notmuch-fcc-dirs "sent" "Determines the Fcc Header which says where to save outgoing mail. @@ -83,8 +85,7 @@ directory if it does not exist yet when sending a mail." (const :tag "Use simple fcc" nil)) :group 'notmuch-send) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Functions which set up the fcc header in the message buffer. +;;; Functions which set up the fcc header in the message buffer. (defun notmuch-fcc-header-setup () "Add an Fcc header to the current message buffer. @@ -142,9 +143,7 @@ Insert header anyway? " subdir))) subdir (concat (notmuch-database-path) "/" subdir)))))) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Functions for saving a message either using notmuch insert or file -;; fcc. First functions common to the two cases. +;;; Functions for saving a message using either method. (defmacro with-temporary-notmuch-message-buffer (&rest body) "Set-up a temporary copy of the current message-mode buffer." @@ -204,8 +203,7 @@ normal fcc." (notmuch-maildir-fcc-with-notmuch-insert fcc-header) (notmuch-maildir-fcc-file-fcc fcc-header))) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Functions for saving a message using notmuch insert. +;;; Functions for saving a message using notmuch insert. (defun notmuch-maildir-notmuch-insert-current-buffer (folder &optional create tags) "Use notmuch insert to put the current buffer in the database. @@ -251,9 +249,7 @@ If CREATE is non-nil then create the folder if necessary." (?e (notmuch-maildir-fcc-with-notmuch-insert (read-from-minibuffer "Fcc header: " fcc-header))))))))) - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Functions for saving a message using file fcc. +;;; Functions for saving a message using file fcc. (defun notmuch-maildir-fcc-host-fixer (hostname) (replace-regexp-in-string "/\\|:" @@ -350,18 +346,20 @@ return t if successful, and nil otherwise." (let ((msg-id (notmuch-maildir-fcc-save-buffer-to-tmp destdir))) (when msg-id (cond (mark-seen - (condition-case err + (condition-case nil (notmuch-maildir-fcc-move-tmp-to-cur destdir msg-id t) (file-already-exists (throw 'link-error nil)))) (t - (condition-case err + (condition-case nil (notmuch-maildir-fcc-move-tmp-to-new destdir msg-id) (file-already-exists (throw 'link-error nil)))))) (delete-file (concat destdir "/tmp/" msg-id)))) t))) +;;; _ + (provide 'notmuch-maildir-fcc) ;;; notmuch-maildir-fcc.el ends here