chiark
/
gitweb
/
~mdw
/
profile
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dot/emacs: Moderate horizontal scrolling; auto-scroll only one line.
[profile]
/
bin
/
mdw-editor
diff --git
a/bin/mdw-editor
b/bin/mdw-editor
index 2c7535b58fbd2459c3a21095bf122b4fb739b211..c162da30bf4a037aeeda8355e25050ffdfbc5f80 100755
(executable)
--- a/
bin/mdw-editor
+++ b/
bin/mdw-editor
@@
-2,7
+2,11
@@
set -e
editor=${MDW_EDITOR-ed}
set -e
editor=${MDW_EDITOR-ed}
-emacsclient=t
+case ${TMP+t},${TMPDIR+t} in
+ t,) TMPDIR=$TMP; export TMPDIR ;;
+esac
+emacsclient=$(
+ emacsclient --eval '(>= emacs-major-version 23)' 2>/dev/null || :)
[ -t 0 -a -t 1 ] || TERM=dumb
case "$EDITOR,$VISUAL,$TERM" in
mdw-editor,mdw-editor,dumb | \
[ -t 0 -a -t 1 ] || TERM=dumb
case "$EDITOR,$VISUAL,$TERM" in
mdw-editor,mdw-editor,dumb | \
@@
-15,5
+19,5
@@
case "$EDITOR,$VISUAL,$TERM" in
esac
case "$emacsclient" in
t) exec emacsclient -nw -a "$editor" "$@";;
esac
case "$emacsclient" in
t) exec emacsclient -nw -a "$editor" "$@";;
-
nil
) exec $editor "$@";;
+
*
) exec $editor "$@";;
esac
esac