~mdw
/
profile
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git+ssh://metalzone.distorted.org.uk/~mdw/etc/profile
[profile]
/
bin
/
mdw-editor
diff --git
a/bin/mdw-editor
b/bin/mdw-editor
index
8b6e819
..
aa52fd5
100755
(executable)
--- a/
bin/mdw-editor
+++ b/
bin/mdw-editor
@@
-2,11
+2,19
@@
set -e
editor=${MDW_EDITOR-ed}
set -e
editor=${MDW_EDITOR-ed}
+emacsclient=$(
+ emacsclient --eval '(>= emacs-major-version 23)' 2>/dev/null || :)
[ -t 0 -a -t 1 ] || TERM=dumb
case "$EDITOR,$VISUAL,$TERM" in
[ -t 0 -a -t 1 ] || TERM=dumb
case "$EDITOR,$VISUAL,$TERM" in
- mdw-editor,mdw-editor,dumb) editor=gnuclient;;
+ mdw-editor,mdw-editor,dumb | \
+ mdw-editor,mdw-editor,emacs | \
+ mdw-editor,mdw-editor,eterm*)
+ editor=emacsclient emacsclient=nil;;
mdw-editor,mdw-editor,*);;
mdw-editor,*,*) editor=$VISUAL;;
*,*,*) editor=$EDITOR;;
esac
mdw-editor,mdw-editor,*);;
mdw-editor,*,*) editor=$VISUAL;;
*,*,*) editor=$EDITOR;;
esac
-exec $editor "$@"
+case "$emacsclient" in
+ t) exec emacsclient -nw -a "$editor" "$@";;
+ *) exec $editor "$@";;
+esac