From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#31271: 25.2; exported deleted RMAIL emails should have theit deleted flag reset Date: Sat, 02 Jun 2018 13:08:00 +0300 Message-ID: <83po19ec1r.fsf@gnu.org> References: <83o9hcgf0h.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1527934027 5286 195.159.176.226 (2 Jun 2018 10:07:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Jun 2018 10:07:07 +0000 (UTC) Cc: 31271@debbugs.gnu.org To: pot@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 02 12:07:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fP3R8-0001GR-PA for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jun 2018 12:07:03 +0200 Original-Received: from localhost ([::1]:58978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fP3TF-0006O0-Mc for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Jun 2018 06:09:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fP3T7-0006NN-85 for bug-gnu-emacs@gnu.org; Sat, 02 Jun 2018 06:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fP3T4-00030Q-19 for bug-gnu-emacs@gnu.org; Sat, 02 Jun 2018 06:09:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50489) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fP3T3-00030D-UD for bug-gnu-emacs@gnu.org; Sat, 02 Jun 2018 06:09:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fP3T3-0006IO-Ov for bug-gnu-emacs@gnu.org; Sat, 02 Jun 2018 06:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Jun 2018 10:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31271 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31271-submit@debbugs.gnu.org id=B31271.152793409524145 (code B ref 31271); Sat, 02 Jun 2018 10:09:01 +0000 Original-Received: (at 31271) by debbugs.gnu.org; 2 Jun 2018 10:08:15 +0000 Original-Received: from localhost ([127.0.0.1]:58386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fP3SJ-0006HN-0P for submit@debbugs.gnu.org; Sat, 02 Jun 2018 06:08:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fP3SG-0006H8-U6 for 31271@debbugs.gnu.org; Sat, 02 Jun 2018 06:08:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fP3SA-0001aZ-Qa for 31271@debbugs.gnu.org; Sat, 02 Jun 2018 06:08:07 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fP3S2-0001OP-9n; Sat, 02 Jun 2018 06:07:58 -0400 Original-Received: from [176.228.60.248] (port=2088 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fP3S1-0007AJ-Ha; Sat, 02 Jun 2018 06:07:58 -0400 In-reply-to: <83o9hcgf0h.fsf@gnu.org> (message from Eli Zaretskii on Sat, 19 May 2018 12:40:14 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:146850 Archived-At: Ping! I'd like to commit this change and close the bug, please provide your feedback. > Date: Sat, 19 May 2018 12:40:14 +0300 > From: Eli Zaretskii > Cc: 31271@debbugs.gnu.org > > > Date: Thu, 26 Apr 2018 14:27:04 +0200 > > From: Francesco Potortì > > > > In Rmail, suppose you want to archive your last received email to two > > different mboxes. Then you 'o' to the first one, then 'o' to the second > > one. After the first one, the email is marked as filed, deleted. > > > > I argue that the 'deleted' flag should be reset when archiving the email > > to the second mbox. > > Does the patch below give good results? I didn't feel like changing > the default behavior, on account of it being so old, so I added an > option one can customize to get the new behavior. > > What about invoking 'o' with a prefix argument -- should it stop > ignoring deleted messages when it looks for the N-1 additional > messages to output to a file, when this option is set non-nil? > > diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el > index eee8805..6d91ac5 100644 > --- a/lisp/mail/rmailout.el > +++ b/lisp/mail/rmailout.el > @@ -56,6 +56,13 @@ rmail-fields-not-to-output > regexp) > :group 'rmail-output) > > +(defcustom rmail-output-reset-deleted-flag nil > + "Non-nil means reset the \"deleted\" flag when outputting a message to a file." > + :type '(choice (const :tag "Output with the \"deleted\" flag reset" t) > + (const :tag "Output with the \"deleted\" flag intact" nil)) > + :version "27.1" > + :group 'rmail-output) > + > (defun rmail-output-read-file-name () > "Read the file name to use for `rmail-output'. > Set `rmail-default-file' to this name as well as returning it. > @@ -533,8 +540,12 @@ rmail-output > (if (zerop rmail-total-messages) > (error "No messages to output")) > (let ((orig-count count) > - beg end) > + beg end delete-attr-reset-p) > (while (> count 0) > + (when (and rmail-output-reset-deleted-flag > + (rmail-message-deleted-p rmail-current-message)) > + (rmail-set-attribute rmail-deleted-attr-index nil) > + (setq delete-attr-reset-p t)) > (setq beg (rmail-msgbeg rmail-current-message) > end (rmail-msgend rmail-current-message)) > ;; All access to the buffer's local variables is now finished... > @@ -549,6 +560,8 @@ rmail-output > (if babyl-format > (rmail-output-as-babyl file-name noattribute) > (rmail-output-as-mbox file-name noattribute))))) > + (if delete-attr-reset-p > + (rmail-set-attribute rmail-deleted-attr-index t)) > (or noattribute ; mark message as "filed" > (rmail-set-attribute rmail-filed-attr-index t)) > (setq count (1- count)) > > > >