Skip to content

Commit

Permalink
Get rid of passing argument savep around
Browse files Browse the repository at this point in the history
  • Loading branch information
Gábor Török committed Dec 21, 2013
1 parent ffed76f commit 327be17
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wakatime-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ Set SAVEP to non-nil for write action."
wakatime-user-agent
wakatime-api-key))

(defun wakatime-call (savep)
"Call WakaTime service. Set SAVEP to non-nil for write action."
(defun wakatime-call (command)
"Call WakaTime COMMAND."
(if (or (not wakatime-api-key) (string= "" wakatime-api-key))
(let ((api-key (read-string "API key: ")))
(setq wakatime-api-key api-key)))
(if (or (not wakatime-cli-path)
(not (file-exists-p wakatime-cli-path)))
(error "CLI script is not found!"))
(start-process-shell-command "wakatime" "*WakaTime messages*" (wakatime-client-command savep)))
(start-process-shell-command "wakatime" "*WakaTime messages*" command))

(defun wakatime-ping ()
"Send ping notice to WakaTime."
(wakatime-call nil))
(wakatime-call (wakatime-client-command nil)))

(defun wakatime-save ()
"Send save notice to WakaTime."
(wakatime-call t))
(wakatime-call (wakatime-client-command t)))

(defun wakatime-turn-on ()
"Turn on WakaTime."
Expand Down

0 comments on commit 327be17

Please sign in to comment.