[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb e5696fa 253/350: Add counsel-ebdb.el
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb e5696fa 253/350: Add counsel-ebdb.el |
Date: |
Mon, 14 Aug 2017 11:46:48 -0400 (EDT) |
branch: externals/ebdb
commit e5696fa741e92e180b0e15b097f3b05d47782319
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Add counsel-ebdb.el
* counsel-ebdb.el: For completing using the counsel/ivy interface.
Command name is also `counsel-ebdb'. Eventually these will get split
off into different packages.
---
counsel-ebdb.el | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/counsel-ebdb.el b/counsel-ebdb.el
new file mode 100644
index 0000000..7e50ab7
--- /dev/null
+++ b/counsel-ebdb.el
@@ -0,0 +1,62 @@
+;;; counsel-ebdb.el --- Counsel integration for EBDB -*- lexical-binding: t;
-*-
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Eric Abrahamsen <address@hidden>
+
+;; 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
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Counsel (actually ivy) integration for EBDB.
+
+;;; Code:
+
+(require 'ebdb)
+(require 'ivy)
+
+(defun counsel-ebdb ()
+ "Select EBDB contacts using the ivy/counsel interface."
+ (interactive)
+ (ivy-read
+ "Records: "
+ (mapcar
+ ;; This same lambda is used in helm-ebdb, refactor or maybe even
+ ;; make customizable. Presumably we could use the :matcher
+ ;; argument to provide a function that matched the name and mail
+ ;; strings, but then you wouldn't actually see the mail strings in
+ ;; the completion window, would you?
+ (lambda (rec)
+ (let* ((rec-string (ebdb-string rec))
+ (mails (ebdb-record-mail-canon rec))
+ (mail-list (when mails
+ (mapconcat #'identity
+ mails
+ " "))))
+ (cons (if mail-list
+ (concat rec-string
+ " => "
+ mail-list)
+ rec-string)
+ rec)))
+ (ebdb-records))
+ :action
+ '(1
+ ("o" (lambda (r)
+ (ebdb-display-records (list (cdr r)) nil t)) "display")
+ ("m" (lambda (r) (ebdb-mail (cdr r))) "send mail")
+ ("i" (lambda (r) (ebdb-cite-records-mail (cdr r))) "insert"))))
+
+(provide 'counsel-ebdb)
+;;; counsel-ebdb.el ends here
- [elpa] externals/ebdb 4937cbd 225/350: Specify class of name fields when updating from MUA, (continued)
- [elpa] externals/ebdb 4937cbd 225/350: Specify class of name fields when updating from MUA, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 13c0a38 216/350: Tweaks to testing macros, more tests, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 2b28f57 239/350: Bump to version 0.2, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ff3cfa4 232/350: ebdb-parse-i18n for Chinese phones should pass class arg through, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d5bec83 229/350: Fix to UUID change, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 72aba6a 228/350: New label/field alist for vcard export, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d0d0bbb 233/350: Shift transformation of search strings into ebdb-search, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dc4217d 213/350: Compiler-inspired fixes, volume 5453, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ce5d9ee 242/350: Fix vCard formatting for anniversaries, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5d7a58c 246/350: Add option for character fold searching, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb e5696fa 253/350: Add counsel-ebdb.el,
Eric Abrahamsen <=
- [elpa] externals/ebdb fb4d5d5 255/350: Migration should guard against unparseable emails, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb aa15250 252/350: Change newline approach in vCard handling, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 0120729 240/350: Add vcard unescaping, and some vcard tests, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6f8d59b 254/350: Fix record citation, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 3106b45 256/350: Require ebdb-format in ebdb-vcard, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7549366 259/350: New method: ebdb-db-load-records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b37356a 270/350: Fix docstring of ebdb-create-record, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5135645 260/350: Split out ebdb-notice-record and ebdb-notice-field methods, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 71a93f5 268/350: Put a load protection in ebdb-mua-update-records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb cacb97b 271/350: Fix bug in MUA record creation, Eric Abrahamsen, 2017/08/14