Fix wakatime-api-key not persisting across sessions

Caused because customize'd variables aren't set until they're defined,
so we have to load wakatime-mode first.
This commit is contained in:
Henrik Lissner 2018-06-27 02:52:06 +02:00
parent 7408bd170d
commit f915f8c864
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -22,7 +22,6 @@ changes."
(unless api-key
(user-error "No api key was received."))
(require 'wakatime-mode)
(setq wakatime-api-key api-key)
(customize-set-variable 'wakatime-api-key api-key)
(customize-save-customized)
(unless (or (and wakatime-cli-path (file-executable-p wakatime-cli-path))
@ -37,7 +36,8 @@ changes."
"Initialize wakatime (if `wakatime-api-key' is set, otherwise no-op with a
warning)."
(interactive)
(if (not (bound-and-true-p wakatime-api-key))
(require 'wakatime-mode)
(if (not wakatime-api-key)
(message "wakatime-mode isn't set up. Run `M-x +wakatime/setup' to do so.")
(when +wakatime-home
(unless (file-directory-p +wakatime-home)