Path: utzoo!utgpu!watmath!uunet!nih-csl!elsie!cvl!haven!purdue!mailrus!tut.cis.ohio-state.edu!husc6!faulkner From: faulkner@jmullins.harvard.edu (Don Faulkner) Newsgroups: gnu.emacs Subject: emacsclient -- exec's to emacs Message-ID: Date: 20 Mar 89 15:07:43 GMT Sender: news@husc6.harvard.edu Distribution: gnu Organization: Harvard University Lines: 38 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