Skip to content

Commit 9f96612

Browse files
committed
Avoid error when helm-qiita-file is not found
1 parent bc8a0fb commit 9f96612

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

helm-qiita.el

+11-7
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ DO NOT SET VALUE MANUALLY.")
102102

103103
(defun helm-qiita-load ()
104104
"Load `helm-qiita-file'."
105-
(with-current-buffer (helm-candidate-buffer 'global)
106-
(let ((coding-system-for-read 'utf-8))
107-
(insert-file-contents helm-qiita-file))))
105+
(if (file-exists-p helm-qiita-file)
106+
(with-current-buffer (helm-candidate-buffer 'global)
107+
(let ((coding-system-for-read 'utf-8))
108+
(insert-file-contents helm-qiita-file)))
109+
(message "%s not found. Please wait up to %d minutes."
110+
helm-qiita-file (/ helm-qiita-interval 60))))
108111

109112
(defvar helm-qiita-action
110113
'(("Browse URL" . helm-qiita-browse-url)
@@ -136,10 +139,11 @@ Argument CANDIDATE a line string of a stock."
136139
"Search Qiita Stocks using `helm'."
137140
(interactive)
138141
(let ((helm-full-frame helm-qiita-full-frame))
139-
(unless (file-exists-p helm-qiita-file)
140-
(error (format "%s not found" helm-qiita-file)))
141-
(helm :sources helm-qiita-source
142-
:prompt "Find Qiita Stocks: ")))
142+
(if (file-exists-p helm-qiita-file)
143+
(helm :sources helm-qiita-source
144+
:prompt "Find Qiita Stocks: ")
145+
(message "%s not found. Please wait up to %d minutes."
146+
helm-qiita-file (/ helm-qiita-interval 60)))))
143147

144148
;;; Process handler
145149

0 commit comments

Comments
 (0)