setup: Install some new useful Emacs things for Git.
[profile] / bash_profile
index 22931b0..bc812d6 100644 (file)
@@ -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 "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