[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb a4d11f5 293/350: Modify ebdb-mua-yank-cc to yank f
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb a4d11f5 293/350: Modify ebdb-mua-yank-cc to yank from any EBDB buffer |
Date: |
Mon, 14 Aug 2017 11:46:57 -0400 (EDT) |
branch: externals/ebdb
commit a4d11f51560cbb480cc15aca49d082a15ed1daa7
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Modify ebdb-mua-yank-cc to yank from any EBDB buffer
* ebdb-mua.el (ebdb-mua-yank-cc): Otherwise what's the point, really?
If it only yanks from the EBDB buffer associated with the message
composition buffer, all message recipients are already in the EBDB
buffer.
---
ebdb-mua.el | 40 ++++++++++++++++++++++++----------------
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git a/ebdb-mua.el b/ebdb-mua.el
index 1611215..0a47580 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -1087,29 +1087,37 @@ where it was in the MUA, rather than quitting the EBDB
buffer."
(message "Article snarfing doesn't work in this context."))))
(defun ebdb-mua-yank-cc ()
- "CC the people displayed in the *EBDB* buffer on this mail message.
-The primary mail of each of the records currently listed in the
-*EBDB* buffer will be appended to the CC: field of the current buffer."
- ;; Consider making the guts of this into a method that lives in the
- ;; different message-sending MUA packages. All the `derived-mode-p'
- ;; stuff is a sign...
+ "Prompt for an *EBDB* buffer, and CC all records displayed in that buffer.
- ;; Also, collect the addresses that are already in the To: and Cc:
- ;; headers, and make sure we don't insert duplicates.
+The primary mail of each of the records currently listed in the
+chosen buffer will be appended to the CC: field of the current
+buffer."
+ ;; Make the guts of this into a method that lives in the different
+ ;; message-sending MUA packages. Also needs to check that the
+ ;; addresses are not already present in To: or CC:.
(interactive)
- (let ((addresses
- (with-current-buffer (ebdb-make-buffer-name)
- (delq nil
- (mapcar (lambda (x)
- (when-let ((mail (car (ebdb-record-mail (car x)
t))))
- (ebdb-dwim-mail (car x) mail)))
- ebdb-records)))))
+ (let* ((buffer
+ (get-buffer
+ (completing-read
+ "Yank from buffer: "
+ (mapcar #'buffer-name
+ (seq-filter (lambda (b)
+ (with-current-buffer b
+ (derived-mode-p 'ebdb-mode)))
+ (buffer-list))))))
+ (addresses
+ (with-current-buffer buffer
+ (delq nil
+ (mapcar (lambda (x)
+ (when-let ((mail (car (ebdb-record-mail (car x)
t))))
+ (ebdb-dwim-mail (car x) mail)))
+ ebdb-records)))))
(if (derived-mode-p 'message-mode 'mail-mode)
(when addresses
(if (derived-mode-p 'message-mode)
(message-goto-cc)
(mail-cc))
- (insert (mapconcat #'identity addresses ",\n")))
+ (insert (mapconcat #'identity addresses ", ")))
(message "Not in a mail composition buffer"))))
;; Functions for noninteractive use in MUA hooks
- [elpa] externals/ebdb 7dd034d 349/350: Fix up record citation, bind a command in EBDB mode, (continued)
- [elpa] externals/ebdb 7dd034d 349/350: Fix up record citation, bind a command in EBDB mode, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 615ed9a 326/350: Prefix arg to article snarfing only snarfs signature, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8776051 341/350: Changes to manual and README, reflecting EBDB's move to ELPA, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 80ce330 340/350: Remove libraries that will live in separate packages, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bc3c712 332/350: Move "Writing Internationalization Libraries" in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 3210ad7 338/350: Compiler-inspired fixes version 443992, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d7bc0c9 284/350: Drop the whole auto-notes thing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b25edb9 002/350: Squash "prep" branch, push to Github, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4bdf47e 263/350: Get notice routine working, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9ce8e30 310/350: Check db editable before reading new record, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a4d11f5 293/350: Modify ebdb-mua-yank-cc to yank from any EBDB buffer,
Eric Abrahamsen <=
- [elpa] externals/ebdb 7caa1b4 308/350: Fix bug in reading mail alias fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f987d46 305/350: Fix buffer modification call, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c890b24 296/350: Mention mail aliases in the manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb be9464d 319/350: When merging organization records, possibly merge role fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 969c44c 303/350: Small tweaks to README, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1df6476 322/350: Remove stray code, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8455b47 329/350: Bug in 851c0f1, signature snarfing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5cfad1d 317/350: Don't need so much docstring on ebdb-mode, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb acaf3d0 350/350: Move the mail field sorting thing to a :before method, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 2c05d6e 348/350: Wrong slot names when reading addresses, Eric Abrahamsen, 2017/08/14