annotate lib-src/emacs.csh @ 406:b8cc9ab3f761 r21-2-33

Import from CVS: tag r21-2-33
author cvs
date Mon, 13 Aug 2007 11:17:09 +0200
parents 376386a54a3c
children 06dd936cde16
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 # This defines a csh command named `edit' which resumes an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 # existing Emacs or starts a new one if none exists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 # One way or another, any arguments are passed to Emacs to specify files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 # (provided you have loaded `resume.el').
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 # - Michael DeCorte
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 # These are the possible values of $whichjob
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 # 1 = new ordinary emacs (the -nw is so that it doesn't try to do X)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 # 2 = resume emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 # 3 = new emacs under X (-i is so that you get a reasonable icon)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 # 4 = resume emacs under X
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 # 5 = new emacs under suntools
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 # 6 = resume emacs under suntools
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 # 7 = new emacs under X and suntools - doesn't make any sense, so use X
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 # 8 = resume emacs under X and suntools - doesn't make any sense, so use X
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 set EMACS_PATTERN="^\[[0-9]\] . Stopped ............ $EMACS"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 alias edit 'set emacs_command=("emacs -nw \!*" "fg %emacs" "emacs -i \!* &"\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 "emacsclient \!* &" "emacstool \!* &" "emacsclient \!* &" "emacs -i \!* &"\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 "emacsclient \!* &") ; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 jobs >! $HOME/.jobs; grep "$EMACS_PATTERN" < $HOME/.jobs >& /dev/null; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 @ isjob = ! $status; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 @ whichjob = 1 + $isjob + $?DISPLAY * 2 + $?WINDOW_PARENT * 4; \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 test -S ~/.emacs_server && emacsclient \!* \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 || echo `pwd` \!* >! ~/.emacs_args && eval $emacs_command[$whichjob]'