emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb 429cdb0 183/350: Add safety check to ebdb-undispla


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 429cdb0 183/350: Add safety check to ebdb-undisplay-records
Date: Mon, 14 Aug 2017 11:46:31 -0400 (EDT)

branch: externals/ebdb
commit 429cdb0f281e4d52f3e854f216f54a6dd43e11f8
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Add safety check to ebdb-undisplay-records
    
    * ebdb-com.el (ebdb-undisplay-records): It's possible we could be
      passed a non-existent buffer.
---
 ebdb-com.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/ebdb-com.el b/ebdb-com.el
index b215967..438cede 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -720,13 +720,14 @@ name based on the current major mode."
 
 If BUFFER is nil, use the *EBDB* buffer associated with the
 current buffer."
-  (let ((buf (or buffer (ebdb-make-buffer-name))))
-    (with-current-buffer (get-buffer buf)
-      (when (eq major-mode 'ebdb-mode)
-       (let (buffer-read-only)
-         (erase-buffer))
-       (setq ebdb-records nil)
-       (set-buffer-modified-p nil)))))
+  (let ((buf (get-buffer (or buffer (ebdb-make-buffer-name)))))
+    (when buf
+      (with-current-buffer buf
+       (when (eq major-mode 'ebdb-mode)
+         (let (buffer-read-only)
+           (erase-buffer))
+         (setq ebdb-records nil)
+         (set-buffer-modified-p nil))))))
 
 (defun ebdb-redisplay-all-records (_ignore-auto _noconfirm)
   "Used as the value of `revert-buffer-function' in *EBDB* buffers."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]