GNU bug report logs - #69738
[BUG] rmail-mail-new-frame doesn't delete the new frame after composing the message on Emacs 29.2

Previous Next

Package: emacs;

Reported by: rameiko87 <at> posteo.net

Date: Mon, 11 Mar 2024 22:51:02 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 69738 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: rameiko87 <at> posteo.net
Cc: 69738 <at> debbugs.gnu.org
Subject: Re: bug#69738: Followup
Date: Sun, 14 Apr 2024 12:44:34 +0300
> Date: Sat, 13 Apr 2024 17:44:32 +0000
> From: rameiko87 <at> posteo.net
> 
> Hello,
> 
> I use emacs -nw. I tried but just can't: the current way that 
> rmail-mail-return is implemented makes no sense when 
> rmail-mail-new-frame is true: every time I send an email I'm left with 
> an extra frame displaying the duplicate of a buffer which either is 
> already open on another frame, or which was buried and for some reason 
> now resuscitates. Every time I have to manually delete such frame. It's 
> very reasonable to expect that after creating a new frame just to send 
> an email, then such frame is gotten rid of when the message is send (or 
> aborted or whatever), and we're back to the original frame (as was 
> originally implied by the manual).
> 
> The fact that it's such a reasonable expectation and that it takes so 
> much inconvenience to delete the extra frame manually every time, makes 
> me think that it should be this way by default, hence the manual was 
> good and the code was to be changed... and I bet that every person which 
> uses -nw with rmail-mail-new-frame will agree with me; is there any good 
> reason to keep it this way, which escapes my analysis?

Does the patch below solve your use cases?

diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index d422383..5ab67b2 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3755,9 +3755,12 @@ rmail-mail-return
    ;; probably wants to delete it now.
    ((display-multi-frame-p)
     (delete-frame))
-   ;; The previous frame is where normally they have the Rmail buffer
-   ;; displayed.
-   (t (other-frame -1))))
+   (t
+    ;; The previous frame is where normally they have the Rmail buffer
+    ;; displayed.
+    (let ((fr (selected-frame)))
+      (other-frame -1)
+      (delete-frame fr)))))
 
 (defun rmail-mail ()
   "Send mail in another window.




This bug report was last modified 1 year and 26 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.