[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb d3e1485 283/350: Reinstate the notice record hook,
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb d3e1485 283/350: Reinstate the notice record hook, and move notice-record method |
Date: |
Mon, 14 Aug 2017 11:46:54 -0400 (EDT) |
branch: externals/ebdb
commit d3e1485fbca592525baff1cbcc6143e27d964e34
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Reinstate the notice record hook, and move notice-record method
* ebdb-mua.el (ebdb-notice-record-hook): I'd previously deleted this,
now put it back.
(ebdb-notice-record): Move this generic and method into this file,
it belongs here. Call the notice-record-hook as part of the
notice-record method.
* ebdb.el: Remove ebdb-notice-record from this file.
---
ebdb-mua.el | 32 +++++++++++++++++++++++++++++++-
ebdb.el | 17 -----------------
2 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/ebdb-mua.el b/ebdb-mua.el
index 6654fe3..3fff1ea 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -369,6 +369,36 @@ if you want to notice each record only once per message."
:group 'ebdb-mua
:type 'hook)
+(defcustom ebdb-notice-record-hook nil
+ "Hook run each time a record is \"noticed\" in a message.
+
+This means that the mail address in a message belongs to an
+existing EBDB record or to a record EBDB has created for the mail
+address.
+
+Run with two arguments: the record, and one of the symbols
+'sender or 'recipient. It is up to the hook function to
+determine which MUA is used and to act appropriately." :group
+'ebdb-mua :type 'hook)
+
+(cl-defgeneric ebdb-notice-record (record type)
+ "Inform RECORD that it's been \"noticed\".
+
+TYPE is one of the symbols 'sender or 'recipient, indicating
+RECORD's location in the message headers.")
+
+(cl-defmethod ebdb-notice-record ((rec ebdb-record) type)
+ "Notice REC.
+
+This means running the `ebdb-notice-record-hook', and passing on
+the notice message to all REC's `ebdb-field-user' instances, and
+its notes fields. Other built in fields (mail, phone, address)
+are not \"noticed\", nor is the timestamp updated."
+ (run-hook-with-args 'ebdb-notice-record-hook rec type)
+ (with-slots (fields notes) rec
+ (dolist (f (delq nil (cons notes fields)))
+ (ebdb-notice-field f type rec))))
+
(define-widget 'ebdb-alist-with-header 'group
"My group"
:match 'ebdb-alist-with-header-match
@@ -1056,7 +1086,7 @@ Return the records matching ADDRESS or nil."
(t
(message "noticed naked address \"%s\"" mail))))))
- ;;(run-hook-with-args 'ebdb-notice-mail-hook record)
+ (run-hook-with-args 'ebdb-notice-mail-hook record)
;; (ebdb-notice record) ; I think this is already happening in
;; `ebdb-update-records'.
(push record new-records)))
diff --git a/ebdb.el b/ebdb.el
index 3e24e93..ad0334f 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -2151,23 +2151,6 @@ only return fields that are suitable for user editing.")
(push (cons 'notes notes) f-list)))
f-list)
-(cl-defgeneric ebdb-notice-record (record type)
- "Inform RECORD that it's been \"noticed\".
-
-TYPE is one of the symbols 'sender or 'recipient, indicating
-RECORD's location in the message headers.")
-
-(cl-defmethod ebdb-notice-record ((rec ebdb-record) type)
- "Notice REC.
-
-Currently this just means passing on the notice message to all
-REC's `ebdb-field-user' instances, and its notes fields. Other
-built in fields (mail, phone, address) are not \"noticed\", nor
-is the timestamp updated."
- (with-slots (fields notes) rec
- (dolist (f (delq nil (cons notes fields)))
- (ebdb-notice-field f type rec))))
-
;; TODO: rename this to `ebdb-record-name-string', it's confusing.
(cl-defmethod ebdb-record-name ((record ebdb-record))
"Get or set-and-get the cached name string of RECORD."
- [elpa] externals/ebdb fcee6ab 267/350: Protect against no current record when redisplaying, (continued)
- [elpa] externals/ebdb fcee6ab 267/350: Protect against no current record when redisplaying, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f3b9525 269/350: Temporarily abandon having record-change-name accept strings, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1a31515 274/350: Fixes to record loading, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 01262e3 277/350: Mark EBDB buffers as modified after edits, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb cc83f62 197/350: Add protection around ebdb-record-uuid, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4f3db7f 195/350: Save match data around ebdb-parse-i18n, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb fcf0702 275/350: Mark EBDB buffers as unmodified after save, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 88f5e12 261/350: Fill out functionality of gnorb messages field, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a81769c 272/350: Allow custom hash predicates, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb e80753a 264/350: Change ebdb-record-change-name to accept strings, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d3e1485 283/350: Reinstate the notice record hook, and move notice-record method,
Eric Abrahamsen <=
- [elpa] externals/ebdb d8bc159 290/350: Fairly embarrassing oversight in setting ebdb buffers modified, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb afe5495 279/350: Adjust indentation of multi-line field values, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bbe407e 257/350: Code tweaks and re-arrangments, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 727eddb 262/350: Change databases' buffer-char slot into actual character, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5362b12 291/350: require pyim, for chinese-pyim has been renamed to pyim (#45), Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f62f15f 282/350: Pop up empty *EBDB* buffer for users with no records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f3f9f37 292/350: Move, rename and bind ebdb-mail-yank, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 89467fc 258/350: Don't wrap cl-print-object in eval-when-compile, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5e7a0d6 266/350: Change arg order of record-insert|delete-field, refactor, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 75de073 314/350: Let ebdb-complete can grab string which similar "guix-devel" (#46), Eric Abrahamsen, 2017/08/14