diff options
| author | Ingo Lohmar <i.lohmar@gmail.com> | 2015-02-06 19:25:00 +0100 |
|---|---|---|
| committer | Ingo Lohmar <i.lohmar@gmail.com> | 2015-02-06 20:04:13 +0100 |
| commit | 916d3d844e0623de7322dd5cc22b77928f51dfa0 (patch) | |
| tree | dc67d962a4a5716e272094fd1347437fca2f866c | |
| parent | f8d15c7edb2a182f484c5e6eb86f322df473e763 (diff) | |
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.
| -rw-r--r-- | 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.lohmar@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 () |
