emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sendmail.el bug or expected behavior?


From: Simon Josefsson
Subject: Re: sendmail.el bug or expected behavior?
Date: Mon, 26 Jan 2004 17:21:24 +0100
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

I see much discussion, but few solutions.  Here is one idea (I can't
implement this now, but since I thought about the problem briefly, I
reckoned I should write it down somewhere):

The actual problem that users actually encounter seem to be when
`sendmail-program' points to a non-existing, a non-executable, or a
non-conforming (i.e., it rejects a command line parameter or exit
immediately because of invalid configuration file) application.

I think all of these cases can be detected, without negatively
affecting proper operation, by using start-process instead of
call-process with BUFFER=0.  The code would spawn the process, poll
the process for, e.g., 1 second, and if it is still running, continue.
If it returns with a fatal error code within 1 second, report that to
the user.  One potential problem would be that if sendmail is still
running when emacs is about to quit, then the process should not be
killed.  How can you achieve that?  There is
process-kill-without-query, but a process-forget-without-query would
be needed here.

E.g., replace

(setq foo (call-process ... 0 ...))

with

(setq foo (start-process ...))
(sit-for 1)
(unless (eq 0 (process-exit-status foo))
  (error "Invoking sendmail failed..."))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]