X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/706d30bcece7ca7f3e6b1176252b91984c661f3b..eac7b6224fc7804fcdd2409c6f8e0159e3379a03:/bash_profile diff --git a/bash_profile b/bash_profile index bc812d6..a7c69f7 100644 --- a/bash_profile +++ b/bash_profile @@ -1,7 +1,5 @@ # -*-sh-*- # -# $Id: .profile,v 1.3 1997/01/09 20:30:23 mdw Exp $ -# # Bash startup things # @@ -54,19 +52,6 @@ __mdw_addto () { export $var=$val } -# --- Find a configuration item --- - -__mdw_conf () { - local var=$1 - val=`sed -n " - /^[ ]*$var[ ]*=[ ]*\(\|.*[^ ]\)[ ]*$/ { - s//\1/; p; q - } - " ${MDWCONF-$HOME/.mdw.conf}` - case "$val" in "~"*) val=`eval "echo ${val%%/*}"`${val#\~};; esac - echo "$val" -} - # --- Set the path variable --- __mdw_addto PATH l \ @@ -97,15 +82,21 @@ __mdw_addto MANPATH l \ # --- Where my mail comes from --- -export MAIL=`__mdw_conf mailbox` +export MAIL=`mdw-conf mailbox` export NAME="Mark Wooding" -export EMAIL=`__mdw_conf email` +export EMAIL=`mdw-conf email` export QMAILINJECT=c # --- Find a text editor --- export MDW_EDITOR=ed -for ed in mg "emacs21 -nw" "emacs -nw" vi pico nano ae; do +emacs_startup_args="--no-site-file --mdw-fast-startup -nw" +for ed in \ + "emacs22 $emacs_startup_args" \ + "emacs21 $emacs_startup_args" \ + mg \ + "emacs -nw" \ + vi pico nano ae; do name=`echo $ed | sed 's/ .*$//'` if __mdw_programp "$name"; then MDW_EDITOR=$ed @@ -121,7 +112,13 @@ umask 002 [ -z "$HOST" ] && export HOST=`hostname` -unset LANG LC_COLLATE +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 __mdw_programp distcc && export CCACHE_PREFIX=distcc @@ -131,30 +128,47 @@ __mdw_addto INFOPATH r $HOME/info /usr/info /usr/share/info /usr/local/info __mdw_addto PERLLIB r $HOME/lib/perl __mdw_addto PYTHONPATH r $HOME/lib/python -export __MDW_ROOTLY=`__mdw_conf rootly` +export __MDW_ROOTLY=`mdw-conf rootly` [ -z "$LS_OPTIONS" ] && export LS_OPTIONS="-F" export BASCAT="-l +n" export CVS_RSH=ssh -export CVSROOT=`__mdw_conf cvs-root` -export SVNROOT=`__mdw_conf svn-root` +export CVSROOT=`mdw-conf cvs-root` +export SVNROOT=`mdw-conf svn-root` +export P4PORT=`mdw-conf p4-port` P4USER=`mdw-conf p4-user` export BECOME="--preserve-environment" export PAGER=`type -p less` METAMAIL_PAGER=`type -p less` export LESS="-iqgRh1FX" export LESSOPEN="|lesspipe.sh %s" -export LESSCHARSET=latin1 +case "$LC_CTYPE" in + *utf8*) LESSCHARSET=utf-8 ;; + *) LESSCHARSET=latin1 ;; +esac +export LESSCHARSET +__mdw_programp global && export LESSGLOBALTAGS=global +export NCURSES_NO_UTF8_ACS=1 # export MAKEFLAGS="-j4" [ "$TMPDIR" ] || eval `tmpdir -b` export TMP=$TMPDIR export PERL_READLINE_NOWARN=yes -[ -z "$NNTPSERVER" ] && export NNTPSERVER=`__mdw_conf nntp-server` -[ -z "$http_proxy" ] && export http_proxy=http://`__mdw_conf http-proxy`/ -[ -z "$ftp_proxy" ] && export ftp_proxy=$http_proxy +[ -z "$NNTPSERVER" ] && export NNTPSERVER=`mdw-conf nntp-server` + +http=`mdw-conf http-proxy none` +case "${http_proxy-none},$http" in + *,none) ;; + none,*) export http_proxy=http://$http/ ;; +esac +ftp=`mdw-conf ftp-proxy none` +case "${ftp_proxy-none},$ftp,${http_proxy-none}" in + *,none,none) ;; + none,none,*) export ftp_proxy=$http_proxy ;; + none,*,*) export ftp_proxy=http://$ftp/ ;; +esac export XUSERFILESEARCHPATH="$HOME/.Xapps/%N:/usr/lib/X11/%T/%N%S"