summaryrefslogtreecommitdiff
path: root/gnus-conf.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnus-conf.el')
-rw-r--r--gnus-conf.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/gnus-conf.el b/gnus-conf.el
index c0eae08..5ffca03 100644
--- a/gnus-conf.el
+++ b/gnus-conf.el
@@ -454,15 +454,28 @@ If ARG is non-nil, ask which identity to use. Otherwise use the
identity named durand."
(interactive "P")
(let* (choice
+ (to (message-fetch-field "To"))
+ (all-mnemonics
+ (flatten-tree
+ (mapcar (lambda (c)
+ (mapcar #'identity
+ (category-set-mnemonics
+ (char-category-set c))))
+ to)))
+ (default (cond
+ ((memq ?C all-mnemonics) "alt")
+ ("durand")))
(identity-to-use
(cond
(arg
(setq choice
(completing-read
- "Choose an identity: " durand-identities nil t))
+ (format "Choose an identity [%s]: " default)
+ durand-identities nil t nil nil
+ default))
(alist-get choice durand-identities nil nil #'string=))
((alist-get
- (setq choice "durand")
+ (setq choice default)
durand-identities nil nil #'string=))
((user-error "No identity crisis!"))))
(from (car identity-to-use))