GNU bug report logs - #16117
24.3; emacsclient -q enhancement request please also suppress

Previous Next

Package: emacs;

Reported by: gregrwm <backuppc-users <at> whitleymott.net>

Date: Thu, 12 Dec 2013 02:49:02 UTC

Severity: wishlist

Tags: confirmed, fixed, patch

Found in version 24.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 16117 <at> debbugs.gnu.org (full text, mbox):

From: Scott Turner <srt19170 <at> gmail.com>
To: 16117 <at> debbugs.gnu.org
Subject: Patch for Emacsclient Unwanted Warning
Date: Fri, 13 Dec 2013 10:46:12 -0500
[Message part 1 (text/plain, inline)]
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;
      }
[Message part 2 (text/html, inline)]

This bug report was last modified 4 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.