From: Daimrod <daimrod@gmail.com>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: Gnus <ding@gnus.org>
Subject: Re: [PATCH] don't kill err-buffer if `sendmail-send-it' fails
Date: Wed, 07 Aug 2013 13:02:25 +0200 [thread overview]
Message-ID: <87wqnxhigu.fsf@tanger.home> (raw)
In-Reply-To: <m3iozibm97.fsf@stories.gnus.org> (Lars Magne Ingebrigtsen's message of "Tue, 06 Aug 2013 22:24:52 +0200")
[-- Attachment #1.1: Type: text/plain, Size: 691 bytes --]
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Daimrod <daimrod@gmail.com> writes:
>
>> I have already a copyright assignment for Emacs. (my number is 793656)
>
> Ah, so you're Grégoire Jadi.
Yes.
> Could you re-spin the patch? It doesn't really apply since the file
> names in the patch are "new" and "old", which doesn't really exist in
> the Emacs tree.
>
> The naming convention "err?" is not used in Emacs, so rename that
> variable to something else.
Is `debug' a better name? (`errp' sounds weird)
I think it's a good idea to switch to the error buffer, otherwise users
won't know it exists, so I've added a call to
`switch-to-buffer-other-window'.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-lisp-mail-sendmail.el-sendmail-send-it-Do-not-kill-t.patch --]
[-- Type: text/x-diff, Size: 2333 bytes --]
From c47092e75db9e622b83770152224479b9a870a49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9goire=20Jadi?= <gregoire.jadi@gmail.com>
Date: Wed, 7 Aug 2013 12:45:21 +0200
Subject: [PATCH] * lisp/mail/sendmail.el (sendmail-send-it): Do not kill the
error buffer if an error occurs.
---
lisp/mail/sendmail.el | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index e1dee32..8b93cf2 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1114,6 +1114,7 @@ external program defined by `sendmail-program'."
(let ((errbuf (if mail-interactive
(generate-new-buffer " sendmail errors")
0))
+ (debug nil)
(tembuf (generate-new-buffer " sendmail temp"))
(multibyte enable-multibyte-characters)
(case-fold-search nil)
@@ -1278,10 +1279,13 @@ external program defined by `sendmail-program'."
(exit-value (apply 'call-process-region args)))
(cond ((or (null exit-value) (eq 0 exit-value)))
((numberp exit-value)
+ (setq debug t)
(error "Sending...failed with exit value %d" exit-value))
((stringp exit-value)
+ (setq debug t)
(error "Sending...terminated by signal: %s" exit-value))
(t
+ (setq debug t)
(error "SENDMAIL-SEND-IT -- fall through: %S" exit-value))))
(or fcc-was-found
(error "No recipients")))
@@ -1290,12 +1294,15 @@ external program defined by `sendmail-program'."
(goto-char (point-min))
(while (re-search-forward "\n\n* *" nil t)
(replace-match "; "))
- (if (not (zerop (buffer-size)))
- (error "Sending...failed to %s"
- (buffer-substring (point-min) (point-max)))))))
+ (unless (zerop (buffer-size))
+ (setq debug t)
+ (error "Sending...failed to %s"
+ (buffer-substring (point-min) (point-max)))))))
(kill-buffer tembuf)
- (if (bufferp errbuf)
- (kill-buffer errbuf)))))
+ (if (and (bufferp errbuf)
+ (not debug))
+ (kill-buffer errbuf)
+ (switch-to-buffer-other-window errbuf)))))
(autoload 'rmail-output-to-rmail-buffer "rmailout")
--
1.8.0.2722.gc0242e5
[-- Attachment #1.3: Type: text/plain, Size: 23 bytes --]
--
Daimrod/Greg
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 835 bytes --]
next prev parent reply other threads:[~2013-08-07 11:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-27 19:07 Daimrod
2013-03-13 21:53 ` Daimrod
2013-05-05 15:03 ` Daimrod
2013-08-01 16:21 ` Lars Magne Ingebrigtsen
2013-08-06 17:54 ` Daimrod
2013-08-06 20:24 ` Lars Magne Ingebrigtsen
2013-08-07 11:02 ` Daimrod [this message]
2013-08-12 17:24 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wqnxhigu.fsf@tanger.home \
--to=daimrod@gmail.com \
--cc=ding@gnus.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).