]> code.delx.au - gnu-emacs/blob - etc/emacs.csh
Gnus logo is assigned to FSF, so remove separate copyright notice.
[gnu-emacs] / etc / emacs.csh
1 ### emacs.csh
2
3 ## Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007
4 ## Free Software Foundation, Inc.
5
6 ## Author: Michael DeCorte
7
8 ## This program is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2, or (at your option)
11 ## any later version.
12
13 ## This program is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ## GNU General Public License for more details.
17
18 ## You should have received a copy of the GNU General Public License
19 ## along with this program; see the file COPYING. If not, write to the
20 ## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 ## Boston, MA 02110-1301, USA.
22
23 ### Commentary:
24
25 ## This defines a csh command named `edit' which resumes an
26 ## existing Emacs or starts a new one if none exists.
27 ## One way or another, any arguments are passed to Emacs to specify files
28 ## (provided you have loaded `resume.el').
29
30 ## These are the possible values of $whichjob
31 ## 1 = new ordinary emacs (the -nw is so that it doesn't try to do X)
32 ## 2 = resume emacs
33 ## 3 = new emacs under X (-i is so that you get a reasonable icon)
34 ## 4 = resume emacs under X
35 ## 5 = new emacs under suntools
36 ## 6 = resume emacs under suntools
37 ## 7 = new emacs under X and suntools - doesn't make any sense, so use X
38 ## 8 = resume emacs under X and suntools - doesn't make any sense, so use X
39 set EMACS_PATTERN="^\[[0-9]\] . Stopped ............ $EMACS"
40
41 alias edit 'set emacs_command=("emacs -nw \!*" "fg %emacs" "emacs -i \!* &"\
42 "emacsclient \!* &" "emacstool \!* &" "emacsclient \!* &" "emacs -i \!* &"\
43 "emacsclient \!* &") ; \
44 jobs >! $HOME/.jobs; grep "$EMACS_PATTERN" < $HOME/.jobs >& /dev/null; \
45 @ isjob = ! $status; \
46 @ whichjob = 1 + $isjob + $?DISPLAY * 2 + $?WINDOW_PARENT * 4; \
47 test -S ~/.emacs_server && emacsclient \!* \
48 || echo `pwd` \!* >! ~/.emacs_args && eval $emacs_command[$whichjob]'
49
50 # arch-tag: 433d58df-15b9-446f-ad37-f0393e3a23d4