unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Fix MH-E mail composition with GNU Mailutils
@ 2018-06-30 19:00 Mike Kupfer
  2018-06-30 19:21 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Kupfer @ 2018-06-30 19:00 UTC (permalink / raw)
  To: emacs-devel

Currently, trying to compose a message using MH-E with Mailutils fails:
no composition buffer is created, and the user gets an obscure error
message about deleting a non-empty directory.  This has been broken for
awhile (i.e., it's not a regression in 26.1), but the fix is pretty
simple.  Is this okay for emacs-26?

diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index a9f809cfa1..aa22df8b18 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -925,8 +925,10 @@ mh-bare-components
                      (list "-form" mh-comp-formfile)))
     (setq new (make-temp-file "comp."))
     (rename-file (concat temp-folder "/" "1") new t)
-    (delete-file (concat temp-folder "/" ".mh_sequences"))
-    (delete-directory temp-folder)
+    ;; The temp folder could contain various metadata files.  Rather
+    ;; than trying to enumerate all the known files, just do a
+    ;; recursive delete on the directory.
+    (delete-directory temp-folder t)
     new))
 
 (defun mh-read-draft (use initial-contents delete-contents-file)

thanks,
mike



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix MH-E mail composition with GNU Mailutils
  2018-06-30 19:00 [PATCH] Fix MH-E mail composition with GNU Mailutils Mike Kupfer
@ 2018-06-30 19:21 ` Eli Zaretskii
  2018-06-30 20:55   ` Mike Kupfer
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2018-06-30 19:21 UTC (permalink / raw)
  To: Mike Kupfer; +Cc: emacs-devel

> From: Mike Kupfer <mkupfer@alum.berkeley.edu>
> Date: Sat, 30 Jun 2018 12:00:40 -0700
> 
> Currently, trying to compose a message using MH-E with Mailutils fails:
> no composition buffer is created, and the user gets an obscure error
> message about deleting a non-empty directory.  This has been broken for
> awhile (i.e., it's not a regression in 26.1), but the fix is pretty
> simple.  Is this okay for emacs-26?

Please at least explain the reason(s) for the problem.  How else can
we reason about the necessity and risk(s) of getting this into
emacs-26.

And shouldn't we invite the MH-E developers to this discussion?

Thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix MH-E mail composition with GNU Mailutils
  2018-06-30 19:21 ` Eli Zaretskii
@ 2018-06-30 20:55   ` Mike Kupfer
  2018-07-04 16:38     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Kupfer @ 2018-06-30 20:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii wrote:

> > From: Mike Kupfer <mkupfer@alum.berkeley.edu>
> > Date: Sat, 30 Jun 2018 12:00:40 -0700
> > 
> > Currently, trying to compose a message using MH-E with Mailutils fails:
> > no composition buffer is created, and the user gets an obscure error
> > message about deleting a non-empty directory.  This has been broken for
> > awhile (i.e., it's not a regression in 26.1), but the fix is pretty
> > simple.  Is this okay for emacs-26?
> 
> Please at least explain the reason(s) for the problem.  How else can
> we reason about the necessity and risk(s) of getting this into
> emacs-26.

The problem comes about because of the way MH-E deals with some versions
of nmh, which use a non-simple-text templating mechanism for mail
composition, and which do not provide a convenient interface for MH-E
mail composition.  MH-E creates the draft email in a temporary folder
and then removes the temporary folder, as part of setting up the
composition buffer.  Right now MH-E knows about the metadata file that
nmh creates during the creation of the draft email, but Mailutils-MH has
at least one other metadata file.  So when MH-E tries to delete the
temporary folder, the deletion errors out, which aborts the rest of the
composition steps.

> And shouldn't we invite the MH-E developers to this discussion?

I posted this patch on June 7 on the MH-E developers list; see
https://sourceforge.net/p/mh-e/mailman/mh-e-devel/?viewmonth=201806 for
what little discussion there was.

mike



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Fix MH-E mail composition with GNU Mailutils
  2018-06-30 20:55   ` Mike Kupfer
@ 2018-07-04 16:38     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2018-07-04 16:38 UTC (permalink / raw)
  To: Mike Kupfer; +Cc: emacs-devel

> From: Mike Kupfer <mkupfer@alum.berkeley.edu>
> cc: emacs-devel@gnu.org
> Date: Sat, 30 Jun 2018 13:55:26 -0700
> 
> > Please at least explain the reason(s) for the problem.  How else can
> > we reason about the necessity and risk(s) of getting this into
> > emacs-26.
> 
> The problem comes about because of the way MH-E deals with some versions
> of nmh, which use a non-simple-text templating mechanism for mail
> composition, and which do not provide a convenient interface for MH-E
> mail composition.  MH-E creates the draft email in a temporary folder
> and then removes the temporary folder, as part of setting up the
> composition buffer.  Right now MH-E knows about the metadata file that
> nmh creates during the creation of the draft email, but Mailutils-MH has
> at least one other metadata file.  So when MH-E tries to delete the
> temporary folder, the deletion errors out, which aborts the rest of the
> composition steps.
> 
> > And shouldn't we invite the MH-E developers to this discussion?
> 
> I posted this patch on June 7 on the MH-E developers list; see
> https://sourceforge.net/p/mh-e/mailman/mh-e-devel/?viewmonth=201806 for
> what little discussion there was.

OK, I'm sold.  Thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-04 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-30 19:00 [PATCH] Fix MH-E mail composition with GNU Mailutils Mike Kupfer
2018-06-30 19:21 ` Eli Zaretskii
2018-06-30 20:55   ` Mike Kupfer
2018-07-04 16:38     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).