+
+### Troubleshooting message-mode gpg support
+
+- If you have trouble with expired subkeys, you may have encountered
+ emacs bug #7931. This is fixed in git commit 301ea744c on
+ 2011-02-02. Note that if you have the Debian package easypg
+ installed, it will shadow the fixed version of easypg included with
+ emacs.
+
+## Multiple identities using gnus-alias
+
+[gnus-alias](http://www.emacswiki.org/emacs/GnusAlias) allows you to
+define multiple identities when using `message-mode`. You can specify
+the from address, organization, extra headers (including *Bcc*), extra
+body text, and signature for each identity. Identities are chosen
+based on a set of rules. When you are in message mode, you can switch
+identities using gnus-alias.
+
+### Installation
+
+- put `gnus-alias.el` on your load Emacs-Lisp load path (add new directory
+ to load path by writing `(add-to-list 'load-path "/some/load/path")` into
+ your `.emacs`.
+
+- Add the following to your `.emacs`
+
+ (autoload 'gnus-alias-determine-identity "gnus-alias" "" t)
+ (add-hook 'message-setup-hook 'gnus-alias-determine-identity)
+
+Looking into `gnus-alias.el` gives a bit more information...
+
+### Example Configuration
+
+Here is an example configuration.
+
+ ;; Define two identities, "home" and "work"
+ (setq gnus-alias-identity-alist
+ '(("home"
+ nil ;; Does not refer to any other identity
+ "John Doe <jdoe@example.net>" ;; Sender address
+ nil ;; No organization header
+ nil ;; No extra headers
+ nil ;; No extra body text
+ "~/.signature")
+ ("work"
+ nil
+ "John Doe <john.doe@example.com>"
+ "Example Corp."
+ (("Bcc" . "john.doe@example.com"))
+ nil
+ "~/.signature.work")))
+ ;; Use "home" identity by default
+ (setq gnus-alias-default-identity "home")
+ ;; Define rules to match work identity
+ (setq gnus-alias-identity-rules
+ '(("work" ("any" "john.doe@\\(example\\.com\\|help\\.example.com\\)" both) "work"))
+ ;; Determine identity when message-mode loads
+ (add-hook 'message-setup-hook 'gnus-alias-determine-identity)
+
+When `gnus-alias` has been loaded (using autoload, require, *M-x load-library*
+or *M-x load-file* (load-file takes file path -- therefore it can be used
+without any `.emacs` changes)) the following commands can be used to get(/set)
+more information (some of these have "extensive documentation"):
+
+ M-x describe-variable RET gnus-alias-identity-alist
+ M-x describe-variable RET gnus-alias-identity-rules
+ M-x describe-variable RET gnus-alias-default-identity
+
+ M-x customize-group RET gnus-alias RET
+ or
+ M-x gnus-alias-customize RET
+
+The last two do the same thing.
+
+See also the **Usage:** section in `gnus-alias.el`.
+
+## Resending (or bouncing) messages
+
+Add the following to your `.emacs` to be able to resend the current message in
+show mode.
+
+ (define-key notmuch-show-mode-map "b"
+ (lambda (&optional address)
+ "Bounce the current message."
+ (interactive "sBounce To: ")
+ (notmuch-show-view-raw-message)
+ (message-resend address)))
+
+## `notmuch-hello` refresh status message
+
+Add the following to your `.emacs` to get a status message about the change in
+the number of messages in the mail store when refreshing the `notmuch-hello`
+buffer.
+
+ (defvar notmuch-hello-refresh-count 0)
+
+ (defun notmuch-hello-refresh-status-message ()
+ (unless no-display
+ (let* ((new-count
+ (string-to-number
+ (car (process-lines notmuch-command "count"))))
+ (diff-count (- new-count notmuch-hello-refresh-count)))
+ (cond
+ ((= notmuch-hello-refresh-count 0)
+ (message "You have %s messages."
+ (notmuch-hello-nice-number new-count)))
+ ((> diff-count 0)
+ (message "You have %s more messages since last refresh."
+ (notmuch-hello-nice-number diff-count)))
+ ((< diff-count 0)
+ (message "You have %s fewer messages since last refresh."
+ (notmuch-hello-nice-number (- diff-count)))))
+ (setq notmuch-hello-refresh-count new-count))))
+
+ (add-hook 'notmuch-hello-refresh-hook 'notmuch-hello-refresh-status-message)