X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/4a01bd6dff68d1bfa9ee8c5ab534fac8038343a2..414d84843d6f395b849cbd8a269f38f02d739a17:/bash_profile diff --git a/bash_profile b/bash_profile index 22931b0..86e07b1 100644 --- a/bash_profile +++ b/bash_profile @@ -80,6 +80,10 @@ if [ -d /usr/local/plan9 ]; then $PLAN9/bin fi +# --- Find whether a program exists --- + +__mdw_programp () { type -t >/dev/null "$1"; } + # --- And the same for manual pages --- case "$MACHTIME" in @@ -100,15 +104,16 @@ export QMAILINJECT=c # --- Find a text editor --- -export EDITOR=ed -for ed in "emacs21 -nw" "emacs -nw" vi pico nano ae; do +export MDW_EDITOR=ed +for ed in mg "emacs22 -nw" "emacs21 -nw" "emacs -nw" vi pico nano ae; do name=`echo $ed | sed 's/ .*$//'` - if type -t >/dev/null "$name"; then - EDITOR=$ed + if __mdw_programp "$name"; then + MDW_EDITOR=$ed break fi done -export VISUAL="$EDITOR" + +export EDITOR=mdw-editor VISUAL=mdw-editor # --- Various options for programs --- @@ -118,6 +123,8 @@ umask 002 unset LANG LC_COLLATE +__mdw_programp distcc && export CCACHE_PREFIX=distcc + export TEXINPUTS=".:$HOME/lib/tex//:" __mdw_addto INFOPATH r $HOME/info /usr/info /usr/share/info /usr/local/info