[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 6aa15d2 003/350: Change interactive defs for move/
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 6aa15d2 003/350: Change interactive defs for move/copy-records |
Date: |
Mon, 14 Aug 2017 11:45:51 -0400 (EDT) |
branch: externals/ebdb
commit 6aa15d22ab3b094acf2c632b056e01f63a5161ff
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Change interactive defs for move/copy-records
* ebdb.el (ebdb-move-record, ebdb-copy-records): These should be
"internal", non-interactive functions.
* ebdb-com.el (ebdb-move-records, ebdb-copy-records): New *EBDB*
buffer commands that call the underlying functions.
---
ebdb-com.el | 14 ++++++++++++++
ebdb.el | 11 ++---------
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 0bcec03..fd43762 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -1716,6 +1716,20 @@ If prefix NOPROMPT is non-nil, do not confirm deletion."
(ebdb-redisplay-record-globally record nil t))))
;;;###autoload
+(defun ebdb-move-records (records db)
+ (interactive (list (ebdb-do-records)
+ (ebdb-prompt-for-db)))
+ (ebdb-with-record-edits (r records)
+ (ebdb-move-record r db)))
+
+;;;###autoload
+(defun ebdb-copy-records (records db)
+ (interactive (list (ebdb-do-records)
+ (ebdb-prompt-for-db)))
+ (ebdb-with-record-edits (r records)
+ (ebdb-copy-record r db)))
+
+;;;###autoload
(defun ebdb-display-all-records (&optional fmt)
"Show all records.
If invoked in a *EBDB* buffer point stays on the currently visible record.
diff --git a/ebdb.el b/ebdb.el
index ee6586b..615bd95 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -3048,23 +3048,16 @@ the persistent save, or allow them to propagate."
(defun ebdb-move-record (record to-db)
"Move RECORD from its existing database to TO-DB."
- (interactive
- (list (ebdb-current-record)
- (ebdb-prompt-for-db)))
;; It's not quite right to assume that we're *only* removing the
;; record from the first db in its list of dbs.
(let ((existing (car (slot-value (ebdb-record-cache record)
- 'database))))
- (if (equal existing to-db)
- (message "Can't move record into same database")
+ 'database))))
+ (unless (equal existing to-db)
(ebdb-db-add-record to-db record)
(ebdb-db-remove-record existing record))))
(defun ebdb-copy-record (record to-db)
"Copy RECORD into TO-DB."
- (interactive
- (list (ebdb-current-record)
- (ebdb-prompt-for-db)))
(ebdb-db-add-record to-db record))
;;; Utility functions
- [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 <=
- [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, 2017/08/14
- [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