Merge branch 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile
authorMark Wooding <mdw@distorted.org.uk>
Thu, 15 May 2008 10:46:31 +0000 (11:46 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 15 May 2008 10:46:31 +0000 (11:46 +0100)
* 'master' of git+ssh://ponder.ncipher.com/~mwooding/etc/profile:
  emacs: Initial blogging support.
  emacs: Turn off fontification in shell mode.
  emacs: Force py-shell to start ipython with the right colours.
  bashrc, dircolors: Enable colouring for `dumb' terminals.
  dot-emacs: Clobber message-mode's header colours.

bashrc
dircolors
dot-emacs.el
emacs

diff --git a/bashrc b/bashrc
index 755dffa..6759da7 100644 (file)
--- a/bashrc
+++ b/bashrc
@@ -14,50 +14,49 @@ __mdw_bashrc=done
 
 if [ -t 0 ]; then
 
-  if [ "$TERM" = "dumb" ]; then
-    if (( EUID == 0 )); then PS1="# "; else PS1="\$ "; fi
-    PS2="> "
-    PS4="+ "
-  else
+  case "$TERM" in
+    linux*|screen*|xterm*|vt100*|eterm*)
+      bold="\[$(tput bold)\]" unbold="\[$(tput sgr0)\]" nl="\[\r\]" ;;
+    *)
+      bold='' unbold='' nl='' ;;
+  esac
 
-    case "$TERM" in
-      linux*|screen*|xterm*|vt100*)
-       bold='\[\e[1m\]' unbold='\[\e[m\]' nl='\[\r\]' ;;
+  if (( EUID == 0 )); then
+    left=`echo « | iconv -f utf8 -t //translit`
+    right=`echo » | iconv -f utf8 -t //translit`
+  else
+    case $USER in
+      mdw|mwooding)
+       u="" left="[" right="]"
+       ;;
       *)
-       bold='' unbold='' nl='' ;;
+       u="\\u@" left="{" right="}"
+       ;;
     esac
-
-    if (( EUID == 0 )); then
-      left=`echo « | iconv -f utf8 -t //translit`
-      right=`echo » | iconv -f utf8 -t //translit`
+    if [ "$__mdw_tty" = "`tty`" ]; then
+      left="<" right=">"
     else
-      case $USER in
-       mdw|mwooding)
-         u="" left="[" right="]"
-         ;;
-       *)
-         u="\\u@" left="{" right="}"
-         ;;
-      esac
-      if [ "$__mdw_tty" = "`tty`" ]; then
-       left="<" right=">"
-      else
-       export __mdw_tty="`tty`"
-      fi
-    fi
-
-    if [ -z "$SSH_CLIENT" ] &&
-      [ "$__mdw_sechost" != "`hostname`" ]
-      then
-      sec_l='(' sec_r=')'
+      export __mdw_tty="`tty`"
     fi
+  fi
 
-    PS1="$nl$bold$left$sec_l$u\\h$sec_r \\w$right$unbold"
-    PS2="$PS1 $bold>$unbold "
+  if [ -z "$SSH_CLIENT" ] &&
+    [ "$__mdw_sechost" != "`hostname`" ]
+    then
+    sec_l='(' sec_r=')'
   fi
 
+  PS1="$nl$bold$left$sec_l$u\\h$sec_r \\w$right$unbold"
+  PS2="$PS1 $bold>$unbold "
+
 fi # is stdin a tty?
 
+# --- Pagers are less useful within Emacs ---
+
+case "$INSIDE_EMACS" in
+  22.*,comint) export PAGER=cat ;;
+esac
+
 # --- Little preferences ---
 
 notify=1
@@ -99,8 +98,7 @@ shopt -s sourcepath
 # --- Some colour `ls' support ---
 
 [ "${TMPDIR+yes}" ] || eval `tmpdir -b`
-if [ -x /usr/bin/dircolors -o -x /usr/local/bin/dircolors ] &&
-   [ "$TERM" != "dumb" ]; then
+if [ -x /usr/bin/dircolors -o -x /usr/local/bin/dircolors ]; then
   eval `dircolors -b ~/.dircolors`
 else
   unset LS_COLORS
index 85915b9..37c1af1 100644 (file)
--- a/dircolors
+++ b/dircolors
@@ -6,6 +6,8 @@
 
 # Below, there should be one TERM entry for each termtype that is colorizable
 TERM linux
+TERM dumb
+TERM eterm-color
 TERM console
 TERM con132x25
 TERM con132x30
index 82d0214..1596f11 100644 (file)
@@ -664,6 +664,30 @@ the regular expressions in `mdw-backup-disable-regexps'."
     (font-lock-keyword-face :weight bold)
     (font-lock-constant-face :weight bold)
     (font-lock-reference-face :weight bold)
+    (message-cited-text
+       :foreground ,(if window-system "SeaGreen1" "green")
+       :slant italic)
+    (message-separator :background "red" :foreground "white" :weight bold)
+    (message-header-cc
+       :foreground ,(if window-system "SeaGreen1" "green")
+       :weight bold)
+    (message-header-newsgroups
+       :foreground ,(if window-system "SeaGreen1" "green")
+       :weight bold)
+    (message-header-subject
+       :foreground ,(if window-system "SeaGreen1" "green")
+       :weight bold)
+    (message-header-to
+       :foreground ,(if window-system "SeaGreen1" "green")
+       :weight bold)
+    (message-header-xheader
+       :foreground ,(if window-system "SeaGreen1" "green")
+       :weight bold)
+    (message-header-other
+       :foreground ,(if window-system "SeaGreen1" "green")
+       :weight bold)
+    (message-header-name
+       :foreground ,(if window-system "SeaGreen1" "green"))
     (woman-bold :weight bold)
     (woman-italic :slant italic)
     (diff-index :weight bold)
diff --git a/emacs b/emacs
index 5980490..9b9ae96 100644 (file)
--- a/emacs
+++ b/emacs
 
 (setq-default py-indent-offset 2)
 (add-hook 'python-mode-hook 'mdw-fontify-python t)
+(setq py-python-command-args `("-i" "-colors" ,(if mdw-black-background
+                                                  "Linux"
+                                                "LightBG")))
 
 (setq-default tcl-indent-level 2)
 (add-hook 'tcl-mode-hook 'mdw-fontify-tcl t)
              (cons head slime-lisp-implementations))))))
 (setq slime-default-lisp 'sbcl)
 
+;;;----- Blogging -----------------------------------------------------------
+
+(setq weblogger-config-alist
+      '(("vox"
+        ("user" . "mdw")
+        ("server-url" . "http://vox.distorted.org.uk/admin/mt-xmlrpc.cgi")
+        ("weblog" . "1"))))
+
 ;;;----- Shell mode ---------------------------------------------------------
 
 ;; --- Make the shell mode aware of my prompt ---
 ;; --- Notice passwords, and make C-a work right ---
 
 (add-hook 'shell-mode-hook #'mdw-sh-mode-setup)
+(setq shell-font-lock-keywords nil)
 
 (add-hook 'term-mode-hook #'mdw-term-mode-setup)