branch: master commit 916d3d844e0623de7322dd5cc22b77928f51dfa0 Author: Ingo Lohmar <i.loh...@gmail.com> Commit: Ingo Lohmar <i.loh...@gmail.com>
Only save when variables have been initialized This should fix issues #3 and #4. When the library was loaded and emacs was quit without company-statistics ever being enabled, we still saved the uninitialized variables and loaded into an uninitialized state next time. --- company-statistics.el | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/company-statistics.el b/company-statistics.el index a3fef23..d0e96b0 100644 --- a/company-statistics.el +++ b/company-statistics.el @@ -4,7 +4,7 @@ ;; Author: Ingo Lohmar <i.loh...@gmail.com> ;; URL: https://github.com/company-mode/company-statistics -;; Version: 0.1 +;; Version: 0.1.1 ;; Keywords: abbrev, convenience, matching ;; Package-Requires: ((emacs "24.3") (company "0.8.5")) @@ -153,7 +153,8 @@ number)." (write-file company-statistics-file))) (defun company-statistics--maybe-save () - (when company-statistics-auto-save + (when (and (company-statistics--initialized-p) + company-statistics-auto-save) (company-statistics--save))) (defun company-statistics--load ()