[gnu.emacs] emacsclient -- exec's to emacs

faulkner@jmullins.harvard.edu (Don Faulkner) (03/20/89)

emacsclient is nice, but it's hard to get people to 
use it (they have to remember two names, and "emacsclient" has
twice as many letters ;->  )
Why not make emacsclient exec "emacs" if no server exists?
(one oops -- same user account logged in twice ... emacsclient
might get the wrong login's server...)

For the name of the socket, how would it be to trace PPID's back to 
"one before 0" - to get the login pid...???? (too bad getppid() doesn't
just take proc id as arg ....)

(patch for bsd-43 case ...)
*** emacsclient.c.ORIG	Wed Dec 28 23:16:25 1988
--- emacsclient.c	Mon Mar 20 09:49:13 1989
***************
*** 85,92 ****
--- 85,94 ----
    strcat (server.sun_path, "/.emacs_server");
    if (connect (s, &server, strlen (server.sun_path) + 2) < 0)
      {
        perror ("connect");
+ fprintf (stderr, "Running EMACS\n");
+ execvp ("emacs", argv);
        exit (1);
      }
    if ((out = fdopen (s, "r+")) == NULL)
      {
--

 Don Faulkner                                       
 Building 1, Room 803
 Harvard University, School of Public Health
 665 Huntington Avenue
 Boston, MA  02115

 ARPA:      faulkner%jmullins@harvard.harvard.edu                
 BITNET:    faulkner@harvard
 Telephone: (617) 732-2297