Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!pyramid!prls!mips!hansen
From: hansen@mips.UUCP (Craig Hansen)
Newsgroups: comp.emacs
Subject: Re: Emacs csh alias
Message-ID: <1059@mips.UUCP>
Date: Sat, 5-Dec-87 18:07:44 EST
Article-I.D.: mips.1059
Posted: Sat Dec  5 18:07:44 1987
Date-Received: Thu, 10-Dec-87 22:09:20 EST
References: <8712041951.AA21105@ucbvax.Berkeley.EDU>
Lines: 23

In article <8712041951.AA21105@ucbvax.Berkeley.EDU>, dsill@NSWC-OAS.ARPA (Dave Sill) writes:
> 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.

> Any ideas or alternate approaches?

The %emacs construction will permit you to invoke the job without having to
assume that it's job %1. It would seem that the easiest method to do this is
to pipe the output of the 'jobs' command through sed or awk to generate an
optional '%' in front of the command 'emacs'. A further refinement would be
to put the command line arguments somewhere that the foregrounded emacs will
pick them up an interpret them (e.g. do a visit-file on each argument).

By all rights, this ought to be a shell function, say that %emacs would
foreground the job, but if it's not there, should invoke the command.
Unfortunately, there's no standard way to reset the command line arguments.

-- 
Craig Hansen
Manager, Architecture Development
MIPS Computer Systems, Inc.
...{ames,decwrl,prls}!mips!hansen or hansen@mips.com