[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 4f4596c 12/13: Re-absorb ebdb-counsel into main pa
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 4f4596c 12/13: Re-absorb ebdb-counsel into main package |
Date: |
Tue, 15 Jan 2019 11:15:52 -0500 (EST) |
branch: externals/ebdb
commit 4f4596c48a6c82eedc0e72ca795feddf1a2c9c5e
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Re-absorb ebdb-counsel into main package
* ebdb-counsel.el: Contains function ebdb-counsel. Preparatory to
deleting separate counsel-ebdb package.
---
ebdb-counsel.el | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/ebdb-counsel.el b/ebdb-counsel.el
new file mode 100644
index 0000000..8423dbe
--- /dev/null
+++ b/ebdb-counsel.el
@@ -0,0 +1,65 @@
+;;; ebdb-counsel.el --- Counsel integration for EBDB -*- lexical-binding: t;
-*-
+
+;; Copyright (C) 2019 Free Software Foundation, Inc.
+
+;; Author: Eric Abrahamsen <address@hidden>
+;; Maintainer: 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Counsel/ivy integration for EBDB.
+
+;;; Code:
+
+(require 'ebdb)
+
+(declare-function 'ivy-read "ext:ivy")
+
+;;;###autoload
+(defun ebdb-counsel ()
+ "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 'ebdb-counsel)
+;;; ebdb-counsel.el ends here
- [elpa] externals/ebdb 5ef1773 04/13: Allow overwriting of previous formatting buffers, (continued)
- [elpa] externals/ebdb 5ef1773 04/13: Allow overwriting of previous formatting buffers, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb eec63c8 07/13: Provide basic HTML5 freeform formatter, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 980927f 02/13: Switch from cond to pcase in ebdb-record-field, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 6dad4c1 09/13: Allow 'mail-primary as an argument to ebdb-record-field, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 4625970 11/13: Move map require from ebdb-com.el to ebdb.el, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 753c049 13/13: Bump to 0.6.3, flush recent changes, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 65247f6 08/13: Make csv-mode dependency optional, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb cbaa04b 10/13: Fix compose fields for the HTML5 freeform formatter, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb adb60dd 05/13: Refactor formatter classes, add tabular formatters, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 7a19553 06/13: Shift base ebdb-fmt-record implementation to ebdb-formatter-freeform, Eric Abrahamsen, 2019/01/15
- [elpa] externals/ebdb 4f4596c 12/13: Re-absorb ebdb-counsel into main package,
Eric Abrahamsen <=