From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Francesco =?UTF-8?Q?Potort=C3=AC?= Newsgroups: gmane.emacs.bugs Subject: bug#25040: 24.5; setting mail-interactive to nil causes error while sending Date: Sun, 27 Nov 2016 16:00:27 +0100 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: blaine.gmane.org 1480258936 15153 195.159.176.226 (27 Nov 2016 15:02:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 Nov 2016 15:02:16 +0000 (UTC) Cc: 25040@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 27 16:02:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cB0y3-0002ol-4L for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Nov 2016 16:02:11 +0100 Original-Received: from localhost ([::1]:54508 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cB0y5-0004GV-8d for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Nov 2016 10:02:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cB0xz-0004GQ-Vf for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2016 10:02:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cB0xv-0006d4-0G for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2016 10:02:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56530) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cB0xu-0006cz-TX for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2016 10:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cB0xu-0006sM-IO for bug-gnu-emacs@gnu.org; Sun, 27 Nov 2016 10:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Nov 2016 15:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25040 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25040-submit@debbugs.gnu.org id=B25040.148025889326390 (code B ref 25040); Sun, 27 Nov 2016 15:02:02 +0000 Original-Received: (at 25040) by debbugs.gnu.org; 27 Nov 2016 15:01:33 +0000 Original-Received: from localhost ([127.0.0.1]:43696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cB0xQ-0006ra-Tn for submit@debbugs.gnu.org; Sun, 27 Nov 2016 10:01:33 -0500 Original-Received: from blade3.isti.cnr.it ([194.119.192.19]:42132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cB0xO-0006rO-Sc for 25040@debbugs.gnu.org; Sun, 27 Nov 2016 10:01:31 -0500 Original-Received: from tucano.isti.cnr.it ([146.48.81.102]) by mx.isti.cnr.it (PMDF V6.5-x6 #1251) with ESMTPSA id <01Q7TFXK86NK9GXNUE@mx.isti.cnr.it> for 25040@debbugs.gnu.org; Sun, 27 Nov 2016 16:00:28 +0100 (MET) Original-Received: from pot by tucano.isti.cnr.it with local (Exim 4.88) (envelope-from ) id 1cB0wN-0007ZG-Jl; Sun, 27 Nov 2016 16:00:27 +0100 In-reply-to: X-INSM-ip-source: 146.48.81.102 Auth Done X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126163 Archived-At: >> In sendmail.el I find this: >> >> ================ >> (defun sendmail-send-it () >> "Send the current mail buffer using the Sendmail package. >> This is a suitable value for `send-mail-function'. It sends using the >> external program defined by `sendmail-program'." >> (require 'mail-utils) >> (let ((errbuf (if mail-interactive >> (generate-new-buffer " sendmail errors") >> 0)) >> ================ >> >> However, the final 0 makes no sense to me, and in fact it generates an >> error when sending mail if mail-interactive is set to nil. >> >> Changing the 0 to nil apparently corrects the problem. > >Can you show the error backtrace? It looks like errbuf is unused when >mail-interactive is nil except for the call to call-process-region >where it acts as the BUFFER argument > > Insert output in BUFFER before point; t means current buffer; nil for > BUFFER means discard it; 0 means discard and don’t wait I was too hasty, sorry about that. Anyway, the problem exists, but it is different from what I have told. 0 can be put back there. Apparently this change at the end of the functions fixes the bug: 1302,1305c1302,1305 < (if (and (bufferp errbuf) < (not error)) < (kill-buffer errbuf) < (switch-to-buffer-other-window errbuf))))) --- > (when (bufferp errbuf) > (if (not error) > (kill-buffer errbuf) > (switch-to-buffer-other-window errbuf))))))