Path: utzoo!mnetor!uunet!husc6!rutgers!clyde!cbosgd!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon Allbery) Newsgroups: comp.unix.wizards Subject: Re: Summary of Emacs csh alias replies Message-ID: <6811@ncoast.UUCP> Date: 17 Dec 87 22:36:55 GMT References: <1512@ogcvax.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 27 As quoted from <1512@ogcvax.UUCP> by schaefer@ogcvax.UUCP (Barton E. Schaefer): +--------------- | In article dsill@NSWC-OAS.arpa (Dave Sill) writes: | }My question was: how can one set up a csh alias for emacs that will | }run emacs if there isn't one in the background or foreground it if it | }is in the background. | | Furthermore, what do you think is going to happen when you issue a "%emacs" | in the script? There isn't any background job running under the script shell! | This is one case where you MUST use "source", or type the commands in yourself | (which you don't want to do or you wouldn't have asked the question in the | first place). +--------------- This may be a dumb question, but... assuming the Emacs in question is of the Gnu persuasion, why don't you use server-mode? (The only reason I know of offhand doesn't apply to you: *I* can't use server-mode because I run System V and therefore can't use the Berzerk mechanisms of the server. But with a job-control csh I daresay your system has the guts to do it.) Server-mode starts up an emacs the first time, which goes off into the background; a small (hence fast) program is then used from then on to communicate with the backgrounded emacs via a socketpair. Check out server.el for the nitty details. -- Brandon S. Allbery necntc!ncoast!allbery@harvard.harvard.edu {hoptoad,harvard!necntc,cbosgd,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery Moderator of comp.sources.misc