diff options
author | Mike Kupfer <mkupfer@alum.berkeley.edu> | 2018-08-04 18:06:37 -0700 |
---|---|---|
committer | Mike Kupfer <mkupfer@alum.berkeley.edu> | 2018-08-04 18:06:37 -0700 |
commit | e1646e1e2864d6eaf567f4fe77cc11d3e17dde51 (patch) | |
tree | 355b76ad040d7a9538649c3d141280e6f8032713 /lisp/mh-e/mh-identity.el | |
parent | f7d65a5e972ce8563e7b7861f6f7f3508f275f12 (diff) | |
download | emacs-e1646e1e2864d6eaf567f4fe77cc11d3e17dde51.tar.gz emacs-e1646e1e2864d6eaf567f4fe77cc11d3e17dde51.tar.bz2 emacs-e1646e1e2864d6eaf567f4fe77cc11d3e17dde51.zip |
Fix mh-redistribute to work with nmh 1.5 and identities (SF#268)
Co-authored-by: Jeffrey C Honig <jch@honig.net>
* lisp/mh-e/mh-comp.el (mh-redistribute): Add a non-optional
identity parameter. Use mh-bare-components to generate a draft,
then apply identity-specific settings. Add more details to the
"Resent" annotation line.
(mh-dist-formfile): New.
(mh-bare-components): Add a formfile argument.
(mh-edit-again, mh-send-sub): Track the change to
mh-bare-components.
* lisp/mh-e/mh-identity.el (mh-select-identity)
(mh-identity-field): New.
Diffstat (limited to 'lisp/mh-e/mh-identity.el')
-rw-r--r-- | lisp/mh-e/mh-identity.el | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el index fd7c2b83fe7..a1eb22ff18e 100644 --- a/lisp/mh-e/mh-identity.el +++ b/lisp/mh-e/mh-identity.el @@ -132,6 +132,33 @@ valid header field." 'mh-identity-handler-default)) ;;;###mh-autoload +(defun mh-select-identity (default) + "Prompt for and return an identity. +If DEFAULT is non-nil, it will be used if the user doesn't enter a +different identity. + +See `mh-identity-list'." + (let (identity) + (setq identity + (completing-read + "Identity: " + (cons '("None") + (mapcar 'list (mapcar 'car mh-identity-list))) + nil t default nil default)) + (if (eq identity "None") + nil + identity))) + +;;;###mh-autoload +(defun mh-identity-field (identity field) + "Return the specified FIELD of the given IDENTITY. + +See `mh-identity-list'." + (let* ((pers-list (cadr (assoc identity mh-identity-list))) + (value (cdr (assoc field pers-list)))) + value)) + +;;;###mh-autoload (defun mh-insert-identity (identity &optional maybe-insert) "Insert fields specified by given IDENTITY. |