From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Scott Turner Newsgroups: gmane.emacs.bugs Subject: bug#16117: Patch for Emacsclient Unwanted Warning Date: Fri, 13 Dec 2013 10:46:12 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0158aaba9d3b4104ed6c5c3a X-Trace: ger.gmane.org 1386953602 20800 80.91.229.3 (13 Dec 2013 16:53:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Dec 2013 16:53:22 +0000 (UTC) To: 16117@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 13 17:53:27 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VrVzT-000626-5D for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Dec 2013 17:53:27 +0100 Original-Received: from localhost ([::1]:43534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrVzS-0002Ou-Q2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Dec 2013 11:53:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrVzC-0002BZ-QM for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2013 11:53:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrVz5-0001gn-Fy for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2013 11:53:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrVz5-0001gj-C6 for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2013 11:53:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VrVz4-0006hz-T1 for bug-gnu-emacs@gnu.org; Fri, 13 Dec 2013 11:53:03 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Scott Turner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Dec 2013 16:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16117-submit@debbugs.gnu.org id=B16117.138695353325718 (code B ref 16117); Fri, 13 Dec 2013 16:53:02 +0000 Original-Received: (at 16117) by debbugs.gnu.org; 13 Dec 2013 16:52:13 +0000 Original-Received: from localhost ([127.0.0.1]:48747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrVyG-0006ge-08 for submit@debbugs.gnu.org; Fri, 13 Dec 2013 11:52:12 -0500 Original-Received: from mail-ie0-f182.google.com ([209.85.223.182]:43688) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VrUwP-0004zc-NI for 16117@debbugs.gnu.org; Fri, 13 Dec 2013 10:46:14 -0500 Original-Received: by mail-ie0-f182.google.com with SMTP id as1so3041063iec.27 for <16117@debbugs.gnu.org>; Fri, 13 Dec 2013 07:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=/F9Szn7bq22JqAFnDNlwNl9preSK7I5i0qfSgXbfAEQ=; b=a5tfks4Z18U9e9XJB0YBI1lwdUrhVJW7n4hVdjp1ctkhO/Txc7q3MqpfmFx7QUt7+3 GZ913jBYEc/JWedaCrjNL0GtOnJBn6J6smvsD6AaQ91JCs7sSGF20C+ZYqic3zuZ4g3q z4m6K0ewC9CiZ42ghpGauxcNH0kO3PapoRFN8aBKS0zLkfbXT2PQnp9fV9ACn3z+Kd7b PnyOgOx2ilIcU5wyj339PxfTPr3FF8Ct+WmFt2NjLjhymqCb9na70TLtLQ5+ng5j9ydf dGdhc5by7vEZFFFEwlBwxfRVUS11XfJUfjNYJ9ar0qkE7vO0vHpsBM82UybA+4MUkZg7 cXjw== X-Received: by 10.50.23.103 with SMTP id l7mr3776029igf.3.1386949572890; Fri, 13 Dec 2013 07:46:12 -0800 (PST) Original-Received: by 10.64.241.70 with HTTP; Fri, 13 Dec 2013 07:46:12 -0800 (PST) X-Mailman-Approved-At: Fri, 13 Dec 2013 11:52:07 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:81894 Archived-At: --089e0158aaba9d3b4104ed6c5c3a Content-Type: text/plain; charset=ISO-8859-1 In emacsclient, if an existing Emacs server cannot be found and an alternate editor is specified, the alternate editor is started. Along the way, emacsclient generates a warning that the server cannot be found. On Windows, this warning is a pop-up dialog box that must be dismissed by the user. This is an unwanted interruption, and irrelevant, since the user has already indicated by using the --alternated-editor option how to handle this situation. The patch below suppresses this warning when the user has specified both the --quiet option and the --alternate-editor option. The reasoning is that --quiet mutes all messages on success, and that because the --alternate-editor has been specified, this message is not reporting an error. It seems like a reasonable compromise that will allow users to see this warning if they like (by not using --quiet) and allow users to avoid it if they like (by using --quiet). *** emacsclient.c Tue Jan 1 15:37:17 2013 --- emacsclient-nomsg.c Fri Dec 13 10:05:30 2013 *************** *** 1002,1015 **** /* Open up an AF_INET socket. */ if ((s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { ! sock_err_message ("socket"); return INVALID_SOCKET; } /* Set up the socket. */ if (connect (s, (struct sockaddr *) &server, sizeof server) < 0) { ! sock_err_message ("connect"); return INVALID_SOCKET; } --- 1002,1027 ---- /* Open up an AF_INET socket. */ if ((s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { ! /* ! * If we have an alternate editor specified, then a socket error ! * isn't really an "error" (because we'll end up invoking the ! * alternate editor) so if asked we'll be quiet about this error ! * message. ! * ! */ ! if (!quiet || !alternate_editor) { ! sock_err_message ("socket"); ! }; return INVALID_SOCKET; } /* Set up the socket. */ if (connect (s, (struct sockaddr *) &server, sizeof server) < 0) { ! /* See comment above for rationale about showing/not showing err */ ! if (!quiet || !alternate_editor) { ! sock_err_message ("connect"); ! }; return INVALID_SOCKET; } --089e0158aaba9d3b4104ed6c5c3a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
In emacsclient, if an existing Emacs server cann= ot be found and an alternate editor is specified, the alternate editor is s= tarted.=A0 Along the way, emacsclient generates a warning that the server c= annot be found.

