[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 9ce8e30 310/350: Check db editable before reading
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 9ce8e30 310/350: Check db editable before reading new record |
Date: |
Mon, 14 Aug 2017 11:47:01 -0400 (EDT) |
branch: externals/ebdb
commit 9ce8e30784aca2f02dad9af300a1b1fe5a3f3a98
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Check db editable before reading new record
* ebdb-com.el (ebdb-create-record): Move the ebdb-db-editable check
before record reading, don't make the user enter a whole record and
then find out afterwards it isn't going to work.
---
ebdb-com.el | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index f651368..da54005 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -1573,24 +1573,24 @@ in `ebdb-db-list', using its default record class. Use
(list (car ebdb-db-list)))
(unless record-class
(setq record-class (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 record)
- (run-hook-with-args 'ebdb-after-change-hook record)
- (ebdb-display-records (list record) ebdb-default-multiline-formatter t)
- (dolist (b (buffer-list))
- (with-current-buffer b
+ (condition-case nil
+ (let (record)
+ (ebdb-db-editable db nil t)
+ (setq record (ebdb-read record-class))
+ (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 record)
+ (run-hook-with-args 'ebdb-after-change-hook record)
+ (ebdb-display-records (list record) ebdb-default-multiline-formatter t)
+ (dolist (b (buffer-list))
+ (with-current-buffer b
(when (derived-mode-p 'ebdb-mode)
(set-buffer-modified-p t)))))
- (ebdb-readonly-db
- (message "%s is read-only" (ebdb-string db)))
- (ebdb-unsynced-db
- (message "%s is out of sync" (ebdb-string db))))))
+ (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 ()
- [elpa] externals/ebdb c11ef0e 334/350: Rename ebdb-message-header to ebdb-mua-message-header, (continued)
- [elpa] externals/ebdb c11ef0e 334/350: Rename ebdb-message-header to ebdb-mua-message-header, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7dd034d 349/350: Fix up record citation, bind a command in EBDB mode, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 615ed9a 326/350: Prefix arg to article snarfing only snarfs signature, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8776051 341/350: Changes to manual and README, reflecting EBDB's move to ELPA, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 80ce330 340/350: Remove libraries that will live in separate packages, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bc3c712 332/350: Move "Writing Internationalization Libraries" in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 3210ad7 338/350: Compiler-inspired fixes version 443992, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d7bc0c9 284/350: Drop the whole auto-notes thing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b25edb9 002/350: Squash "prep" branch, push to Github, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 4bdf47e 263/350: Get notice routine working, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 9ce8e30 310/350: Check db editable before reading new record,
Eric Abrahamsen <=
- [elpa] externals/ebdb a4d11f5 293/350: Modify ebdb-mua-yank-cc to yank from any EBDB buffer, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 7caa1b4 308/350: Fix bug in reading mail alias fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb f987d46 305/350: Fix buffer modification call, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb c890b24 296/350: Mention mail aliases in the manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb be9464d 319/350: When merging organization records, possibly merge role fields, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 969c44c 303/350: Small tweaks to README, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1df6476 322/350: Remove stray code, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 8455b47 329/350: Bug in 851c0f1, signature snarfing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5cfad1d 317/350: Don't need so much docstring on ebdb-mode, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb acaf3d0 350/350: Move the mail field sorting thing to a :before method, Eric Abrahamsen, 2017/08/14