[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 548e05d 106/350: Tweaks to MUA interactive command
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 548e05d 106/350: Tweaks to MUA interactive commands |
Date: |
Mon, 14 Aug 2017 11:46:16 -0400 (EDT) |
branch: externals/ebdb
commit 548e05dfd5e23d0b1f4b59221b62357df4cdf090
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Tweaks to MUA interactive commands
* ebdb-mua.el: Remove the update-p arg from everything, and fix up
`ebdb-mua-edit-field' so it actually works. Still needs heavy
refactoring, though.
---
ebdb-mua.el | 58 +++++++++++++++++++++++++++++-----------------------------
1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/ebdb-mua.el b/ebdb-mua.el
index f61498d..c682d9d 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -1287,41 +1287,36 @@ If ANNOTATION is an empty string and REPLACE is
non-nil, delete FIELD."
'(affix organization mail aka))))
ebdb-annotate-field)))
(list (read-string (format "Annotate `%s': " field))
- field current-prefix-arg
- (car ebdb-mua-update-interactive-p))))
+ field current-prefix-arg)))
;;;###autoload
-(defun ebdb-mua-annotate-sender (annotation &optional field replace update-p)
+(defun ebdb-mua-annotate-sender (annotation &optional field replace)
"Add ANNOTATION to field FIELD of the EBDB record(s) of message sender(s).
FIELD defaults to `ebdb-annotate-field'.
-If REPLACE is non-nil, ANNOTATION replaces the content of FIELD.
-UPDATE-P may take the same values as `ebdb-update-records-p'."
- (interactive)
+If REPLACE is non-nil, ANNOTATION replaces the content of FIELD."
+ (interactive (ebdb-mua-annotate-field-interactive))
(ebdb-mua-prepare-article)
(dolist (record (ebdb-update-records
(ebdb-get-address-components 'sender)
- update-p))
+ 'existing))
(ebdb-annotate-record record annotation field replace)))
;;;###autoload
-(defun ebdb-mua-annotate-recipients (annotation &optional field replace
- update-p)
+(defun ebdb-mua-annotate-recipients (annotation &optional field replace)
"Add ANNOTATION to field FIELD of the EBDB records of message recipients.
FIELD defaults to `ebdb-annotate-field'.
-If REPLACE is non-nil, ANNOTATION replaces the content of FIELD.
-UPDATE-P may take the same values as `ebdb-update-records-p'."
- (interactive)
+If REPLACE is non-nil, ANNOTATION replaces the content of FIELD."
+ (interactive (ebdb-mua-annotate-field-interactive))
(ebdb-mua-prepare-article)
(dolist (record (ebdb-update-records
(ebdb-get-address-components 'recipients)
- update-p))
+ 'existing))
(ebdb-annotate-record record annotation field replace)))
;;;###autoload
-(defun ebdb-mua-edit-field (&optional field update-p header-class)
+(defun ebdb-mua-edit-field (&optional field header-class)
"Edit FIELD of the EBDB record(s) of message sender(s) or recipients.
FIELD defaults to value of variable `ebdb-mua-edit-field'.
-UPDATE-P may take the same values as `ebdb-update-records-p'.
HEADER-CLASS is defined in `ebdb-message-headers'. If it is nil,
use all classes in `ebdb-message-headers'."
(interactive)
@@ -1332,29 +1327,34 @@ use all classes in `ebdb-message-headers'."
(ebdb-mua-prepare-article)
(let ((records (ebdb-update-records
(ebdb-get-address-components header-class)
- update-p))
- (ebdb-pop-up-window-size ebdb-mua-pop-up-window-size))
+ 'existing))
+ (ebdb-pop-up-window-size ebdb-mua-pop-up-window-size)
+ field-instance slot)
(when records
(ebdb-display-records records nil nil nil (ebdb-popup-window))
- (dolist (record records)
- (ebdb-edit-field record field)))))
+ (ebdb-with-record-edits (record records)
+ ;; All this is very bad, we need to rework `ebdb-edit-foo' so
+ ;; it can be used here.
+ (setq field-instance (ebdb-record-field record field))
+ (if field-instance
+ (ebdb-record-change-field record field-instance)
+ (setq field-instance (ebdb-read field)
+ slot (car (ebdb-record-field-slot-query
+ (eieio-object-class record) `(nil . ,field))))
+ (ebdb-record-insert-field record slot field-instance))))))
;;;###autoload
-(defun ebdb-mua-edit-field-sender (&optional field update-p)
+(defun ebdb-mua-edit-field-sender (&optional field)
"Edit FIELD of record corresponding to sender of this message.
-FIELD defaults to value of variable `ebdb-mua-edit-field'.
-UPDATE-P may take the same values as `ebdb-update-records-p'.
-For interactive calls, see function `ebdb-mua-update-interactive-p'."
+FIELD defaults to value of variable `ebdb-mua-edit-field'."
(interactive)
- (ebdb-mua-edit-field field update-p 'sender))
+ (ebdb-mua-edit-field field 'sender))
;;;###autoload
-(defun ebdb-mua-edit-field-recipients (&optional field update-p)
- "Edit FIELD of record corresponding to recipient of this message.
-FIELD defaults to value of variable `ebdb-mua-edit-field'.
-UPDATE-P may take the same values as `ebdb-update-records-p'."
+(defun ebdb-mua-edit-field-recipients (&optional field)
+ "Edit FIELD of record corresponding to recipient of this message."
(interactive)
- (ebdb-mua-edit-field field update-p 'recipients))
+ (ebdb-mua-edit-field field 'recipients))
;; Functions for noninteractive use in MUA hooks
- [elpa] externals/ebdb 189314d 151/350: Fix up Org link following, (continued)
- [elpa] externals/ebdb 189314d 151/350: Fix up Org link following, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 52d3d54 113/350: Remove all pop-up-window-size type options, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4cd4a0c 123/350: Simplify searching, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5b24d54 126/350: Special-case mail symbol in ebdb-record-field, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5613bc2 137/350: Fix bug in ebdb-record-field-slot-query, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 86b386d 141/350: Compiler-inspired fixes, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 05f67d6 081/350: Fix merging procedure, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1ded570 086/350: Note new database-related commands in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ef673e2 094/350: Improve organization searching, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bc71bda 099/350: Many fixes to migration routine, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 548e05d 106/350: Tweaks to MUA interactive commands,
Eric Abrahamsen <=
- [elpa] externals/ebdb dd83c7e 115/350: Short-circuit ebdb-info, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a0eada8 128/350: Change some of the EBDB buffer formatting defaults, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 20906ae 131/350: ebdb-prompt-for-record should load if necessary, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1bc78ab 133/350: Add helm-ebdb file, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ed3e270 119/350: Reverse order of args in return value of ebdb-popup-window, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ed6e228 136/350: Make ebdb-annotate-message more class agnostic, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb aa2d973 147/350: Allow optional records argument to ebdb-initialize, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 42f6dce 130/350: Add "Hacking EBDB" section to manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5dda311 118/350: Force mode line update after renaming EBDB buffers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a94483d 122/350: Refinements to snarfing, Eric Abrahamsen, 2017/08/14