From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Unseen attribute doesn't get saved in rmail Date: Thu, 31 Dec 2020 18:31:25 +0200 Message-ID: <83o8iagco2.fsf@gnu.org> References: <87sg7m3wdx.fsf@autistici.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33174"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: "Andrea G. Monaco" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 31 17:33:00 2020 Return-path: Envelope-to: ged-emacs-devel@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 1kv0sm-0008U0-GT for ged-emacs-devel@m.gmane-mx.org; Thu, 31 Dec 2020 17:33:00 +0100 Original-Received: from localhost ([::1]:50108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kv0sl-0003kP-Id for ged-emacs-devel@m.gmane-mx.org; Thu, 31 Dec 2020 11:32:59 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kv0rc-0003Ik-5Y for emacs-devel@gnu.org; Thu, 31 Dec 2020 11:31:48 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:51794) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kv0rb-0006am-HF; Thu, 31 Dec 2020 11:31:47 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1934 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kv0ra-0002Sq-FH; Thu, 31 Dec 2020 11:31:47 -0500 In-Reply-To: <87sg7m3wdx.fsf@autistici.org> (andrea.monaco@autistici.org) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:262175 Archived-At: > From: "Andrea G. Monaco" > Date: Thu, 31 Dec 2020 15:03:54 +0100 > > ;; Mark the message as seen, but preserve buffer modified flag. > (let ((modiff (buffer-modified-p))) > (rmail-set-attribute rmail-unseen-attr-index nil) > (unless modiff > (restore-buffer-modified-p modiff))) > > So the modified flag is explicitly cleared after reading a new message. > Is there some reason I can't see for this behavior? Maybe we could add a > configuration option to let the user choose. I think you can use rmail-show-message-hook to call a function that sets the buffer's modified flag, then reading a message will leave that set.