[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45941: [PATCH] add option to mark buffer as modified after reading n
From: |
Andrea G. Monaco |
Subject: |
bug#45941: [PATCH] add option to mark buffer as modified after reading new message |
Date: |
Wed, 27 Jan 2021 18:47:06 +0100 |
> The first line of the docstring should be a complete sentence.
> Andreas.
Thanks, I didn't know that. I fixed it and also chose a more fitting
name for the variable.
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 29460cc20f..749cdd5891 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -686,6 +686,9 @@ rmail-show-mime-function
This function is called when `rmail-enable-mime' is non-nil.
The package providing MIME support should set this.")
+(defvar rmail-showing-new-message-sets-modified nil
+ "If non-nil, showing a new message sets the modified flag for the RMAIL
buffer.")
+
;;;###autoload
(defvar rmail-insert-mime-forwarded-message-function nil
"Function to insert a message in MIME format so it can be forwarded.
@@ -2747,10 +2750,11 @@ rmail-show-message-1
(t (setq rmail-current-message msg)))
(with-current-buffer rmail-buffer
(setq header-style rmail-header-style)
- ;; Mark the message as seen, but preserve buffer modified flag.
- (let ((modiff (buffer-modified-p)))
+ ;; Mark the message as seen, but preserve buffer modified flag,
+ ;; unless rmail-showing-new-message-sets-modified is non-nil
+ (let ((modiff (buffer-modified-p)))
(rmail-set-attribute rmail-unseen-attr-index nil)
- (unless modiff
+ (unless rmail-showing-new-message-sets-modified
(restore-buffer-modified-p modiff)))
;; bracket the message in the mail
;; buffer and determine the coding system the transfer encoding.
--
Andrea G. Monaco
Hacker, mathematician, lgbt+ activist
"Hope will never be silent!", H. Milk