From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Andrea G. Monaco" Newsgroups: gmane.emacs.bugs Subject: bug#45941: [PATCH] add option to mark buffer as modified after reading new message Date: Wed, 27 Jan 2021 18:47:06 +0100 Message-ID: <87zh0uuvad.fsf@autistici.org> References: <87h7nfbg7k.fsf@autistici.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8233"; mail-complaints-to="usenet@ciao.gmane.io" To: 45941@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 27 18:49:31 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4owc-000246-CU for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jan 2021 18:49:30 +0100 Original-Received: from localhost ([::1]:57032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4owa-0001TH-MH for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Jan 2021 12:49:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4ovC-0001QG-SY for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2021 12:48:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4ovC-0001aC-Ga for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2021 12:48:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l4ovC-0004lt-FI for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2021 12:48:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87h7nfbg7k.fsf@autistici.org> Resent-From: "Andrea G. Monaco" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Jan 2021 17:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45941 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161176964318276 (code B ref -1); Wed, 27 Jan 2021 17:48:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jan 2021 17:47:23 +0000 Original-Received: from localhost ([127.0.0.1]:46050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4ouR-0004kZ-04 for submit@debbugs.gnu.org; Wed, 27 Jan 2021 12:47:23 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:49980) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4ouP-0004kS-TI for submit@debbugs.gnu.org; Wed, 27 Jan 2021 12:47:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4ouP-0000xP-Kn for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2021 12:47:13 -0500 Original-Received: from devianza.investici.org ([198.167.222.108]:64199) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4ouN-0001Vg-11 for bug-gnu-emacs@gnu.org; Wed, 27 Jan 2021 12:47:13 -0500 Original-Received: from mx2.investici.org (unknown [127.0.0.1]) by devianza.investici.org (Postfix) with ESMTP id 4DQrdl6NdJz6v6R for ; Wed, 27 Jan 2021 17:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1611769627; bh=btgbefTy8AEi7RuJx8RhgpN7mJaXCjASK49diLSlmac=; h=From:To:Subject:Date:From; b=a5aQmzzmrAyH7wweouyX/mMsj4+3WyRRluNFJiiAKjohPxhMwaw61sQXFgh07NZwF w7xuZcUYKt/iQlXSoIjlWL/ygV++2DAFw4Di69RYxALUhfY9MshlrhSxkjdxvS4fvA TmuormkELPchyeCERrTdXgB25pFDeBmwzDbvPWHE= Original-Received: from [198.167.222.108] (mx2.investici.org [198.167.222.108]) (Authenticated sender: andrea.monaco@autistici.org) by localhost (Postfix) with ESMTPSA id 4DQrdl51ZQz6v2v for ; Wed, 27 Jan 2021 17:47:07 +0000 (UTC) Received-SPF: pass client-ip=198.167.222.108; envelope-from=andrea.monaco@autistici.org; helo=devianza.investici.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:198707 Archived-At: > 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