X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/852cd5fbddafbfed93df4cda8ba366b14922e95d..7e2c05e92fcc878bd17c49575bede378db3c45a3:/bash_profile diff --git a/bash_profile b/bash_profile index 8c7dca6..f3e1d76 100644 --- a/bash_profile +++ b/bash_profile @@ -59,7 +59,7 @@ __mdw_addto () { __mdw_conf () { local var=$1 val=`sed -n " - /^[ ]*$var[ ]*=[ ]*\(\|.*[^ ]\)[ ]*$/ { + /^[ ]*$var[ ]*=[ ]*\(\|.*[^ ]\)[ ]*$/ { s//\1/; p; q } " ${MDWCONF-$HOME/.mdw.conf}` @@ -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 @@ -98,23 +102,34 @@ export NAME="Mark Wooding" export EMAIL=`__mdw_conf email` export QMAILINJECT=c +# --- Find a text editor --- + +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 __mdw_programp "$name"; then + MDW_EDITOR=$ed + break + fi +done + +export EDITOR=mdw-editor VISUAL=mdw-editor + # --- Various options for programs --- umask 002 [ -z "$HOST" ] && export HOST=`hostname` -unset LANG +if [ "$DISPLAY" = "" ]; then + : ${LC_CTYPE=${LANG-${LC_ALL-`__mdw_conf console-ctype`}}} +else + LC_CTYPE=`__mdw_conf x-ctype` +fi +unset LANG LC_ALL LC_COLLATE +export LC_CTYPE -export EDITOR=ed -for ed in "emacs21 -nw" "emacs -nw" vi pico nano ae; do - name=`echo $ed | sed 's/ .*$//'` - if type -t >/dev/null "$name"; then - EDITOR=$ed - break - fi -done -export VISUAL="$EDITOR" +__mdw_programp distcc && export CCACHE_PREFIX=distcc export TEXINPUTS=".:$HOME/lib/tex//:" @@ -135,9 +150,13 @@ export SVNROOT=`__mdw_conf svn-root` export BECOME="--preserve-environment" export PAGER=`type -p less` METAMAIL_PAGER=`type -p less` -export LESS="-iqgRh1" +export LESS="-iqgRh1FX" export LESSOPEN="|lesspipe.sh %s" -export LESSCHARSET=latin1 +case "$LC_CTYPE" in + *utf8*) LESSCHARSET=utf-8 ;; + *) LESSCHARSET=latin1 ;; +esac +export LESSCHARSET # export MAKEFLAGS="-j4" [ "$TMPDIR" ] || eval `tmpdir -b` export TMP=$TMPDIR