chiark / gitweb /
Merge slippers:etc/profile
authorMark Wooding <mdw@distorted.org.uk>
Fri, 15 Apr 2016 13:56:16 +0000 (14:56 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 15 Apr 2016 13:56:16 +0000 (14:56 +0100)
* slippers:etc/profile:
  dot/bash_profile: Sensible default behaviour for `~/.mdw.conf' lookups.
  dot/emacs: Ignore email addresses for work bug system.
  dot/gnus.el: Set a null primary source if no NNTP server is available.
  dot/emacs: Arrange for Org mode to autoload for diary's benefit.
  dot/bash_profile: Use the `gnome-keyring-daemon' if there's a session bus.
  dot/emacs: Some more addresses for BBDB to ignore.
  dot/emacs: Don't try to save mail to `~/Mail/sent'.
  el/dot-emacs.el: Fix `bbdb-canonicalize-address'.
  dot/emacs: Note a new email address for me.
  dot/emacs: Use working `bbdb-extract-address-components-func'.
  dot/fonts.conf: Fix mis-spelled attribute name.

dot/bash_profile
dot/emacs
dot/fonts.conf
dot/gnus.el
el/dot-emacs.el

index 4ce6280b9d33241b06c0724a69a71ab014941a43..2a47c68b62f41d9037fbabf5e97cf37510914177 100644 (file)
@@ -93,6 +93,12 @@ __mdw_addto PYTHONPATH r $HOME/lib/python
 ###--------------------------------------------------------------------------
 ### Various other kinds of configuration.
 
+__mdw_setconf () {
+  if val=$(mdw-conf 2>/dev/null "$2"); then
+    eval "export $1=\$val"
+  fi
+}
+
 ## Establish a temporary directory.
 [ "$TMPDIR" ] || eval `tmpdir -b`
 export TMP=$TMPDIR
@@ -101,9 +107,9 @@ export TMP=$TMPDIR
 umask 002
 
 ## Mail and general identification.
-export MAIL=`mdw-conf mailbox`
+__mdw_setconf MAIL mailbox
 export NAME="Mark Wooding"
-export EMAIL=`mdw-conf email`
+__mdw_setconf EMAIL email
 export QMAILINJECT=c
 
 ## Some programs want to know the hostname.
@@ -131,9 +137,9 @@ export EDITOR=mdw-editor VISUAL=mdw-editor
 ## Determine the locale settings.  Really don't set LC_COLLATE because it
 ## messes with the order of files in `ls' listings and similar.
 if [ "$DISPLAY" != "" ]; then
-  LANG=`mdw-conf x-ctype`
+  LANG=`mdw-conf x-ctype POSIX`
 else
-  : ${LANG=${LC_CTYPE-${LC_ALL-`mdw-conf console-ctype`}}}
+  : ${LANG=${LC_CTYPE-${LC_ALL-`mdw-conf console-ctype POSIX`}}}
   case "$TERM,`tty`" in
     linux,/dev/tty*)
       if { vt-is-UTF8 ||
@@ -199,7 +205,7 @@ unset browsers
 
 ## Acquiring root privileges.  This is mainly the job of `bashrc', but we
 ## cache the mechanism here.
-export __MDW_ROOTLY=`mdw-conf rootly`
+__mdw_setconf __MDW_ROOTLY rootly
 export BECOME="--preserve-environment"
 
 ## It's useful to see the little sigils in `ls'.
@@ -210,12 +216,12 @@ export BASCAT="-l +n"
 
 ## Version control hacking.
 export CVS_RSH=ssh
-export CVSROOT=`mdw-conf cvs-root`
-export SVNROOT=`mdw-conf svn-root`
+__mdw_setconf CVSROOT cvs-root
+__mdw_setconf SVNROOT svn-root
 export P4CONFIG=.p4
 
 ## News server.
-[ -z "$NNTPSERVER" ] && export NNTPSERVER=`mdw-conf nntp-server`
+__mdw_setconf NNTPSERVER nntp-server
 
 ## Help X programs find their resources.
 export XUSERFILESEARCHPATH="$HOME/.Xapps/%N:/usr/lib/X11/%T/%N%S"
@@ -239,13 +245,11 @@ ulimit -S -c 0
 if { { [ "$GNOME_KEYRING_CONTROL" ] &&
        [ -s "$GNOME_KEYRING_CONTROL" ]; } ||
      { [ "$DBUS_SESSION_BUS_ADDRESS" ] &&
-       dbus-send --session --print-reply --dest=org.freedesktop.DBus \
-        / org.freedesktop.DBus.GetNameOwner string:org.gnome.keyring \
-        >/dev/null 2>/dev/null; }; } &&
-   stuff=$(gnome-keyring-daemon -s -c ssh 2>/dev/null)
+       __mdw_programp gnome-keyring-daemon; }; } &&
+   stuff=$(gnome-keyring-daemon -s -c ssh,gpg 2>/dev/null)
 then
   eval "$stuff"
-  export SSH_AUTH_SOCK
+  export SSH_AUTH_SOCK GPG_AGENT_INFO
 fi
 
 ## If we still don't have an agent then start one with a stable name.
