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