[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 2f00e0a 3/5: Avoid write-file side-effects, fixed encoding
From: |
Ingo Lohmar |
Subject: |
[elpa] master 2f00e0a 3/5: Avoid write-file side-effects, fixed encoding |
Date: |
Thu, 23 Feb 2017 13:29:57 -0500 (EST) |
branch: master
commit 2f00e0a6ab233a894c2da2a8786b311acc5f2aae
Author: Ingo Lohmar <address@hidden>
Commit: Ingo Lohmar <address@hidden>
Avoid write-file side-effects, fixed encoding
---
company-statistics.el | 9 ++++++---
1 file 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)
- [elpa] master updated (9972760 -> 6540bb6), Ingo Lohmar, 2017/02/23
- [elpa] master f781d42 1/5: Fix byte-compile warnings about unused variable, Ingo Lohmar, 2017/02/23
- [elpa] master 2f00e0a 3/5: Avoid write-file side-effects, fixed encoding,
Ingo Lohmar <=
- [elpa] master 36d9692 2/5: Merge pull request #10 from syohex/unused-vars, Ingo Lohmar, 2017/02/23
- [elpa] master 6540bb6 5/5: Merge commit 'e62157d43b2c874d2edbd547c3bdfb05d0a7ae5c' from company-statistics, Ingo Lohmar, 2017/02/23
- [elpa] master e62157d 4/5: Bump version, Ingo Lohmar, 2017/02/23