[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 0904c14 281/350: Split ebdb-org-open into two func
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 0904c14 281/350: Split ebdb-org-open into two functions |
Date: |
Mon, 14 Aug 2017 11:46:54 -0400 (EDT) |
branch: externals/ebdb
commit 0904c1441e002828bb2bee9df5204631cad3c6b5
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Split ebdb-org-open into two functions
* ebdb-org.el (ebdb-org-retrieve): New function only parses an Org
link and retrieves the matching records (doesn't display them).
(ebdb-org-open): This function now only calls `ebdb-org-retrieve'
and displays the results.
---
ebdb-org.el | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/ebdb-org.el b/ebdb-org.el
index ea7697a..9489196 100644
--- a/ebdb-org.el
+++ b/ebdb-org.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2016-2017 Free Software Foundation, Inc.
;; Author: Eric Abrahamsen <address@hidden>
-;; Keywords:
+;; Keywords:
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -84,22 +84,24 @@
(defun ebdb-org-open (link)
"Follow a EBDB link."
- (let ((records
- (pcase (split-string link "/" t)
- (`("uuid" ,key) (list (ebdb-gethash key 'uuid)))
- (`(,key) (ebdb-search (ebdb-records) `((ebdb-field-name ,key))))
- (`("mail" ,key) (ebdb-search (ebdb-records) `((ebdb-field-mail
,key))))
- (`("phone" ,key) (ebdb-search (ebdb-records) `((ebdb-field-phone
,key))))
- (`("address" ,key) (ebdb-search (ebdb-records) `((ebdb-field-address
,key))))
- (`("notes" ,key) (ebdb-search (ebdb-records) `((ebdb-field-notes
,key))))
- (`("tags" ,key) (ebdb-search (ebdb-records) `((ebdb-org-field-tags
,key))))
- (`(,(and field (guard (child-of-class-p (intern-soft field)
'ebdb-field))) ,key)
- (ebdb-search (ebdb-records) `((,(intern-soft field) ,key))))
- (`(,other _) (error "Unknown field search prefix: %s" other)))))
+ (let ((records (ebdb-org-retrieve link)))
(if records
(ebdb-display-records records nil nil nil (ebdb-popup-window))
(message "No records found"))))
+(defun ebdb-org-retrieve (link)
+ (pcase (split-string link "/" t)
+ (`("uuid" ,key) (list (ebdb-gethash key 'uuid)))
+ (`(,key) (ebdb-search (ebdb-records) `((ebdb-field-name ,key))))
+ (`("mail" ,key) (ebdb-search (ebdb-records) `((ebdb-field-mail ,key))))
+ (`("phone" ,key) (ebdb-search (ebdb-records) `((ebdb-field-phone ,key))))
+ (`("address" ,key) (ebdb-search (ebdb-records) `((ebdb-field-address
,key))))
+ (`("notes" ,key) (ebdb-search (ebdb-records) `((ebdb-field-notes ,key))))
+ (`("tags" ,key) (ebdb-search (ebdb-records) `((ebdb-org-field-tags ,key))))
+ (`(,(and field (guard (child-of-class-p (intern-soft field) 'ebdb-field)))
,key)
+ (ebdb-search (ebdb-records) `((,(intern-soft field) ,key))))
+ (`(,other _) (error "Unknown field search prefix: %s" other))))
+
(defun ebdb-org-export (path desc format)
"Create the export version of a EBDB link specified by PATH or DESC.
If exporting to either HTML or LaTeX FORMAT the link will be
- [elpa] externals/ebdb 75de073 314/350: Let ebdb-complete can grab string which similar "guix-devel" (#46), (continued)
- [elpa] externals/ebdb 75de073 314/350: Let ebdb-complete can grab string which similar "guix-devel" (#46), Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dbf980e 288/350: Create specific keymap for using EBDB in MUAs, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4a35635 297/350: Mention vCard export support in manual, Eric Abrahamsen, 2017/08/14
- [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 <=
- [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, 2017/08/14
- [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