MH-E: remember destination when refiling a thread (SF#473)

* lisp/mh-e/mh-thread.el (mh-thread-refile): Add an optional argument
'dont-update-last-destination-flag'.  If it is nil, update
'mh-last-destination' and 'mh-last-destination-folder'.

Copyright-paperwork-exempt: yes
This commit is contained in:
Henrique Martins
2026-04-10 11:04:09 -07:00
committed by Mike Kupfer
parent 923eb9afef
commit b07a3970ae

View File

@@ -193,7 +193,7 @@ sibling."
(mh-thread-next-sibling t))
;;;###mh-autoload
(defun mh-thread-refile (folder)
(defun mh-thread-refile (folder &optional dont-update-last-destination-flag)
"Refile (output) thread into FOLDER."
(interactive (list (intern (mh-prompt-for-refile-folder))))
(cond ((not (memq 'unthread mh-view-ops))
@@ -201,6 +201,9 @@ sibling."
((eobp)
(error "No message at point"))
(t (let ((region (mh-thread-find-children)))
(unless dont-update-last-destination-flag
(setq mh-last-destination (cons 'refile folder)
mh-last-destination-folder mh-last-destination))
(mh-iterate-on-messages-in-region () (car region) (cadr region)
(mh-refile-a-msg nil folder))
(mh-next-msg)))))