[ -d $i ] || continue
case "X$val" in
X)
- val=$i
- continue
- ;;
+ val=$i
+ continue
+ ;;
X$i)
continue
;;
__mdw_conf () {
local var=$1
val=`sed -n "
- /^[ ]*$var[ ]*=[ ]*\(\|.*[^ ]\)[ ]*$/ {
+ /^[ ]*$var[ ]*=[ ]*\(\|.*[^ ]\)[ ]*$/ {
s//\1/; p; q
}
" ${MDWCONF-$HOME/.mdw.conf}`
$PLAN9/bin
fi
+# --- Find whether a program exists ---
+
+__mdw_programp () { type -t >/dev/null "$1"; }
+
# --- And the same for manual pages ---
case "$MACHTIME" in
export EMAIL=`__mdw_conf email`
export QMAILINJECT=c
-# --- GIT environment things ---
+# --- Find a text editor ---
+
+export MDW_EDITOR=ed
+for ed in "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 GIT_AUTHOR_NAME=$NAME
-export GIT_AUTHOR_EMAIL=$EMAIL
-export GIT_COMMITTER_NAME=$NAME
-export GIT_COMMITTER_EMAIL=$EMAIL
+export EDITOR=mdw-editor VISUAL=mdw-editor
# --- Various options for programs ---
[ -z "$HOST" ] && export HOST=`hostname`
-unset LANG
+unset LANG LC_COLLATE
-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//:"
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
# export MAKEFLAGS="-j4"
if [ -z "$__mdw_bashrc" ] && [ "$__mdw_force_secure_session" = "yes" ] ||
( tty="`tty`" devtty="(/dev/)?${tty#/dev/}"
{ { { [ -e /etc/securetty ] && sectty=/etc/securetty; } ||
- { [ -e /etc/securettys ] && sectty=/etc/securettys; }; } &&
+ { [ -e /etc/securettys ] && sectty=/etc/securettys; }; } &&
egrep "$devtty" $sectty >/dev/null; } ||
{ [ -e /etc/default/login ] &&
egrep "^CONSOLE=$devtty" /etc/default/login >/dev/null; } ||
fi
fi
+[ -f "$HOME/.profile-local" ] && . "$HOME/.profile-local"
+
# --- Now, if my .bashrc hasn't been run yet, run it ---
#
# Oh, don't do that if we don't have a terminal.