From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/83118 Path: news.gmane.org!not-for-mail From: Daimrod Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH] don't kill err-buffer if `sendmail-send-it' fails Date: Sun, 05 May 2013 17:03:05 +0200 Message-ID: <874neh79li.fsf@tanger.home> References: <87fw0hk22y.fsf@tanger.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1367766105 28278 80.91.229.3 (5 May 2013 15:01:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 May 2013 15:01:45 +0000 (UTC) To: Gnus Original-X-From: ding-owner+M31384@lists.math.uh.edu Sun May 05 17:01:43 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UZ0Rb-00029e-9r for ding-account@gmane.org; Sun, 05 May 2013 17:01:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1UZ0QX-0001CT-1g; Sun, 05 May 2013 10:00:37 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1UZ0QV-0001CA-2C for ding@lists.math.uh.edu; Sun, 05 May 2013 10:00:35 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1UZ0QT-0001BX-Gr for ding@lists.math.uh.edu; Sun, 05 May 2013 10:00:34 -0500 Original-Received: from mail-wg0-f43.google.com ([74.125.82.43]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1UZ0QR-0005ez-Rf for ding@gnus.org; Sun, 05 May 2013 17:00:31 +0200 Original-Received: by mail-wg0-f43.google.com with SMTP id c11so2771797wgh.34 for ; Sun, 05 May 2013 08:00:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=d3SVzeJRWZjxRZnI6afoo28vkm7/ORVUddh8Mq8uiAI=; b=G9ZelpEEQLydcykwVzuWxKGSV386zQVbJEygngFY7s1ynRFmZ6AkH+j4hDqYErTy9x sQ9ywXvC2PPMiYUhbqxpXTNhK252Vex+HjOU2/62NVRnvJorj/s+IWFXbesrbj2fhhRs 4VT+YOPpAHYDBXPuiBQTGDz5ya2wGre1z43tHJOZhd57aIvuoYpEuMiObwmSinnuTC/R u/EE9caerp9l/5lPhoCkdjyx6H4pIpVSsmr68fQoTG8CiQg286WaRvFbSHxGWUkIFcnp hoqK7vSTm2zMhOiqeg6RYf3QfSTSsFJavpX0xIrd7m2SNDn4tBBQYxA9D9Ka+5dfRM5i udog== X-Received: by 10.180.149.200 with SMTP id uc8mr5086979wib.3.1367766026474; Sun, 05 May 2013 08:00:26 -0700 (PDT) Original-Received: from localhost (ANantes-653-1-103-225.w90-54.abo.wanadoo.fr. [90.54.46.225]) by mx.google.com with ESMTPSA id m13sm1976862wiw.7.2013.05.05.08.00.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 05 May 2013 08:00:25 -0700 (PDT) In-Reply-To: <87fw0hk22y.fsf@tanger.home> (daimrod@gmail.com's message of "Wed, 27 Feb 2013 20:07:33 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: -3.0 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:83118 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Daimrod writes: > Hi, > > Here is a small patch for `sendmail-send-it' that I've made while I was > trying to understand why I couldn't connect to my imap server. > > I've just added a boolean to avoid to kill the error buffer if an error > occurs. > > > --- old 2013-02-27 19:53:00.000000000 +0100 > +++ new 2013-02-27 19:57:03.000000000 +0100 > @@ -6,6 +6,7 @@ > (let ((errbuf (if mail-interactive > (generate-new-buffer " sendmail errors") > 0)) > + err? > (tembuf (generate-new-buffer " sendmail temp")) > (multibyte enable-multibyte-characters) > (case-fold-search nil) > @@ -170,21 +171,27 @@ > (exit-value (apply 'call-process-region args))) > (cond ((or (null exit-value) (eq 0 exit-value))) > ((numberp exit-value) > + (setq err? t) > (error "Sending...failed with exit value %d" exit-value)) > ((stringp exit-value) > + (setq err? t) > (error "Sending...terminated by signal: %s" exit-value)) > (t > + (setq err? t) > (error "SENDMAIL-SEND-IT -- fall through: %S" exit-value)))) > - (or fcc-was-found > - (error "No recipients"))) > + (unless fcc-was-found > + (setq err? t) > + (error "No recipients"))) > (if mail-interactive > (with-current-buffer errbuf > (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))))))) > + (when (not (zerop (buffer-size))) > + (setq err? t) > + (error "Sending...failed to %s" > + (buffer-substring (point-min) (point-max))))))) > (kill-buffer tembuf) > - (if (bufferp errbuf) > - (kill-buffer errbuf))))) > + (when (and (bufferp errbuf) > + (not err?)) > + (kill-buffer errbuf))))) bump again. Could I have some feedback on this? Am I the only one who find it useful? Did I miss something like an option to enable debugging? =2D-=20 Daimrod/Greg --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAEBAgAGBQJRhnSrAAoJEBNzVHcrZRiUEVAP/3WObWZeZExpCy/IqPoIK7hf llfOagpXdKGnovZqnNCc2+5Ldrid08gQCq4TcYNPMpAA3zEUXwIJJkmIRNT2ksS7 JF4m4UTZCHlmyuwrJC2usu90gpUg2TucDVcNKcNUGriX9zlz6Brfh1fxpM8q+qyk 4ajBchQGjHOc1I0eYbmw9X5JMhZlc1FIN+AK36/sl4z6ctgaRCM591jTa2z0g176 9pc8MuPhq2hv71aJ9DTToTuouruJXBfMStaHhK8iRNPKJTnjjRa9rviaOQaaTV5X K17bKQrwJEZjRhBSstsrrbc1lIRcvlEkS0UmMPlH9HZNj8+y6n45i839UIeW2VYf TYU9sMtpVcfU3RCMvVaEmrhg+e04WZrv0mF22A5LDsmALxkyQnIkYh9nErWAoOX7 RBmJah2H9bEV1Fo4kHDfJlmgAzxNLtq+KNTouTZxtOqgLRv7c91FSjssfbfIAe6h Wvv5SUjzvoziO5kzK7OpvWJ8dElHnHrE1dLwXYB6SjbC/WEQ0YJ3jDl78CSgB5g0 oFnPXUSwC0+iw74JwI4YOxZoubS+4up2t32cCayoXfcJqROSPl14gbQ/wTG1tdJW eYJ4VDw5JmdYKUryreY2GEenMdtqejJGmIdIadLl5i+kNKrKajIqI7ufa7gt8SjC bLzBfk7p+ojBeJxnQ49E =cRd0 -----END PGP SIGNATURE----- --=-=-=--