GNU bug report logs - #1298
allow 'emacsclient -a "emacs --daemon && emacsclient -c"'

Previous Next

Package: emacs;

Reported by: Dan Nicolaescu <dann <at> ics.uci.edu>

Date: Sun, 2 Nov 2008 18:25:04 UTC

Severity: wishlist

Done: Dan Nicolaescu <dann <at> ics.uci.edu>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 1298 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: 1298 <at> debbugs.gnu.org
Subject: Re: bug#1298: allow 'emacsclient -a "emacs --daemon && emacsclient -c"'
Date: Tue, 18 Nov 2008 00:22:33 -0800 (PST)
Dan Nicolaescu <dann <at> ics.uci.edu> writes:

  > It would be nice if some equivalent of: 
  > 
  > 'emacsclient -a "emacs --daemon && emacsclient -c"
  > 
  > would work.
  > 
  > That would allow one to ALWAYS use emacsclient. 

Here's a quick hack that allows:

emacsclient -a "emacs --daemon && emacsclient -c" FILENAME

to work.  It is not complete yet, FILENAME does not get passed to the
"&& emacsclient"


--- emacsclient.c.~1.140.~	2008-11-03 06:30:13.000000000 -0800
+++ emacsclient.c	2008-11-18 00:13:29.000000000 -0800
@@ -630,8 +630,13 @@ fail (void)
   if (alternate_editor)
     {
       int i = optind - 1;
+      char * new_argv[] = { "sh", "-c", 0, 0 };
 
-      execvp (alternate_editor, main_argv + i);
+      new_argv[0] = "sh";
+      new_argv[1] = "-c";
+      new_argv[2] = alternate_editor;
+
+      execve ("/bin/sh", new_argv, environ);
       message (TRUE, "%s: error executing alternate editor \"%s\"\n",
 	       progname, alternate_editor);
     }


Thoughts?




This bug report was last modified 16 years and 168 days ago.

Previous Next


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