@@ -70,6 +70,8 @@ You can create in https://qiita.com/settings/applications"
70
70
:type 'integer
71
71
:group 'helm-qiita )
72
72
73
+ ; ;; Internal Variables
74
+
73
75
(defvar helm-qiita-url nil
74
76
" Cache a result of `helm-qiita-get-url' .
75
77
DO NOT SET VALUE MANUALLY." )
@@ -93,6 +95,8 @@ DO NOT SET VALUE MANUALLY.")
93
95
(defvar helm-qiita-debug-mode nil )
94
96
(defvar helm-qiita-debug-start-time nil )
95
97
98
+ ; ;; Helm source
99
+
96
100
(defun helm-qiita-load ()
97
101
" Load `helm-qiita-file' ."
98
102
(with-current-buffer (helm-candidate-buffer 'global )
@@ -134,21 +138,7 @@ Argument CANDIDATE a line string of a stock."
134
138
(helm :sources helm-qiita-source
135
139
:prompt " Find Qiita Stocks: " )))
136
140
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
152
142
153
143
(defun helm-qiita-http-request (&optional url )
154
144
" Make a new HTTP request for create `helm-qiita-file' .
@@ -259,6 +249,8 @@ If next-link is exist, continue to request it."
259
249
(cl-pushnew (cdr (assoc 'name (aref tags i))) result :test #'equal ))
260
250
(reverse result)))
261
251
252
+ ; ;; Debug
253
+
262
254
(defun helm-qiita-http-debug-start ()
263
255
" Start debug mode."
264
256
(setq helm-qiita-debug-start-time (current-time )))
@@ -276,6 +268,8 @@ PROCESS is a http-request process."
276
268
helm-qiita-debug-start-time))
277
269
(format-time-string " %Y-%m-%d %H:%M:%S" (current-time ))))))
278
270
271
+ ; ;; Timer
272
+
279
273
(defun helm-qiita-set-timer ()
280
274
" Set timer."
281
275
(setq helm-qiita-timer
@@ -300,5 +294,22 @@ PROCESS is a http-request process."
300
294
(helm-qiita-find-curl-program))
301
295
(helm-qiita-set-timer))
302
296
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
+
303
313
(provide 'helm-qiita )
314
+
304
315
; ;; helm-qiita.el ends here
0 commit comments