Mercurial > emacs
comparison README.multi-tty @ 83282:6f9586cdd29c
README update. (Fix identifier names in emacs background preloader example.)
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-322
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 28 Mar 2005 04:13:53 +0000 |
parents | c22274b1aa9b |
children | ed09a89e2b25 |
comparison
equal
deleted
inserted
replaced
83281:b00208784797 | 83282:6f9586cdd29c |
---|---|
258 recover-session invocations.) | 258 recover-session invocations.) |
259 | 259 |
260 I use the following two bash functions to handle my Emacs sessions: | 260 I use the following two bash functions to handle my Emacs sessions: |
261 | 261 |
262 ,----[ ~/.bash_profile | 262 ,----[ ~/.bash_profile |
263 | # Usage: preload-emacs <name> [<waitp>] | 263 | # Usage: preload_emacs <name> [<waitp>] |
264 | # | 264 | # |
265 | # Preloads the Emacs instance called NAME in a detached screen | 265 | # Preloads the Emacs instance called NAME in a detached screen |
266 | # session. Does nothing if the instance is already running. If WAITP | 266 | # session. Does nothing if the instance is already running. If WAITP |
267 | # is non-empty, the function waits until the server starts up and | 267 | # is non-empty, the function waits until the server starts up and |
268 | # creates its socket; otherwise it returns immediately. | 268 | # creates its socket; otherwise it returns immediately. |
269 | function preload-emacs { | 269 | function preload_emacs { |
270 | local name="$1" | 270 | local name="$1" |
271 | local waitp="$2" | 271 | local waitp="$2" |
272 | local screendir="/var/run/screen/S-$USER" | 272 | local screendir="/var/run/screen/S-$USER" |
273 | local serverdir="/tmp/emacs$UID" | 273 | local serverdir="/tmp/emacs$UID" |
274 | local emacs=emacs # Or wherever you installed your multi-tty Emacs | 274 | local emacs=emacs # Or wherever you installed your multi-tty Emacs |
275 | | 275 | |
276 | if [ -z "$name" ]; then | 276 | if [ -z "$name" ]; then |
277 | echo "Usage: preload-emacs <name> [<waitp>]" >&2 | 277 | echo "Usage: preload_emacs <name> [<waitp>]" >&2 |
278 | return 1 | 278 | return 1 |
279 | fi | 279 | fi |
280 | | 280 | |
281 | if [ ! -e "$screendir"/*."$name" ]; then | 281 | if [ ! -e "$screendir"/*."$name" ]; then |
282 | if [ -e "$serverdir/$name" ]; then | 282 | if [ -e "$serverdir/$name" ]; then |
289 | while [ ! -e "$serverdir/$name" ]; do sleep 0.1; done | 289 | while [ ! -e "$serverdir/$name" ]; do sleep 0.1; done |
290 | fi | 290 | fi |
291 | return 0 | 291 | return 0 |
292 | } | 292 | } |
293 | | 293 | |
294 | # Usage: connect-emacs <name> <args>... | 294 | # Usage: connect_emacs <name> <args>... |
295 | # | 295 | # |
296 | # Connects to the Emacs instance called NAME. Starts up the instance | 296 | # Connects to the Emacs instance called NAME. Starts up the instance |
297 | # if it is not already running. The rest of the arguments are passed | 297 | # if it is not already running. The rest of the arguments are passed |
298 | # to emacsclient. | 298 | # to emacsclient. |
299 | function connect-emacs { | 299 | function connect_emacs { |
300 | local name="$1" | 300 | local name="$1" |
301 | shift | 301 | shift |
302 | | 302 | |
303 | if [ -z "$name" ]; then | 303 | if [ -z "$name" ]; then |
304 | echo "Usage: connect-emacs <name> <args>..." >&2 | 304 | echo "Usage: connect_emacs <name> <args>..." >&2 |
305 | fi | 305 | fi |
306 | preload-emacs "$name" wait | 306 | preload_emacs "$name" wait |
307 | emacsclient -s "$name" "$@" | 307 | emacsclient -s "$name" "$@" |
308 | } | 308 | } |
309 | | 309 | |
310 | export -f preload-emacs connect-emacs | 310 | export -f preload_emacs connect_emacs |
311 | | 311 | |
312 | # Preload editor and gnus sessions for speedy initial connects. | 312 | # Preload editor and gnus sessions for speedy initial connects. |
313 | preload-emacs editor | 313 | preload_emacs editor |
314 | preload-emacs gnus | 314 | preload_emacs gnus |
315 `---- | 315 `---- |
316 | 316 |
317 ,----[ ~/.bashrc | 317 ,----[ ~/.bashrc |
318 | alias gnus="connect-emacs gnus" | 318 | alias gnus="connect_emacs gnus" |
319 | alias edit="connect-emacs editor" | 319 | alias edit="connect_emacs editor" |
320 | alias et="connect-emacs editor -t" | 320 | alias et="connect_emacs editor -t" |
321 | alias e=edit | 321 | alias e=edit |
322 `---- | 322 `---- |
323 | 323 |
324 | 324 |
325 NEWS | 325 NEWS |