From ba3fddf46aa49b8909e257de1874cb19bc1a11e1 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 13 Jun 2012 23:34:49 +0300 Subject: [PATCH] some more pointers & tips for gnus-alias... --- emacstips.mdwn | 69 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/emacstips.mdwn b/emacstips.mdwn index 074c593..a5b7247 100644 --- a/emacstips.mdwn +++ b/emacstips.mdwn @@ -462,30 +462,46 @@ part. ## Multiple identities using gnus-alias -gnus-alias 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. +[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 " - nil ;; No organization header - nil ;; No extra headers - nil ;; No extra body text - "~/.signature") - ("work" - nil - "John Doe " - "Example Corp." - (("Bcc" . "john.doe@example.com")) - nil - "~/.signature.work"))) + nil ;; Does not refer to any other identity + "John Doe " ;; Sender address + nil ;; No organization header + nil ;; No extra headers + nil ;; No extra body text + "~/.signature") + ("work" + nil + "John Doe " + "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 @@ -493,3 +509,20 @@ Here is an example configuration. '(("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 docvumentation"): + + 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`. -- 2.43.0