[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 5fd19ea 287/350: Simplify MUA record editing
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 5fd19ea 287/350: Simplify MUA record editing |
Date: |
Mon, 14 Aug 2017 11:46:55 -0400 (EDT) |
branch: externals/ebdb
commit 5fd19ea1b731ba401666cafe937c86752d00c2b9
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Simplify MUA record editing
* ebdb-mua.el (ebdb-mua-edit-field): Remove both option and command of
this name.
(ebdb-mua-edit-field-sender, ebdb-mua-edit-field-recipients): Remove
both commands.
(ebdb-mua-edit-sender-notes): New, simpler command that only edits
the notes field of the message sender. All other edits should be
done with auto-update, message snarfing, or ebdb-mua-in-ebdb-buffer.
---
ebdb-mua.el | 57 ++++++++++-----------------------------------------------
1 file changed, 10 insertions(+), 47 deletions(-)
diff --git a/ebdb-mua.el b/ebdb-mua.el
index 63cc7a1..c36f033 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -65,21 +65,6 @@
"For communication between `ebdb-update-records' and `ebdb-query-create'.
It is a list with elements (NAME MAIL HEADER HEADER-CLASS MUA).")
-(defcustom ebdb-mua-edit-field ebdb-default-user-field
- "Field to edit with command `ebdb-mua-edit-field' and friends.
-This may take the values:
- name The full name
- affix The list of affixes
- organization The list of organizations
- aka the list of AKAs
- mail the list of email addresses
- all-fields Read the field to edit using a completion table
- that includes all fields currently known to EBDB.
-
-Any other symbol is interpreted as the name of a field class."
- :group 'ebdb-mua
- :type '(symbol :tag "Field to edit"))
-
(defcustom ebdb-mua-auto-update-p 'existing
"This option governs how EBDB handles addresses found in
incoming mail messages. It can take one of the following
@@ -1062,44 +1047,22 @@ where it was in the MUA, rather than quitting the EBDB
buffer."
[?q]))))))
;;;###autoload
-(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'.
-HEADER-CLASS is defined in `ebdb-message-headers'. If it is nil,
-use all classes in `ebdb-message-headers'."
+(defun ebdb-mua-edit-sender-notes ()
+ "Edit the notes field of the EBDB record of the message sender."
(interactive)
- (cond ((memq field '(firstname lastname address phone))
- (error "Field `%s' not editable this way" field))
- ((not field)
- (setq field ebdb-mua-edit-field)))
(ebdb-mua-prepare-article)
(let ((records (ebdb-update-records
- (ebdb-get-address-components header-class)
+ (ebdb-get-address-components 'sender)
'existing))
- field-instance)
+ notes)
(when records
- (ebdb-display-records records nil nil nil (ebdb-popup-window))
(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))
- (ebdb-record-insert-field record field-instance))))))
-
-;;;###autoload
-(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'."
- (interactive)
- (ebdb-mua-edit-field field 'sender))
-
-;;;###autoload
-(defun ebdb-mua-edit-field-recipients (&optional field)
- "Edit FIELD of record corresponding to recipient of this message."
- (interactive)
- (ebdb-mua-edit-field field 'recipients))
+ (setq notes (ebdb-record-field record 'notes))
+ (if notes
+ (ebdb-record-change-field record notes)
+ (setq notes (ebdb-read ebdb-default-notes-class))
+ (ebdb-record-insert-field record notes)))
+ (ebdb-redisplay-records records 'reformat t))))
;;;###autoload
(defun ebdb-mua-snarf-article ()
- [elpa] externals/ebdb 13f32ef 304/350: Fix propertize call when formatting field values, (continued)
- [elpa] externals/ebdb 13f32ef 304/350: Fix propertize call when formatting field values, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9169c1e 309/350: When inserting fields, read the field but insert a clone, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6c89a57 302/350: Mention record citing in the manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 110ece1 295/350: Mention internationalization library in the manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 3d4a236 299/350: Mention all supported MUAs in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb aea28d9 313/350: Add test for with-record-edits macro, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6687da1 244/350: Remove redundant customization group ebdb-utilities-snarf, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 0904c14 281/350: Split ebdb-org-open into two functions, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 88fc231 280/350: ebdb-complete: Add mail-mode support (#44), Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 63d2588 285/350: Combine with previous commit, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5fd19ea 287/350: Simplify MUA record editing,
Eric Abrahamsen <=
- [elpa] externals/ebdb 8cdb1d1 307/350: Fix bug in ebdb-char-fold-search logic, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5329d89 306/350: Mark arg as used in call to ebdb-with-record-edits, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 56f8f5f 301/350: Mention Org integration in the manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c0910a1 312/350: Add test for multiple databases plus read only, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9e5b55d 316/350: Set local variable correctly in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb e80675b 300/350: Mention support for completion frameworks in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9a0cca1 321/350: Create ebdb-parse method for URL fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b26e295 325/350: Fall back to human readable name of labeled fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 0fe0957 289/350: Large pile of manual, docstring, and comment edits, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4034f7a 331/350: Add phone field snarfing to the list of snarf routines, Eric Abrahamsen, 2017/08/14