chiark / gitweb /
bin/mdw-{editor,pager}: Recognize other Emacs terminal types.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 3 Dec 2009 13:34:28 +0000 (13:34 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 3 Dec 2009 13:34:28 +0000 (13:34 +0000)
The `emacs' type is there precisely because it isn't `dumb', which will
make `git' apply colouring.  But I think that `M-x ansi-term' is actually
better so I doubt that this will get much use.

It's important to recognize the `term' and `ansi-term' terminals because
trying to start `emacsclient -nw' in them makes Emacs deadlock.  Besides,
plain `emacsclient' is almost certainly more convenient.

bin/mdw-editor
bin/mdw-pager

index 312995fb62be3a4ac82ef72582c43a3f83798502..2c7535b58fbd2459c3a21095bf122b4fb739b211 100755 (executable)
@@ -5,7 +5,10 @@ editor=${MDW_EDITOR-ed}
 emacsclient=t
 [ -t 0 -a -t 1 ] || TERM=dumb
 case "$EDITOR,$VISUAL,$TERM" in
-  mdw-editor,mdw-editor,dumb) editor=emacsclient emacsclient=nil;;
+  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;;
index cd5947628235ffd890569139a28b5929db889b57..1a9744b3deedd662c2e98cd6f6b7220e5f0085ba 100755 (executable)
@@ -4,7 +4,10 @@ set -e
 pager=${MDW_PAGER-less}
 [ -t 1 ] || TERM=dumb
 case "$PAGER,$TERM" in
-  mdw-pager,dumb) pager=cat;;
+  mdw-pager,dumb | \
+    mdw-pager,emacs | \
+    mdw-pager,eterm*)
+    pager=cat;;
   mdw-pager,*);;
   *,*) pager=$PAGER;;
 esac