[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb baa9636 005/350: Complement ebdb-create-record wit
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb baa9636 005/350: Complement ebdb-create-record with ebdb-create-record-extended |
Date: |
Mon, 14 Aug 2017 11:45:51 -0400 (EDT) |
branch: externals/ebdb
commit baa96366031eb5d09672cf77f0dd474f7b9dc6ca
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Complement ebdb-create-record with ebdb-create-record-extended
* ebdb-com.el (ebdb-create-record): No longer checks prefix arg to see
if we should do extended querying.
(ebdb-create-record-extended): This command does the querying, and
passes the args to above function.
Provide separate keybindings for the two commands. This is part of the
move to provide double versions of commands, "plain" and "extended",
bound to lower-case and upper-case versions of the same key.
---
ebdb-com.el | 62 +++++++++++++++++++++++++++++++------------------------------
1 file changed, 32 insertions(+), 30 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index fd43762..9620d73 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -281,7 +281,8 @@ With ARG a negative number do not append."
(define-key km "!" 'ebdb-search-invert)
(define-key km "a" 'ebdb-record-action)
(define-key km "A" 'ebdb-mail-aliases)
- (define-key km "c" 'ebdb-create)
+ (define-key km "c" 'ebdb-create-record)
+ (define-key km "C" 'ebdb-create-record-extended)
(define-key km "e" 'ebdb-edit-field)
(define-key km ";" 'ebdb-edit-foo)
(define-key km "n" 'ebdb-next-record)
@@ -1526,7 +1527,7 @@ actually-editable records."
(ebdb-next-field 1)))))
;;;###autoload
-(defun ebdb-create (arg &optional db record-class)
+(defun ebdb-create-record (db record-class)
"Create a new EBDB record.
With no prefix argument, assume that we're creating a record in
@@ -1535,34 +1536,35 @@ record class.
With a prefix arg, prompt for the database to use (assuming there
is more than one), and prompt for the record class to use."
- (interactive "P")
- (let* ((db
- (or db
- (if (or (= 1 (length ebdb-db-list))
- (null arg))
- (car ebdb-db-list)
- (ebdb-prompt-for-db))))
- (record-class
- (or record-class
- (if arg
- (eieio-read-subclass "Use which record class? " 'ebdb-record
nil t)
- (if db
- (slot-value db 'record-class)
- 'ebdb-record-person))))
- (record (ebdb-read record-class)))
- (condition-case nil
- (progn
- (ebdb-db-editable db nil t)
- (run-hook-with-args 'ebdb-create-hook record)
- (run-hook-with-args 'ebdb-change-hook record)
- (ebdb-db-add-record db record)
- (ebdb-init record)
- (run-hook-with-args 'ebdb-after-change-hook record)
- (ebdb-display-records (list record)))
- (ebdb-readonly-db
- (message "%s is read-only" (ebdb-string db)))
- (ebdb-unsynced-db
- (message "%s is out of sync" (ebdb-string db))))))
+ (interactive
+ (list (car ebdb-db-list)
+ (slot-value db 'record-class)))
+ (let ((record (ebdb-read record-class)))
+ (condition-case nil
+ (progn
+ (ebdb-db-editable db nil t)
+ (run-hook-with-args 'ebdb-create-hook record)
+ (run-hook-with-args 'ebdb-change-hook record)
+ (ebdb-db-add-record db record)
+ (ebdb-init record)
+ (run-hook-with-args 'ebdb-after-change-hook record)
+ (ebdb-display-records (list record)))
+ (ebdb-readonly-db
+ (message "%s is read-only" (ebdb-string db)))
+ (ebdb-unsynced-db
+ (message "%s is out of sync" (ebdb-string db))))))
+
+;;;###autoload
+(defun ebdb-create-record-extended ()
+ (interactive)
+ (let ((db
+ (if (or (= 1 (length ebdb-db-list))
+ (null arg))
+ (car ebdb-db-list)
+ (ebdb-prompt-for-db)))
+ (record-class
+ (eieio-read-subclass "Use which record class? " 'ebdb-record nil t)))
+ (ebdb-create-record db record-class)))
;;;###autoload
(defun ebdb-insert-field (records)
- [elpa] branch externals/ebdb created (now acaf3d0), Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6aa15d2 003/350: Change interactive defs for move/copy-records, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6c79908 001/350: Test, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 849159d 008/350: Add ebdb-search-database, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 406b700 011/350: Change keybindings of record/field copy commands, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb baa9636 005/350: Complement ebdb-create-record with ebdb-create-record-extended,
Eric Abrahamsen <=
- [elpa] externals/ebdb 7b8b00f 013/350: Remap binding of ebdb in *EBDB* buffers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4ded2cb 007/350: Be more careful about text props in record headers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb e760dad 006/350: Fix quoting bug in ebdb-fmt-record-header, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb e0b4d17 016/350: Provide keybindings for clone-buffer and rename-buffer, Eric Abrahamsen, 2017/08/14
- [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