###--------------------------------------------------------------------------
### 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
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.
## 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 ||
## 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'.
## 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"
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.
(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")))
</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>
;;; 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")
"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