[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 16cdf2c 028/350: Provide protection for relations
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 16cdf2c 028/350: Provide protection for relations to unloaded records |
Date: |
Mon, 14 Aug 2017 11:45:56 -0400 (EDT) |
branch: externals/ebdb
commit 16cdf2cc01ea0d0677333637dc3110fd7712bcf8
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Provide protection for relations to unloaded records
For role and relation fields, don't blow up if the target record is
not currently loaded.
* ebdb.el (ebdb-init): Use a "record not loaded" string for role
fields.
(ebdb-string): And display something similar for relation fields.
---
ebdb.el | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/ebdb.el b/ebdb.el
index eac7492..09af98f 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -924,6 +924,9 @@ process."
(when record
(let* ((org-uuid (slot-value role 'org-uuid))
(org (ebdb-gethash org-uuid 'uuid))
+ (org-string (if org
+ (ebdb-string (slot-value org 'name))
+ "record not loaded"))
;; TODO: Guard against org-entry not being found.
(org-entry (gethash org-uuid ebdb-org-hashtable))
(record-uuid (ebdb-record-uuid record))
@@ -1000,7 +1003,10 @@ process."
;; This is used in person records headers, so it just shows the
;; organization name. Perhaps this could have a multi-line option
;; later.
- (ebdb-string (ebdb-gethash (slot-value role 'org-uuid) 'uuid)))
+ (let ((org (ebdb-gethash (slot-value role 'org-uuid) 'uuid)))
+ (if org
+ (ebdb-string org)
+ "record not loaded")))
;;; Mail fields.
@@ -1506,7 +1512,10 @@ override parsing."
(cl-call-next-method class slots obj)))
(cl-defmethod ebdb-string ((rel ebdb-field-relation))
- (ebdb-string (ebdb-gethash (slot-value rel 'rel-uuid) 'uuid)))
+ (let ((rec (ebdb-gethash (slot-value rel 'rel-uuid) 'uuid)))
+ (if rec
+ (ebdb-string rec)
+ "record not loaded")))
;; Image field
- [elpa] externals/ebdb e760dad 006/350: Fix quoting bug in ebdb-fmt-record-header, (continued)
- [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
- [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 <=
- [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, 2017/08/14
- [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