(Publishing links): Document the
[bpt/emacs.git] / etc / emacs.csh
CommitLineData
b727702b
EZ
1# Copyright (c) 1999, 2003, 2006
2# Free software Foundation, Inc.
3#
a933dad1
DL
4# This defines a csh command named `edit' which resumes an
5# existing Emacs or starts a new one if none exists.
6# One way or another, any arguments are passed to Emacs to specify files
7# (provided you have loaded `resume.el').
8# - Michael DeCorte
9
10# These are the possible values of $whichjob
11# 1 = new ordinary emacs (the -nw is so that it doesn't try to do X)
12# 2 = resume emacs
13# 3 = new emacs under X (-i is so that you get a reasonable icon)
14# 4 = resume emacs under X
15# 5 = new emacs under suntools
16# 6 = resume emacs under suntools
17# 7 = new emacs under X and suntools - doesn't make any sense, so use X
18# 8 = resume emacs under X and suntools - doesn't make any sense, so use X
19set EMACS_PATTERN="^\[[0-9]\] . Stopped ............ $EMACS"
20
21alias edit 'set emacs_command=("emacs -nw \!*" "fg %emacs" "emacs -i \!* &"\
22 "emacsclient \!* &" "emacstool \!* &" "emacsclient \!* &" "emacs -i \!* &"\
23 "emacsclient \!* &") ; \
24 jobs >! $HOME/.jobs; grep "$EMACS_PATTERN" < $HOME/.jobs >& /dev/null; \
25 @ isjob = ! $status; \
26 @ whichjob = 1 + $isjob + $?DISPLAY * 2 + $?WINDOW_PARENT * 4; \
27 test -S ~/.emacs_server && emacsclient \!* \
28 || echo `pwd` \!* >! ~/.emacs_args && eval $emacs_command[$whichjob]'
ab5796a9 29
b727702b
EZ
30#COPYING PERMISSIONS:
31#
32# Permission is hereby granted, free of charge, to any person obtaining
33# a copy of this file, to deal in the file without restriction, including
34# without limitation the rights to use, copy, modify, merge, publish,
35# distribute, sublicense, and/or sell copies of the file, and to
36# permit persons to whom the file is furnished to do so, subject to
37# the following condition:
38#
39# The above copyright notice and this permission notice shall be
40# included in all copies or substantial portions of the file.
41
42
ab5796a9 43# arch-tag: 433d58df-15b9-446f-ad37-f0393e3a23d4