From ee1f7669953d1af534f282b2ef5ec147ecc090b3 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 13 Jun 2021 01:19:48 +0100 Subject: jao-notmuch fixes --- lib/net/jao-notmuch.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/net') diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index fd2694f..85c241e 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -49,17 +49,17 @@ (prop-match-value p) (user-error "No message at point"))) -(defun jao-notmuch--move (full-path &optional d) +(defun jao-notmuch--move (full-path &optional d seen) (let* ((ff (jao-notmuch--path-to-mailbox full-path)) (d (or d (completing-read (format "From %s to: " ff) (remove ff jao-notmuch-mailboxes) nil t))) (dest (string-replace ff d full-path)) - (dest (replace-regexp-in-string ",U=.+$" "" dest)) + (dest (replace-regexp-in-string ",U=.+$" (if seen "m,S" "m") dest)) (fnd (file-name-nondirectory full-path)) (dnd (file-name-nondirectory dest))) (when (y-or-n-p (format "%s/%s -> %s/%s? " ff fnd d dnd)) (notmuch-tree-tag (append (notmuch-tag-change-list (split-string ff "/") t) - (split-string d "/"))) + (notmuch-tag-change-list (split-string d "/")))) (notmuch-tree-close-message-window) (rename-file full-path dest) (shell-command-to-string "notmuch new") @@ -79,7 +79,7 @@ (f (car (plist-get p :filename))) (mbox (car (split-string (jao-notmuch--path-to-mailbox f) "/")))) (notmuch-tree-tag '("-new" "-unread")) - (jao-notmuch--move f (concat mbox "/spam")))) + (jao-notmuch--move f (concat mbox "/spam") t))) ;; Targetting the displayed message from the tree view -- cgit v1.2.3