diff options
| author | Ingo Lohmar <i.lohmar@gmail.com> | 2016-09-14 21:29:37 +0200 |
|---|---|---|
| committer | Ingo Lohmar <i.lohmar@gmail.com> | 2017-02-10 20:33:50 +0100 |
| commit | 2f00e0a6ab233a894c2da2a8786b311acc5f2aae (patch) | |
| tree | 9f67fbd23b866fd60a0ae00d4704fbd5e6ade17f | |
| parent | 36d9692da9172c3ad1e1a46d66ffa9346a44b212 (diff) | |
Avoid write-file side-effects, fixed encoding
| -rw-r--r-- | company-statistics.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/company-statistics.el b/company-statistics.el index 668f88c..a7dd961 100644 --- a/company-statistics.el +++ b/company-statistics.el @@ -141,15 +141,18 @@ number)." (defun company-statistics--save () "Save statistics." (with-temp-buffer + (set-buffer-multibyte nil) (let (print-level print-length) - (insert + (encode-coding-string (format "%S" `(setq company-statistics--scores ,company-statistics--scores company-statistics--log ,company-statistics--log - company-statistics--index ,company-statistics--index)))) - (write-file company-statistics-file))) + company-statistics--index ,company-statistics--index)) + 'utf-8 nil (current-buffer)) + (let ((coding-system-for-write 'binary)) + (write-region nil nil company-statistics-file))))) (defun company-statistics--maybe-save () (when (and (company-statistics--initialized-p) |
