]> git.eshelyaron.com Git - emacs.git/commitdiff
Ensure Rmail summary is updated after editing a message
authorEli Zaretskii <eliz@gnu.org>
Tue, 19 Nov 2019 15:59:02 +0000 (17:59 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 19 Nov 2019 15:59:02 +0000 (17:59 +0200)
* lisp/mail/rmailedit.el (rmail-cease-edit): If this mbox file
has a summary, update the summary after editing.  (Bug#38193)

lisp/mail/rmailedit.el

index 01d552469faaabf57f9f7f732b36500a12bcc386..43422ff3a41a335379fda22a4932a955e47af452 100644 (file)
@@ -149,6 +149,7 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'.
 
 
 (declare-function rmail-summary-enable "rmailsum" ())
+(declare-function rmail-summary-update-line "rmailsum" (n))
 
 (defun rmail-cease-edit ()
   "Finish editing message; switch back to Rmail proper."
@@ -340,10 +341,11 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'.
         ;; Delete previous body.  This must be after all insertions at the end,
         ;; so the marker for the beginning of the next message isn't messed up.
         (delete-region end (point-max)))
-      (rmail-set-attribute rmail-edited-attr-index t))
-;;;??? BROKEN perhaps.
-;;;    (if (boundp 'rmail-summary-vector)
-;;;    (aset rmail-summary-vector (1- rmail-current-message) nil))
+      (rmail-set-attribute rmail-edited-attr-index t)
+      (if (rmail-summary-exists)
+          (let ((msgnum rmail-current-message))
+            (with-current-buffer rmail-summary-buffer
+              (rmail-summary-update-line msgnum)))))
     (rmail-show-message)
     (rmail-toggle-header (if pruned 1 0))
     ;; Restore mime display state.