emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 702a47f4f6 1/2: Don't reset the inbox buffer's modified status in


From: Eli Zaretskii
Subject: master 702a47f4f6 1/2: Don't reset the inbox buffer's modified status in Rmail
Date: Thu, 10 Nov 2022 12:18:33 -0500 (EST)

branch: master
commit 702a47f4f6f1f06e5d1c2f472de5c06d47fc38a0
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    Don't reset the inbox buffer's modified status in Rmail
    
    * lisp/mail/rmail.el (rmail-get-new-mail-1): Don't mark the buffer
    unmodified if it was modified before getting new mail.  (Bug#59108)
---
 lisp/mail/rmail.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index f095d5e9c0..e3372a6ff4 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1751,6 +1751,7 @@ not be a new one).  It returns non-nil if it got any new 
messages."
            (spam-filter-p (and (featurep 'rmail-spam-filter)
                                rmail-use-spam-filter))
            (blurb "")
+            (mod-p (buffer-modified-p))
            result success suffix)
        (narrow-to-region (point) (point))
        ;; Read in the contents of the inbox files, renaming them as
@@ -1766,10 +1767,11 @@ not be a new one).  It returns non-nil if it got any 
new messages."
                  (rmail-insert-inbox-text files nil)
                (setq delete-files (rmail-insert-inbox-text files t))))
          ;; If there was no new mail, or we aborted before actually
-         ;; trying to get any, mark buffer unmodified.  Otherwise the
-         ;; buffer is correctly marked modified and the file locked
-         ;; until we save out the new mail.
-         (if (= (point-min) (point-max))
+         ;; trying to get any, mark buffer unmodified, unless it was
+         ;; modified originally.  Otherwise the buffer is correctly
+         ;; marked modified and the file locked until we save out the
+         ;; new mail.
+         (if (and (null mod-p) (= (point-min) (point-max)))
              (set-buffer-modified-p nil)))
        ;; Scan the new text and convert each message to
        ;; Rmail/mbox format.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]