Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!dsill@NSWC-OAS.arpa From: dsill@NSWC-OAS.arpa (Dave Sill) Newsgroups: comp.unix.wizards Subject: Emacs csh alias Message-ID: <10672@brl-adm.ARPA> Date: Fri, 4-Dec-87 15:40:39 EST Article-I.D.: brl-adm.10672 Posted: Fri Dec 4 15:40:39 1987 Date-Received: Wed, 9-Dec-87 05:31:53 EST Sender: news@brl-adm.ARPA 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?