From unknown Sat Jun 21 10:41:49 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10041: 23.3; Rmail save messages fails to complete after deleting all the messages in an inbox if a summary buffer exists [PATCH] Resent-From: Mark Lillibridge Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Nov 2011 19:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10041 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 10041@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Reply-To: mark.lillibridge@hp.com Received: via spool by submit@debbugs.gnu.org id=B.132121329932534 (code B ref -1); Sun, 13 Nov 2011 19:42:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Nov 2011 19:41:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RPfvu-0008Sh-IG for submit@debbugs.gnu.org; Sun, 13 Nov 2011 14:41:39 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RPfvr-0008SU-Nn for submit@debbugs.gnu.org; Sun, 13 Nov 2011 14:41:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPfvI-00053G-HE for submit@debbugs.gnu.org; Sun, 13 Nov 2011 14:41:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:52855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPfvI-00053C-Fr for submit@debbugs.gnu.org; Sun, 13 Nov 2011 14:41:00 -0500 Received: from eggs.gnu.org ([140.186.70.92]:58754) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPfvH-0002ZD-NL for bug-gnu-emacs@gnu.org; Sun, 13 Nov 2011 14:41:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RPfvG-000530-Nr for bug-gnu-emacs@gnu.org; Sun, 13 Nov 2011 14:40:59 -0500 Received: from gundega.hpl.hp.com ([192.6.19.190]:53529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RPfvG-00052w-DZ for bug-gnu-emacs@gnu.org; Sun, 13 Nov 2011 14:40:58 -0500 Received: from mailhub-pa1.hpl.hp.com (mailhub-pa1.hpl.hp.com [15.25.115.25]) by gundega.hpl.hp.com (8.14.4/8.14.4/HPL-PA Relay) with ESMTP id pADJesb4010623 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 13 Nov 2011 11:40:54 -0800 Received: from ts-rhel5 (ts-rhel5.hpl.hp.com [15.25.118.27]) by mailhub-pa1.hpl.hp.com (8.14.3/8.14.3/HPL-PA Hub) with ESMTP id pADJeq8t013364; Sun, 13 Nov 2011 11:40:53 -0800 From: Mark Lillibridge Date: Sun, 13 Nov 2011 11:40:52 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.71 on 15.0.48.190 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.6 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.6 (-----) This bug is easy to reproduce: create an Rmail inbox with a couple of messages and show its summary via 'h'. Now delete each of the messages then hit 's'. You will receive an error message "No messages to summarize", the summary (if any) will fail to be updated (still shows the deleted messages), the mode line for the Rmail buffer will show the wrong number of messages, and the buffer is not actually saved! You have to hit 's' again to get it to actually save the buffer. This bug is a direct consequence of Bug #9964: 23.3; Rmail is no longer able to display a summary buffer with no messages. In particular, rmail-new-summary[-1] throws an error if there are no messages in the inbox and this prevents rmail-expunge-and-save from completing its tasks. The correct fix is to fix bug 9964 -- that is, fix things so summary buffers with no messages work again. In the meantime, here's a workaround patch that just ignores errors from rmail-summary. - Mark ts-rhel5 [122]% ( setenv LC_ALL C ; setenv TZ UTC0 ; diff -Naur original-rmail.el rmail2.el ) --- original-rmail.el 2011-02-23 23:23:08.000000000 +0000 +++ rmail2.el 2011-11-13 19:23:49.408122000 +0000 @@ -3425,8 +3425,11 @@ (let ((total rmail-total-messages)) (with-current-buffer rmail-summary-buffer (let ((rmail-total-messages total)) - (rmail-update-summary)))) - (rmail-select-summary (rmail-update-summary)))) + ; ignore errors (twice) from rmail-update-summary as + ; workaround for bug #9964; FIXME: remove once that bug is + ; fixed: + (ignore-errors (rmail-update-summary))))) + (rmail-select-summary (ignore-errors (rmail-update-summary))))) ;; We always show a message, because (rmail-only-expunge t) ;; leaves the rmail buffer unswapped. ;; If we expunged the current message, a new one is current now, From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 13 21:02:10 2011 Received: (at control) by debbugs.gnu.org; 14 Nov 2011 02:02:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RPls9-00008D-RX for submit@debbugs.gnu.org; Sun, 13 Nov 2011 21:02:10 -0500 Received: from fencepost.gnu.org ([140.186.70.10] ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RPls7-000086-S8 for control@debbugs.gnu.org; Sun, 13 Nov 2011 21:02:08 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RPlrc-0004ng-NP for control@debbugs.gnu.org; Sun, 13 Nov 2011 21:01:36 -0500 Date: Sun, 13 Nov 2011 21:01:36 -0500 Message-Id: Subject: control message for bug 10041 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) forcemerge 9964 10041