chiark
/
gitweb
/
~mdw
/
profile
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cd3318
)
bin/mdw-editor: Use `emacsclient' to edit files.
author
Mark Wooding
<mdw@distorted.org.uk>
Mon, 9 Nov 2009 15:04:04 +0000
(15:04 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Mon, 9 Nov 2009 15:10:53 +0000
(15:10 +0000)
Emacs 23 can open new frames in terminals quite happily. So we may as
well use it rather than starting up new Emacsen.
bin/mdw-editor
patch
|
blob
|
blame
|
history
diff --git
a/bin/mdw-editor
b/bin/mdw-editor
index 8b6e819f343b93b4d90b89eb8d96291d98d5ae0c..312995fb62be3a4ac82ef72582c43a3f83798502 100755
(executable)
--- a/
bin/mdw-editor
+++ b/
bin/mdw-editor
@@
-2,11
+2,15
@@
set -e
editor=${MDW_EDITOR-ed}
+emacsclient=t
[ -t 0 -a -t 1 ] || TERM=dumb
case "$EDITOR,$VISUAL,$TERM" in
- mdw-editor,mdw-editor,dumb) editor=
gnuclient
;;
+ mdw-editor,mdw-editor,dumb) editor=
emacsclient emacsclient=nil
;;
mdw-editor,mdw-editor,*);;
mdw-editor,*,*) editor=$VISUAL;;
*,*,*) editor=$EDITOR;;
esac
-exec $editor "$@"
+case "$emacsclient" in
+ t) exec emacsclient -nw -a "$editor" "$@";;
+ nil) exec $editor "$@";;
+esac