Subject: bug#10625: 23.3; message does not close new message fraom opened from rmail

From: "David J. Biesack" <[email-masked]>
Date: Fri, 27 Jan 2012 13:50:58 -0500

M-x customize-group
set rmail-mail-new-frame to t and save for the session
M-x rmail
press r to reply to a message - it opens in a new frame as expected.
press C-c C-c to send the message; the frame does not close.

http://www.slac.stanford.edu/comp/unix/gnu-info/emacs_30.html says

"f you set the variable rmail-mail-new-frame to a non-nil value, then all the Rmail commands to start sending a message create a new frame to edit it in. This frame is deleted when you send the message, or when you use the `Don't Send' item in the `Mail' menu."

It appears rmail-reply sets a frame parameter mail-dedicated-frame and mail-bury in sendmail.el checks for this. However, rmail-reply now uses message mode, not mail mode, and message-send-and-exit does not check this frame property.

I think the correct fix is to not use the property but to add a function to message-exit-actions:

(setq message-exit-actions (cons 'message-exit-actions message-exit-actions))

(defun message-delete-frame ()
   (delete-frame (selected-frame))
   (setq message-exit-actions (remq message-exit-actions 'message-delete-frame)))

(Note the remq so that if someone returns to the sent message buffer and edits/sends again, it won't delete that frame as well)

However, this won't delete the frame if I decide to abort the message and just kill-buffer; perhaps adding message-delete-frame to kill-buffer-hook (but I don't think that's a buffer-local).

thanks,
djb

In GNU Emacs 23.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.0)
 of 2011-03-30 on Hippie
Windowing system distributor `The X.Org Foundation', version 11.0.11004000
configured using `configure  '--prefix=/u/sasdjb/ubuntu''

Important settings:
  value of $LC_ALL: C
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  display-time-mode: t
  shell-dirtrack-mode: t
  delete-selection-mode: t
  pc-selection-mode: t
  show-paren-mode: t
  iswitchb-mode: t
  nxhtml-menu-mode: t
  nxhtml-tag-do-also: t
  popcmp-group-alternatives: t
  popcmp-short-help-beside-alts: t
  mlinks-active-links: t
  rngalt-minimal-validation-header: t
  rngalt-display-validation-header: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: (only . t)
  abbrev-mode: t
  hs-minor-mode: t

Recent input:
C-p C-p C-p C-s f r a m e C-s C-s C-s C-s M-b M-b M-b 
M-b C-s C-w C-w C-w C-w C-x o C-s C-s C-x o C-x b m 
e s s a g e . e l <return> C-x o C-n C-n C-n C-n C-n 
C-n C-n C-n C-e M-b M-b M-b M-b C-s C-w C-w C-w C-x 
o C-s C-s C-s C-a M-x p w d <return> C-u C-x c C-g 
M-x i g r e p - f i l e <return> <backspace> <backspace> 
n SPC <return> C-y M-y <M-backspace> <M-backspace> 
<M-backspace> <M-backspace> <M-backspace> <M-backspace> 
<M-down-mouse-2> <M-mouse-2> C-a C-e m a i l - d e 
d i c a t e - f a <backspace> r a m e M-b C-b d C-e 
<return> C-e <return> y <down-mouse-1> <drag-mouse-1> 
C-x o C-x b R M <return> p C-x C-s C-x o <escape> X 
<return> <help-echo> <down-mouse-1> <mouse-2> <help-echo> 
<help-echo> <down-mouse-1> <mouse-1> <escape> E <help-echo> 
<down-mouse-1> <mouse-1> <f12> o <return> d <help-echo> 
<down-mouse-1> <mouse-2> <help-echo> <down-mouse-1> 
<mouse-1> d <down-mouse-1> <mouse-1> d <down-mouse-1> 
<mouse-1> R <down-mouse-1> <mouse-1> <return> a g a 
i n <switch-frame> <down-mouse-1> <mouse-movement> 
<mouse-1> <escape> D <switch-frame> <down-mouse-1> 
<mouse-movement> <mouse-1> <switch-frame> <down-mouse-1> 
<mouse-movement> <mouse-movement> <drag-mouse-1> <up> 
<left> C-SPC C-M-f M-w <switch-frame> <down-mouse-1> 
<mouse-movement> <mouse-1> <escape> <escape> C-y <return> 
C-c C-c <switch-frame> <down-mouse-1> <mouse-movement> 
<mouse-1> C-s C-w C-w C-s C-s C-s C-s <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> C-z 0 <down-mouse-1> 
<mouse-1> R C-h c C-c C-c <help-echo> <help-echo> <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> C-x 4 C-f 
m e s s a g e . e l <return> <help-echo> C-x k SPC 
C-x b m e s s a g e . e l <return> <help-echo> <down-mouse-5> 
<mouse-5> <down-mouse-1> <mouse-movement> <mouse-movement> 
<C-drag-mouse-1> C-c <down-mouse-1> <mouse-1> M-x r 
e p o r t - e m SPC <return>

Recent messages:
354 Start mail input; end with <CRLF>.<CRLF>
250 OK: <[email-masked]>
Appended to /u/sasdjb/mail-archive/sent-mail
Sending...done
Mark saved where search started
Fill column set to 10000 (was 72)
Mark set
C-c C-c runs the command message-send-and-exit
(New file)
Kill buffer message.el|mail/? (y or n) 

Load-path shadows:
/u/sasdjb/emacs/nxhtml/web-vcs hides /u/sasdjb/emacs/web-vcs
/u/sasdjb/emacs/nxhtml/nxhtml-web-vcs hides /u/sasdjb/emacs/nxhtml-web-vcs
/u/sasdjb/emacs/bs hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/bs
/u/sasdjb/emacs/ibuffer hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/ibuffer
/u/sasdjb/emacs/xml hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/xml
/u/sasdjb/emacs/midnight hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/midnight
/u/sasdjb/emacs/wdired hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/wdired
/u/sasdjb/emacs/autoinsert hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/autoinsert
/u/sasdjb/emacs/whitespace hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/whitespace
/u/sasdjb/emacs/indent hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/indent
/u/sasdjb/emacs/align hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/align
/u/sasdjb/emacs/cmuscheme hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/cmuscheme
/u/sasdjb/emacs/uniquify hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/uniquify
/u/sasdjb/emacs/url/url-gw hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-gw
/u/sasdjb/emacs/url/url-mailto hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-mailto
/u/sasdjb/emacs/url/url-history hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-history
/u/sasdjb/emacs/url/url-dired hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-dired
/u/sasdjb/emacs/url/url-ldap hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-ldap
/u/sasdjb/emacs/url/url-util hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-util
/u/sasdjb/emacs/url/url-dav hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-dav
/u/sasdjb/emacs/url/url-privacy hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-privacy
/u/sasdjb/emacs/url/url-news hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-news
/u/sasdjb/emacs/url/url-methods hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-methods
/u/sasdjb/emacs/url/url-imap hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-imap
/u/sasdjb/emacs/url/url-about hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-about
/u/sasdjb/emacs/url/url-handlers hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-handlers
/u/sasdjb/emacs/url/url-ftp hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-ftp
/u/sasdjb/emacs/url/url-auth hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-auth
/u/sasdjb/emacs/url/url-cookie hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-cookie
/u/sasdjb/emacs/url/url-nfs hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-nfs
/u/sasdjb/emacs/url/url-http hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-http
/u/sasdjb/emacs/url/url hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url
/u/sasdjb/emacs/url/url-proxy hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-proxy
/u/sasdjb/emacs/url/url-cid hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-cid
/u/sasdjb/emacs/url/url-ns hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-ns
/u/sasdjb/emacs/url/url-file hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-file
/u/sasdjb/emacs/url/url-parse hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-parse
/u/sasdjb/emacs/url/url-expand hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-expand
/u/sasdjb/emacs/url/url-vars hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-vars
/u/sasdjb/emacs/url/url-irc hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-irc
/u/sasdjb/emacs/url/url-misc hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-misc
/u/sasdjb/emacs/url/url-cache hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/url/url-cache
/u/sasdjb/emacs/table hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/textmodes/table
/u/sasdjb/emacs/glasses hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/progmodes/glasses
/u/sasdjb/emacs/cpp hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/progmodes/cpp
/u/sasdjb/emacs/sh-script hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/progmodes/sh-script
/u/sasdjb/emacs/icon hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/progmodes/icon
/u/sasdjb/emacs/antlr-mode hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/progmodes/antlr-mode
/u/sasdjb/emacs/xscheme hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/progmodes/xscheme
/u/sasdjb/emacs/solitaire hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/play/solitaire
/u/sasdjb/emacs/zone hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/play/zone
/u/sasdjb/emacs/metamail hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/mail/metamail
/u/sasdjb/emacs/elp hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/emacs-lisp/elp
/u/sasdjb/emacs/trace hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/emacs-lisp/trace
/u/sasdjb/emacs/re-builder hides /u/sasdjb/ubuntu/share/emacs/23.3/lisp/emacs-lisp/re-builder

Features:
(shadow emacsbug cl-specs tabify igrep sh-script executable rmail-spam-filter ebnf2ps ps-print ps-def lpr spell ses unsafep rcirc newst-backend mpc htmlfontify esh-var esh-io esh-cmd esh-ext esh-proc esh-arg eldoc esh-groups eshell esh-module esh-mode esh-util erc-goodies erc erc-backend erc-compat doc-view jka-compr image-mode calc calc-loaddefs calc-macs debug edebug uudecode supercite regi spam-report spam spam-stat gnus-uu yenc binhex multi-isearch footnote auth-source mailalias gnus-msg gnus-art mm-uu mml2015 epg-config mm-view smime dig gnus-sum nnoo gnus-group gnus-undo nnmail mail-source format-spec gnus-start gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems sort add-hook mail-extr rmailout parse-time timezone rmail-mode-hooks rmail-summary-ext rmailsum icalendar cal-menu calendar cal-loaddefs message-mode-hooks mime-open smtpmail mailto ph quoted-printable whitespace rmailmm message ecomplete rfc822 mml mml-sec password-cache mailabbrev nnheader gmm-utils mailheader canlock sha1 hex-util hashcash rmail mail-utils ef ansi-color color-themes color-theme edmacro kmacro sendmail reporter color-theme-autoloads time server gnus-dired my-keys resizing bg shell thing goto-addr edit-server password-keeper-mode sensitive-mode password-generator ps-ccrypt andersl-java-font-lock delsel pc-select complete dired-efap dired-sort-map dired-a dired-aux paren iswitchb msb javadecomp autobrowse last-mod disp-table nxhtml-autostart nxhtml-autoload moz cc-cmds majmodpri nxhtml-menu udev-rinari udev-ecb udev flymake-js flymake css-color nxhtml-mode html-quote tidy-xhtml ediff-merg ediff-diff ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff html-imenu imenu loadhist popcmp xhtml-help mlinks url-expand url-util url-methods html-toc xml fupd html-pagetoc foldit appmenu-fold appmenu mumamo sgml-mode rngalt rng-nxml nxml-mode nxml-outln nxml-rap nxml-glyph rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-util nxml-enc xmltok cc-engine cc-vars cc-defs help-mode view flyspell ispell fold-dwim hideshow html-upl html-site derived url-parse url-vars ourcomments-util uniquify recentf tree-widget org byte-opt warnings org-footnote org-src org-list org-faces org-compat org-macs noutline outline ido bookmark apropos grep ffip compile comint ring gimpedit dired regexp-opt nxhtml-web-vcs web-vcs bytecomp byte-compile rx web-autoload mm-decode gnus-util netrc mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mm-util time-date mail-prsvr cus-edit easymenu wid-edit nxhtml-base easy-mmode cl cl-19 ascii-conversion my-login-shell quickurl browse-url pp thingatpt advice help-fns advice-preload midnight desktop cus-start cus-load tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind font-render-setting gtk x-toolkit x multi-tty emacs)

-- 
David J. Biesack, SAS
SAS Campus Dr. Cary, NC 27513
www.sas.com    (919) 531-7771