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

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

[elpa] master 5f9ee38 04/11: Check file can be read


From: Ingo Lohmar
Subject: [elpa] master 5f9ee38 04/11: Check file can be read
Date: Sun, 02 Aug 2015 14:43:03 +0000

branch: master
commit 5f9ee3897707acac78d2da59fb359d26e05ccc7b
Author: Ingo Lohmar <address@hidden>
Commit: Ingo Lohmar <address@hidden>

    Check file can be read
---
 wconf.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/wconf.el b/wconf.el
index 8b48d6d..7012285 100644
--- a/wconf.el
+++ b/wconf.el
@@ -176,8 +176,10 @@ position INDEX."
 (defun wc-load (&optional filename)
   "Load stored configurations from FILENAME, defaults to `wc-file'."
   (interactive)
-  (wc--reset)
   (let ((filename (or filename wc-file)))
+    (unless (file-readable-p filename)
+      (error "wc: Cannot read file %s" filename))
+    (wc--reset)
     (with-temp-buffer
       (insert-file-contents filename)
       (goto-char (point-min))



reply via email to

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