Mercurial > emacs
annotate etc/emacs.bash @ 105877:21bdda3ded62
* xterm.c (syms_of_xterm):
* xselect.c (syms_of_xselect):
* xmenu.c (syms_of_xmenu):
* xfns.c (syms_of_xfns):
* xfaces.c (syms_of_xfaces):
* xdisp.c (syms_of_xdisp):
* window.c (syms_of_window):
* w32fns.c (syms_of_w32fns):
* undo.c (syms_of_undo):
* textprop.c (syms_of_textprop):
* terminal.c (syms_of_terminal):
* syntax.c (syms_of_syntax):
* sound.c (syms_of_sound):
* search.c (syms_of_search):
* print.c (syms_of_print):
* minibuf.c (syms_of_minibuf):
* macros.c (syms_of_macros):
* keymap.c (syms_of_keymap, initial_define_key)
(initial_define_lispy_key):
* keyboard.c (syms_of_keyboard):
* insdel.c (syms_of_insdel):
* image.c (syms_of_image):
* fringe.c (syms_of_fringe):
* frame.c (syms_of_frame):
* fontset.c (syms_of_fontset):
* fns.c (syms_of_fns):
* fns.c (syms_of_fns):
* fileio.c (syms_of_fileio):
* fileio.c (syms_of_fileio):
* eval.c (syms_of_eval):
* doc.c (syms_of_doc):
* dispnew.c (syms_of_display):
* dired.c (syms_of_dired):
* dbusbind.c (syms_of_dbusbind):
* data.c (syms_of_data):
* composite.c (syms_of_composite):
* coding.c (syms_of_coding):
* cmds.c (syms_of_cmds):
* charset.c (define_charset_internal, syms_of_character):
* ccl.c (syms_of_ccl):
* category.c (syms_of_category, init_category_once):
* casetab.c (syms_of_casetab):
* casefiddle.c (syms_of_casefiddle):
* callint.c (syms_of_callint):
* bytecode.c (syms_of_bytecode):
* buffer.c (keys_of_buffer, syms_of_buffer):
* alloc.c (syms_of_alloc):
* process.c (syms_of_process, init_process):
* lread.c (syms_of_lread, init_obarray):
* font.c (build_style_table):
* emacs.c (syms_of_emacs, main): Replace calls to intern with
intern_c_string, calls to make_pure_string with
make_pure_c_string. Use pure_cons instead of Fcons.
* process.c (socket_options): Make it const.
(set_socket_option, init_process): Use a const pointer.
* lread.c (intern_c_string): New function.
(defvar_kboard, defvar_lisp, defvar_lisp_nopro, defvar_bool)
(defvar_int): Uset it. Make the name const char*.
* font.c (struct table_entry): Remove unused member. Make NAMES
constant.
(weight_table, slant_table, width_table): Make constant.
* emacs.c (struct standard_args): Make name and longname constant.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Fri, 06 Nov 2009 06:50:52 +0000 |
parents | c90853557b90 |
children | 1d1d5d9bd884 |
rev | line source |
---|---|
75457
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
1 ### emacs.bash --- contact/resume an existing Emacs, or start a new one |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
2 |
100972 | 3 ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
75457
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
4 ## Free Software Foundation, Inc. |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
5 |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
6 ## Author: Noah Friedman |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
7 |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
8 ## This file is part of GNU Emacs. |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
9 |
95004
cbf5528cf447
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
10 ## GNU Emacs is free software: you can redistribute it and/or modify |
75457
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
11 ## it under the terms of the GNU General Public License as published by |
95004
cbf5528cf447
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
cbf5528cf447
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
13 ## (at your option) any later version. |
75457
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
14 |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
15 ## GNU Emacs is distributed in the hope that it will be useful, |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
16 ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
18 ## GNU General Public License for more details. |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
19 |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
20 ## You should have received a copy of the GNU General Public License |
95004
cbf5528cf447
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
87649
diff
changeset
|
21 ## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
75457
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
22 |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
23 ### Commentary: |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
24 |
99244
4f618405b3d2
Comment that emacs.bash/csh are obsolete.
Glenn Morris <rgm@gnu.org>
parents:
95004
diff
changeset
|
25 ## This file is obsolete. Use emacsclient -a instead. |
4f618405b3d2
Comment that emacs.bash/csh are obsolete.
Glenn Morris <rgm@gnu.org>
parents:
95004
diff
changeset
|
26 |
75457
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
27 ## This defines a bash command named `edit' which contacts/resumes an |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
28 ## existing emacs or starts a new one if none exists. |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
29 |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
30 ## One way or another, any arguments are passed to emacs to specify files |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
31 ## (provided you have loaded `resume.el'). |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
32 |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
33 ## This function assumes the emacs program is named `emacs' and is somewhere |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
34 ## in your load path. If either of these is not true, the most portable |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
35 ## (and convenient) thing to do is to make an alias called emacs which |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
36 ## refers to the real program, e.g. |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
37 ## |
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
38 ## alias emacs=/usr/local/bin/gemacs |
25853 | 39 |
40 function edit () | |
41 { | |
42 local windowsys="${WINDOW_PARENT+sun}" | |
43 | |
44 windowsys="${windowsys:-${DISPLAY+x}}" | |
45 | |
46 if [ -n "${windowsys:+set}" ]; then | |
47 # Do not just test if these files are sockets. On some systems | |
48 # ordinary files or fifos are used instead. Just see if they exist. | |
59923
615a90f44f52
Update the name of the socket of the Emacs server.
Eli Zaretskii <eliz@gnu.org>
parents:
52401
diff
changeset
|
49 if [ -e "${HOME}/.emacs_server" -o -e "/tmp/emacs${UID}/server" ]; then |
25853 | 50 emacsclient "$@" |
51 return $? | |
52 else | |
53 echo "edit: starting emacs in background..." 1>&2 | |
54 fi | |
55 | |
56 case "${windowsys}" in | |
57 x ) (emacs "$@" &) ;; | |
84724
ccaac0911639
Adapt for removal of emacstool.
Glenn Morris <rgm@gnu.org>
parents:
78271
diff
changeset
|
58 sun ) echo "unsupported window system"; return 1 ;; |
25853 | 59 esac |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
25853
diff
changeset
|
60 else |
25853 | 61 if jobs %emacs 2> /dev/null ; then |
62 echo "$(pwd)" "$@" >| ${HOME}/.emacs_args && fg %emacs | |
63 else | |
64 emacs "$@" | |
65 fi | |
66 fi | |
67 } | |
68 | |
69 | |
52401 | 70 # arch-tag: 1e1b74b9-bf2c-4b23-870f-9eebff7515cb |
75457
873c558e1383
Add FSF copyright and GPL. Copyright years from those where this file
Glenn Morris <rgm@gnu.org>
parents:
59923
diff
changeset
|
71 ### emacs.bash ends here |