Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!rutgers!labrea!jade!ucbvax!NSWC-OAS.ARPA!dsill
From: dsill@NSWC-OAS.ARPA.UUCP
Newsgroups: comp.emacs
Subject: Emacs csh alias
Message-ID: <8712041951.AA21105@ucbvax.Berkeley.EDU>
Date: Fri, 4-Dec-87 14:33:42 EST
Article-I.D.: ucbvax.8712041951.AA21105
Posted: Fri Dec  4 14:33:42 1987
Date-Received: Wed, 9-Dec-87 20:03:12 EST
Sender: usenet@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 16

I've been trying to set up a C-Shell (4.2 BSD) alias for Emacs (GNU
17.64, not that it matters) which, when run the first time will
actually run Emacs, but after suspending Emacs with C-z, will bring
the background Emacs job to the foreground.  The catch is that I'd
also like the alias to re-load emacs if I exit with C-x C-c.  Simply
stated, I want an alias named "emacs" which will load Emacs if it
isn't already loaded, but will foreground a background Emacs if one
exists.

I know I could do this with a script (if I assume the Emacs job is
always job %1), but I'd prefer an alias since they're faster.  It
would be especially nice to determine which background job was the
Emacs job and foreground *it*, instead of just assuming job %1.

Any ideas or alternate approaches?  Should I just put up with the
occasional "fg: No such job." message?