-;; For csh users, insert the following alias in your .cshrc file
-;; (after removing the leading double semicolons):
-;;
-;;# The following line could be just EMACS=emacs, but this depends on
-;;# your site.
-;;set EMACS=emacs
-;;set EMACS_PATTERN="^\[[0-9]\] . Stopped ............ $EMACS"
-;;alias emacs \
-;;' \\
-;; jobs >! /tmp/jobs$$ \\
-;; && grep "$EMACS_PATTERN" /tmp/jobs$$ >& /dev/null \\
-;; && echo `pwd` \!* >! ~/.emacs_args && eval "%$EMACS" \\
-;;|| test -S ~/.emacs_server && emacsclient \!* \\
-;;|| test "$?DISPLAY" = 1 && eval "\$EMACS -i \!* &" \\
-;;|| test "$?WINDOW_PARENT" = 1 && eval "emacstool -f emacstool-init \!* &" \\
-;;|| eval "\$EMACS -nw \!*"'
-;;
-;; The alias works as follows:
-;; 1. If there is a suspended emacs jobs that is a child of the
-;; current shell, place its arguments in the ~/.emacs_args file and
-;; resume it.
-;; 2. Else if the ~/.emacs_server socket has been created, presume an
-;; emacs server is running and attempt to connect to it. If no emacs
-;; server is listening on the socket, this will fail.
-;; 3. Else if the DISPLAY environment variable is set, presume we are
-;; running under X Windows and start a new X Gnu Emacs process in the
-;; background.
-;; 4. Else if the WINDOW_PARENT environment variable is set, presume we
-;; are running under Sunview and Suntools and start an emacstool
-;; process in the background.
-;; 5. Else start a regular emacs process.
-;;
-;; Notes:
-;; "test -S" checks if a unix domain socket by that name exists.
-;; The output of the "jobs" command is not piped directly into "grep"
-;; because that would run the "jobs" command in a subshell.
-;; Before resuming a suspended emacs, the current directory and all
-;; command line arguments are placed in a file.
-;; The command to run emacs is always preceded by a \ to prevent
-;; possible alias loops.
-;; The "-nw" switch in the last line is is undocumented, and it means
-;; no windowing system.
-\f
-(setq suspend-resume-hook 'resume-process-args)
-(setq suspend-hook 'resume-preparation)
-
-(defvar emacs-args-file "~/.emacs_args"
- "*This file is where arguments are placed for a suspended emacs job.")
-
-(defun resume-preparation ()
- (condition-case ()
- (delete-file emacs-args-file)
- (error nil)))