[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 1bc78ab 133/350: Add helm-ebdb file
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 1bc78ab 133/350: Add helm-ebdb file |
Date: |
Mon, 14 Aug 2017 11:46:21 -0400 (EDT) |
branch: externals/ebdb
commit 1bc78ab4df569bb504617df9868bc80fd7c0fb35
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Add helm-ebdb file
This will eventually get broken off into its own package.
* helm-ebdb.el: New file, containing basic helm integration for EBDB.
Provide three actions for selected candidates: display, send mail,
and insert name/address pair.
---
helm-ebdb.el | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/helm-ebdb.el b/helm-ebdb.el
new file mode 100644
index 0000000..9d9acf8
--- /dev/null
+++ b/helm-ebdb.el
@@ -0,0 +1,69 @@
+;;; helm-ebdb.el --- Helm integration for EBDB -*- lexical-binding: t;
-*-
+
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+;; Author: Eric Abrahamsen <address@hidden>
+;; Keywords: mail, convenience
+
+;; 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:
+
+;; Helm integration for EBDB.
+
+;;; Code:
+
+(require 'ebdb)
+(require 'helm)
+
+(declare-function ebdb-display-records "ext:ebdb-com"
+ (records &optional fmt append select pop buf))
+
+(defun helm-ebdb-candidates ()
+ "Return a list of all records in the database."
+ (mapcar (lambda (rec)
+ (cons (ebdb-string rec) rec))
+ (ebdb-records)))
+
+(defun helm-ebdb-display-records (candidate)
+ "Display CANDIDATE or marked candidates."
+ (let ((recs (or (helm-marked-candidates) (list candidate))))
+ (ebdb-display-records recs nil nil t nil
+ (format "*%s*" ebdb-buffer-name))))
+
+(defun helm-ebdb-compose-mail (candidate)
+ "Compose mail to CANDIDATE or marked candidates."
+ (let ((recs (or (helm-marked-candidates) (list candidate))))
+ (ebdb-mail recs)))
+
+(defun helm-ebdb-cite-records (candidate)
+ "Insert Name <email> string for CANDIDATE or marked candidate."
+ (let ((recs (or (helm-marked-candidates) (list candidate))))
+ (ebdb-cite-records-mail recs)))
+
+(defvar helm-source-ebdb
+ '((name . "EBDB")
+ (candidates . helm-ebdb-candidates)
+ (action . (("Display" . helm-ebdb-display-records)
+ ("Send mail" . helm-ebdb-compose-mail)
+ ("Insert name and address" . helm-ebdb-cite-records)))))
+
+;;;###autoload
+(defun helm-ebdb ()
+ "Preconfigured `helm' for EBDB."
+ (interactive)
+ (helm-other-buffer 'helm-source-ebdb "*helm ebdb*"))
+
+(provide 'helm-ebdb)
+;;; helm-ebdb.el ends here
- [elpa] externals/ebdb 5613bc2 137/350: Fix bug in ebdb-record-field-slot-query, (continued)
- [elpa] externals/ebdb 5613bc2 137/350: Fix bug in ebdb-record-field-slot-query, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 86b386d 141/350: Compiler-inspired fixes, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 05f67d6 081/350: Fix merging procedure, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1ded570 086/350: Note new database-related commands in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ef673e2 094/350: Improve organization searching, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bc71bda 099/350: Many fixes to migration routine, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 548e05d 106/350: Tweaks to MUA interactive commands, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dd83c7e 115/350: Short-circuit ebdb-info, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a0eada8 128/350: Change some of the EBDB buffer formatting defaults, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 20906ae 131/350: ebdb-prompt-for-record should load if necessary, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1bc78ab 133/350: Add helm-ebdb file,
Eric Abrahamsen <=
- [elpa] externals/ebdb ed3e270 119/350: Reverse order of args in return value of ebdb-popup-window, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ed6e228 136/350: Make ebdb-annotate-message more class agnostic, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb aa2d973 147/350: Allow optional records argument to ebdb-initialize, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 42f6dce 130/350: Add "Hacking EBDB" section to manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5dda311 118/350: Force mode line update after renaming EBDB buffers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a94483d 122/350: Refinements to snarfing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d9b4865 146/350: More tweaks to snarfing process, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b635b4e 155/350: First stab at article snarfing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6c267e9 159/350: Fix pop-up mouse menus in EBDB buffers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 55b3f82 160/350: Fixup with fix popup menus, Eric Abrahamsen, 2017/08/14