On Windows, this warning is a pop-up dialog box that must be dism= issed by the user.=A0 This is an unwanted interruption, and irrelevant, sin= ce the user has already indicated by using the --alternated-editor option h= ow to handle this situation.

The patch below suppresses this warning when the user has specifi= ed both the --quiet option and the --alternate-editor option.=A0 The reason= ing is that --quiet mutes all messages on success, and that because the --a= lternate-editor has been specified, this message is not reporting an error.= =A0 It seems like a reasonable compromise that will allow users to see this= warning if they like (by not using --quiet) and allow users to avoid it if= they like (by using --quiet).

*** emacsclient.c=A0=A0=A0 Tue Jan=A0 1 15:37:17 2013
--- emacsclien= t-nomsg.c=A0=A0=A0 Fri Dec 13 10:05:30 2013
***************
*** 1002,= 1015 ****
=A0=A0=A0 /* Open up an AF_INET socket.=A0 */
=A0=A0=A0 if = ((s =3D socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
=A0=A0=A0=A0=A0 {
!=A0=A0=A0=A0=A0=A0 sock_err_message ("socket&quo= t;);
=A0=A0=A0=A0=A0=A0=A0 return INVALID_SOCKET;
=A0=A0=A0=A0=A0 }=A0
=A0=A0=A0 /* Set up the socket.=A0 */
=A0=A0=A0 if (connect (s= , (struct sockaddr *) &server, sizeof server) < 0)
=A0=A0=A0=A0=A0 {
!=A0=A0=A0=A0=A0=A0 sock_err_message ("connect&qu= ot;);
=A0=A0=A0=A0=A0=A0=A0 return INVALID_SOCKET;
=A0=A0=A0=A0=A0 }<= br>=A0
--- 1002,1027 ----
=A0=A0=A0 /* Open up an AF_INET socket.=A0= */
=A0=A0=A0 if ((s =3D socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) <= ; 0)
=A0=A0=A0=A0=A0 {
!=A0=A0=A0=A0=A0=A0 /*
!=A0=A0=A0=A0=A0=A0=A0 * If = we have an alternate editor specified, then a socket error
!=A0=A0=A0=A0= =A0=A0=A0 * isn't really an "error" (because we'll end up= invoking the
!=A0=A0=A0=A0=A0=A0=A0 * alternate editor) so if asked we&= #39;ll be quiet about this error
!=A0=A0=A0=A0=A0=A0=A0 * message.
!=A0=A0=A0=A0=A0=A0=A0 *
!=A0=A0=A0= =A0=A0=A0=A0 */=A0=A0=A0 =A0
!=A0=A0=A0=A0=A0=A0 if (!quiet || !alternat= e_editor) {
! =A0=A0=A0 sock_err_message ("socket");
!=A0= =A0=A0=A0=A0=A0 };
=A0=A0=A0=A0=A0=A0=A0 return INVALID_SOCKET;
=A0= =A0=A0=A0=A0 }
=A0
=A0=A0=A0 /* Set up the socket.=A0 */
=A0=A0=A0 if (connect (s, (struct sockaddr *) &server, sizeof server) &= lt; 0)
=A0=A0=A0=A0=A0 {
!=A0=A0=A0=A0=A0=A0 /* See comment above for= rationale about showing/not showing err */
!=A0=A0=A0=A0=A0=A0 if (!qui= et || !alternate_editor) {
! =A0=A0=A0 sock_err_message ("connect&q= uot;);
!=A0=A0=A0=A0=A0=A0 };
=A0=A0=A0=A0=A0=A0=A0 return INVALID_SOCKET;
= =A0=A0=A0=A0=A0 }
=A0

--089e0158aaba9d3b4104ed6c5c3a--