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.help Subject: Re: "Rmail": Key "o" sometimes marks wrong mail as deleted Date: Thu, 13 Jun 2024 19:04:19 +0300 Message-ID: <864j9wzv5o.fsf@gnu.org> References: <66686d1c.170a0220.a9c3e.b374@mx.google.com> <86wmmv5vu7.fsf@gnu.org> <66698624.170a0220.f05b7.ffb9@mx.google.com> <867ceu1iik.fsf@gnu.org> <666aacd5.170a0220.5b5e8.1ff8@mx.google.com> <86ikydz16y.fsf@gnu.org> <666b14d2.170a0220.69455.417f@mx.google.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39727"; mail-complaints-to="usenet@ciao.gmane.io" To: Help-Gnu-Emacs@Gnu.Org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 13 18:04:53 2024 Return-path: Envelope-to: geh-help-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 1sHmwW-000A5n-U2 for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 13 Jun 2024 18:04:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHmw7-0004M1-KU; Thu, 13 Jun 2024 12:04:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHmw4-0004Kl-M8 for Help-Gnu-Emacs@Gnu.Org; Thu, 13 Jun 2024 12:04:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHmw4-0007TD-E1 for Help-Gnu-Emacs@Gnu.Org; Thu, 13 Jun 2024 12:04:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vr5AM7f3J48S1SseRW5xbNuG35MrnZLpjRw/lAjiY88=; b=ZlAYFVt6jLkL CBTBU+roPgf6MroJ5axWx1HYtM0VmMULSlgA6N5ANg56hWXvwEr5GfLQrKfI7I8y1atXFy6yZVOKV dj84YHqS5sCMzylWGruzGx/0MgSGk3v1o/ZPfm3IaTHu8IX1h++vJ7KXA0r5jEMzip8oMGzdGVjhl x+hLzXL3mBbz+XhXLVCFiwGV8pcSgrIPscFWeba52lVzS9YMVlWstPOXREtPlnidH9SiuEDvFOler EwtHMvxJ+EyklyB+a8Zwl6WSdVZX1AkWQtL8y7TTagw35R7/oSqWEk5omqEX8AnqC03ELuLkUGNmF OnwkaUwOUvHcbftbOOCRqA==; In-Reply-To: <666b14d2.170a0220.69455.417f@mx.google.com> (message from Dr Rainer Woitok on Thu, 13 Jun 2024 17:48:33 +0200) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146890 Archived-At: > From: Dr Rainer Woitok > Date: Thu, 13 Jun 2024 17:48:33 +0200 > Cc: Help-Gnu-Emacs@Gnu.Org > > > diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el > > index 49531ea..cfde335 100644 > > --- a/lisp/mail/rmailout.el > > +++ b/lisp/mail/rmailout.el > > @@ -579,7 +579,7 @@ rmail-output > > (progn > > (if rmail-delete-after-output > > (rmail-delete-message)) > > - (if (> count 0) > > + (if (>= count 0) > > (let ((msgnum rmail-current-message)) > > (rmail-next-message 1) > > (eq rmail-current-message (1+ msgnum))))) > > This will definitely not fix the misbehaviour I reported, because the > new line "(if (>= count 0)" is already in my 28.2 source file. I'm just stabbing in the dark, you know. I have no magic wands, just comparing relevant Rmail source files. Maybe this one, then? diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el index ba58090..21dec2b 100644 --- a/lisp/mail/rmailsum.el +++ b/lisp/mail/rmailsum.el @@ -1931,7 +1931,7 @@ rmail-summary-output (progn (require 'rmailout) (list (rmail-output-read-file-name) (prefix-numeric-value current-prefix-arg)))) - (let ((i 0) prev-msg) + (let ((i 0) prev-msg curmsg) (while (and (< i n) (progn (rmail-summary-goto-msg) @@ -1942,7 +1942,11 @@ rmail-summary-output (setq i (1+ i)) (with-current-buffer rmail-buffer (let ((rmail-delete-after-output nil)) + (setq curmsg rmail-current-message) (rmail-output file-name 1))) + ;; rmail-output sometimes moves to the next message; undo that. + (or (= curmsg (rmail-summary-msg-number)) + (rmail-summary-goto-msg curmsg)) (if rmail-delete-after-output (rmail-summary-delete-forward nil) (if (< i n)