;; This file is part of Planner. It is not part of GNU Emacs.
@@ -55,14 +55,26 @@
(defun planner-mhe-get-message-real-folder ()
- "Return the name of the current message real folder, so if you use
- sequences, it will now work."
+ "Return the name of the current message real (or future in case of
+ refile) folder, so if you use sequences or refiles, it will now work."
- (let* ((folder
+ (let* ((folder
(if (equal major-mode 'mh-folder-mode)
+ ;; first, try to see if the message is refiled
+ (let ((refile-folder
+ (let ((num (mh-get-msg-num t)))
+ (loop for seq in mh-refile-list
+ when (member num (cdr seq)) return (symbol-name (car seq))
+ finally return nil)
+ (if refile-folder
;; Refer to the show buffer
(end-index (min (length mh-index-folder) (length folder))))
;; a simple test on mh-index-data does not work, because
;; mh-index-data is always nil in a show buffer.