From: Mark Wooding Date: Thu, 3 Dec 2009 13:34:28 +0000 (+0000) Subject: bin/mdw-{editor,pager}: Recognize other Emacs terminal types. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/7a24847d3157b33643cd154019731e24294f27f1?ds=sidebyside bin/mdw-{editor,pager}: Recognize other Emacs terminal types. 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. --- diff --git a/bin/mdw-editor b/bin/mdw-editor index 312995f..2c7535b 100755 --- a/bin/mdw-editor +++ b/bin/mdw-editor @@ -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;; diff --git a/bin/mdw-pager b/bin/mdw-pager index cd59476..1a9744b 100755 --- a/bin/mdw-pager +++ b/bin/mdw-pager @@ -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