Skip to content

Commit eed1630

Browse files
committed
Add descriptions
1 parent 4ddd403 commit eed1630

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Also supports [Qiita:Team](https://teams.qiita.com/).
1515
## Requirements
1616

1717
* Emacs 24.5 or higher
18-
* helm 1.9.0 or higher
18+
* helm 1.9.5 or higher
1919
* curl
2020

2121
## Installation

helm-qiita.el

+26-15
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ You can create in https://qiita.com/settings/applications"
7070
:type 'integer
7171
:group 'helm-qiita)
7272

73+
;;; Internal Variables
74+
7375
(defvar helm-qiita-url nil
7476
"Cache a result of `helm-qiita-get-url'.
7577
DO NOT SET VALUE MANUALLY.")
@@ -93,6 +95,8 @@ DO NOT SET VALUE MANUALLY.")
9395
(defvar helm-qiita-debug-mode nil)
9496
(defvar helm-qiita-debug-start-time nil)
9597

98+
;;; Helm source
99+
96100
(defun helm-qiita-load ()
97101
"Load `helm-qiita-file'."
98102
(with-current-buffer (helm-candidate-buffer 'global)
@@ -134,21 +138,7 @@ Argument CANDIDATE a line string of a stock."
134138
(helm :sources helm-qiita-source
135139
:prompt "Find Qiita Stocks: ")))
136140

137-
(defun helm-qiita-find-curl-program ()
138-
"Return an appropriate `curl' program pathname or error if not found."
139-
(or
140-
(executable-find "curl")
141-
(error "Cannot find `curl' helm-qiita.el requires")))
142-
143-
(defun helm-qiita-get-url ()
144-
"Return Qiita URL or error if `helm-qiita-username' is nil."
145-
(unless helm-qiita-username
146-
(error "Variable `helm-qiita-username' is nil"))
147-
(format "https://%s/api/v2/users/%s/stocks?page=1&per_page=20"
148-
(if (stringp helm-qiita-organization)
149-
(concat helm-qiita-organization ".qiita.com")
150-
"qiita.com")
151-
helm-qiita-username))
141+
;;; Process handler
152142

153143
(defun helm-qiita-http-request (&optional url)
154144
"Make a new HTTP request for create `helm-qiita-file'.
@@ -259,6 +249,8 @@ If next-link is exist, continue to request it."
259249
(cl-pushnew (cdr (assoc 'name (aref tags i))) result :test #'equal))
260250
(reverse result)))
261251

252+
;;; Debug
253+
262254
(defun helm-qiita-http-debug-start ()
263255
"Start debug mode."
264256
(setq helm-qiita-debug-start-time (current-time)))
@@ -276,6 +268,8 @@ PROCESS is a http-request process."
276268
helm-qiita-debug-start-time))
277269
(format-time-string "%Y-%m-%d %H:%M:%S" (current-time))))))
278270

271+
;;; Timer
272+
279273
(defun helm-qiita-set-timer ()
280274
"Set timer."
281275
(setq helm-qiita-timer
@@ -300,5 +294,22 @@ PROCESS is a http-request process."
300294
(helm-qiita-find-curl-program))
301295
(helm-qiita-set-timer))
302296

297+
(defun helm-qiita-get-url ()
298+
"Return Qiita URL or error if `helm-qiita-username' is nil."
299+
(unless helm-qiita-username
300+
(error "Variable `helm-qiita-username' is nil"))
301+
(format "https://%s/api/v2/users/%s/stocks?page=1&per_page=20"
302+
(if (stringp helm-qiita-organization)
303+
(concat helm-qiita-organization ".qiita.com")
304+
"qiita.com")
305+
helm-qiita-username))
306+
307+
(defun helm-qiita-find-curl-program ()
308+
"Return an appropriate `curl' program pathname or error if not found."
309+
(or
310+
(executable-find "curl")
311+
(error "Cannot find `curl' helm-qiita.el requires")))
312+
303313
(provide 'helm-qiita)
314+
304315
;;; helm-qiita.el ends here

0 commit comments

Comments
 (0)