[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb b0778d6 033/350: Make ebdb-display-records non-int
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb b0778d6 033/350: Make ebdb-display-records non-interactive |
Date: |
Mon, 14 Aug 2017 11:45:57 -0400 (EDT) |
branch: externals/ebdb
commit b0778d6e1a4b6aa58e36d0ca8a00bb7bf5f0fbc0
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Make ebdb-display-records non-interactive
* ebdb-com.el (ebdb-display-records): It's cleaner as a plain
function. Ensure that the "fmt" argument is present.
(ebdb-display-one-record): Replace its previous interactive use with
a dedicated function, that prompts for and displays a single record.
(ebdb-mode-map): Change mode map and menu accordingly.
---
ebdb-com.el | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 82599a8..599d8f3 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -324,7 +324,7 @@ With ARG a negative number do not append."
(define-key km (kbd "b r") 'ebdb-rename-buffer)
;; Search keys
(define-key km (kbd "/ /") 'ebdb)
- (define-key km (kbd "/ 1") 'ebdb-display-records)
+ (define-key km (kbd "/ 1") 'ebdb-display-one-record)
(define-key km (kbd "/ n") 'ebdb-search-name)
(define-key km (kbd "/ o") 'ebdb-search-organization)
(define-key km (kbd "/ p") 'ebdb-search-phone)
@@ -674,14 +674,16 @@ SELECT and HORIZ-P have the same meaning as in
`ebdb-pop-up-window'. BUF indicates which *EBDB* buffer to use,
or nil to generate a buffer name based on the current major
mode."
- (interactive (list (ebdb-completing-read-records "Display records: ")
- (ebdb-formatter-prefix)))
(if (ebdb-append-display-p) (setq append t))
;; `ebdb-redisplay-record' calls `ebdb-display-records'
;; with display information already amended to RECORDS.
(unless (or (null records)
(consp (car records)))
- ;; add fmt and a marker to the local list of records
+ ;; All functions that call `ebdb-display-records' set the "fmt"
+ ;; argument, but that's not guaranteed.
+ (unless fmt
+ (setq fmt ebdb-default-multiline-formatter))
+ ;; Add fmt and a marker to the local list of records.
(setq records (mapcar (lambda (record)
(list record fmt (make-marker) nil))
records)))
@@ -841,7 +843,7 @@ If DELETE-P is non-nil RECORD is removed from the EBDB
buffers."
["Show all fields" ebdb-display-records-completely t])
("Searching"
["General search" ebdb t]
- ["Search one record" ebdb-display-records t]
+ ["Search one record" ebdb-display-one-record t]
["Search name" ebdb-search-name t]
["Search organization" ebdb-search-organization t]
["Search phone" ebdb-search-phone t]
@@ -2023,6 +2025,13 @@ The search results are displayed in the EBDB buffer."
(ebdb-formatter-prefix)))
(ebdb-display-records (slot-value db 'records) fmt))
+;;;###autoload
+(defun ebdb-display-one-record (record &optional fmt)
+ "Prompt for a single record, and display it."
+ (interactive (list (ebdb-completing-read-records "Display records: ")
+ (ebdb-formatter-prefix)))
+ (ebdb-display-records record fmt))
+
(defun ebdb-search-prog (function &optional fmt)
"Search records using FUNCTION.
FUNCTION is called with one argument, the record, and should return
- [elpa] externals/ebdb 696d6ba 018/350: Document buffer manipulation commands in the manual, (continued)
- [elpa] externals/ebdb 696d6ba 018/350: Document buffer manipulation commands in the manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4633492 023/350: Improve ebdb-field-user docstring, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ece1a35 017/350: Stray "arg" arg left in create-record-extended, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c4ea244 021/350: Add new ebdb-field-id field, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5fe2bf6 020/350: Add ebdb-field-obfuscated abstract field class, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4b8ce76 024/350: Move point to next record when adding a mark, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 20f1ea2 025/350: Add command to unmark all records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9a2fd46 022/350: Merge branch 'master' into buff, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 16cdf2c 028/350: Provide protection for relations to unloaded records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 50f39b6 031/350: Forgot about rmail, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b0778d6 033/350: Make ebdb-display-records non-interactive,
Eric Abrahamsen <=
- [elpa] externals/ebdb 1ee7829 012/350: Don't auto-save unsynced databases, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ac0b822 010/350: Switch to using kbd macro in keymap def, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9edb0c0 015/350: Sort out catch-all version of ebdb-make-buffer-name, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 74ed051 009/350: Better customization setup for record fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c803f1c 004/350: Forgot extra argument to ebdb-delete-i18n, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 22734d1 019/350: Select newly-cloned buffers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 94c7c6b 039/350: Provide ebdb-load guards in a few more places, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 015bd25 038/350: New search command ebdb-search-record-class, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f288cba 034/350: Use "d" prefix for record/database move commands, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7721bf3 044/350: Mess with autoloads, Eric Abrahamsen, 2017/08/14