index 562d73310bd08a2a3166d77df21e1c9bcc9e7aa3..5bb61e2703c5696b3691640f86ea80ef86b4df51 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
@@ -52,6 +52,7 @@
 (maybe-autoload 'stgit "stgit" nil t)
 (maybe-autoload 'nc-timesheet-prepare "nc-timesheet" nil t nil)
 (maybe-autoload 'nc-timesheet-submit "nc-timesheet" nil t nil)
+(maybe-autoload 'org-bbdb-anniversaries "org" nil t)
 
 (and (library-exists-p "debian-changelog-mode")
      (add-to-list 'auto-mode-alist
 (setq mail-from-style 'angles
       mail-signature t
       mail-yank-prefix "> "
-      mail-archive-file-name "~/Mail/sent"
+      mail-archive-file-name nil
+      message-default-mail-headers ""
+      message-default-news-headers ""
       compose-mail-user-agent-warnings nil)
 
 (setq rmail-display-summary t)
     (trap (bbdb-initialize 'gnus 'sendmail 'message)))
 (setq bbdb-file "~/etc/brain/bbdb"
       bbdb-north-american-phone-numbers-p nil
+      bbdb-extract-address-components-func 'bbdb-extract-address-components
       bbdb/news-auto-create-p
       (lambda ()
        (let ((group gnus-newsgroup-name))
                    "\\(chiark\\|slimy\\|coriolis\\)\\.greenend\\.org\\.uk"
              "\\|" "distorted\\.mdw@g\\(\\|oogle\\)mail.com"
              "\\|" "mwooding@\\(good\\|blackberry\\)\\.com"
+             "\\|" "mark\\.wooding@trustonic\\.com"
              "\\)$")
       bbdb-canonicalize-net-hook
       (lambda (addr)
                                         "\\|" "distorted\\.org\\.uk"
                                         "\\)$")
                                 addr)
+                  (string-match (concat "^MicrosoftExchange[0-9a-f]*"
+                                        "@newincco\\.onmicrosoft\\.com")
+                                addr)
+                  (member (md5 addr)
+                          '("8815c5583970856799c85a3ee0eb6a9f" ;work wiki spam
+                            "0b94ab4d25dacaa5ac07243a09c9e22e" ;work bug spam
+                            ))
                   (and (string-match "^news\\([0-9]+\\)@\\(.*\\)$" addr)
                        (string= (md5 (match-string 2 addr))
                                 "879b795aed959b1a000e9f95c132b16c")))
index a71e415e74f71367a8d477cc7347a39136e6e373..261b7602486a9def7cc98549125bd51dbd4d4afc 100644 (file)
@@ -57,7 +57,7 @@
     </edit>
   </match>
 
-  <match targets="pattern">
+  <match target="pattern">
     <test name="family"><string>Geneva</string></test>
     <edit mode="append" name="family"><string>FreeSans</string></edit>
   </match>
index 46b0a044371cff019470d118c830da464d287146..ebf83f2226081d04b87d4969663887580de1baf4 100644 (file)
@@ -96,7 +96,11 @@ (add-hook 'gnus-article-mode-hook #'mdw-gnus-article-setup)
 ;;; Local configuration.
 
 ;; Fetching news from the local news server seems sensible.
-(setq gnus-select-method `(nntp ,(mdw-config 'nntp-server)))
+(setq gnus-select-method
+      (let ((server (mdw-config 'nntp-server)))
+       (if server
+           `(nntp ,server)
+         '(nnnil ""))))
 
 ;; Now load a local configuration file.
 (load "~/.gnus-local.el")
index a1cba54a035846c58334e45e870dcef0e0e1529a..dd8dc2f7614b23b9ce9955807c5ee25d0c3910ff 100644 (file)
@@ -238,6 +238,32 @@ (defadvice markdown-check-change-for-wiki-link
   "Save match data around the `markdown-mode' `after-change-functions' hook."
   (save-match-data ad-do-it))
 
+;; Bug fix for `bbdb-canonicalize-address': on Emacs 24, `run-hook-with-args'
+;; always returns nil, with the result that all email addresses are lost.
+;; Replace the function entirely.
+(defadvice bbdb-canonicalize-address
+    (around mdw-bug-fix activate compile)
+  "Don't use `run-hook-with-args', because that doesn't work."
+  (let ((net (ad-get-arg 0)))
+
+    ;; Make sure this is a proper hook list.
+    (if (functionp bbdb-canonicalize-net-hook)
+       (setq bbdb-canonicalize-net-hook (list bbdb-canonicalize-net-hook)))
+
+    ;; Iterate over the hooks until things converge.
+    (let ((donep nil))
+      (while (not donep)
+       (let (next (changep nil)
+             hook (hooks bbdb-canonicalize-net-hook))
+         (while hooks
+           (setq hook (pop hooks))
+           (setq next (funcall hook net))
+           (if (not (equal next net))
+               (setq changep t
+                     net next)))
+         (setq donep (not changep)))))
+    (setq ad-return-value net)))
+
 ;; Transient mark mode hacks.
 
 (defadvice exchange-point-and-mark