[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5c3b6ae 5/7: Cleanup similar to ELPA version
From: |
Ingo Lohmar |
Subject: |
[elpa] master 5c3b6ae 5/7: Cleanup similar to ELPA version |
Date: |
Sun, 28 Jun 2015 16:03:00 +0000 |
branch: master
commit 5c3b6aec82dcf4a99ded551c0a6fedb3beb88983
Author: Ingo Lohmar <address@hidden>
Commit: Ingo Lohmar <address@hidden>
Cleanup similar to ELPA version
- use lexical binding, fix related bug in :initialize arg
- remove redundant :group args
- function quoting
- extend copyright year
Extends and fixes git.sv.gnu.org:/srv/git/emacs/elpa.git commit
'ecfeed14c1847fbd9f15dfd66b39c7b8260f005a'.
---
company-statistics-tests.el | 4 ++--
company-statistics.el | 31 ++++++++++++-------------------
2 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/company-statistics-tests.el b/company-statistics-tests.el
index fb04049..3fa336a 100644
--- a/company-statistics-tests.el
+++ b/company-statistics-tests.el
@@ -1,6 +1,6 @@
-;;; company-statistics-tests.el --- company-statistics tests
+;;; company-statistics-tests.el --- company-statistics tests -*-
lexical-binding: t -*-
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
;; Author: Ingo Lohmar
diff --git a/company-statistics.el b/company-statistics.el
index 27e83a4..ae0fb12 100644
--- a/company-statistics.el
+++ b/company-statistics.el
@@ -1,6 +1,6 @@
-;;; company-statistics.el --- Sort candidates using completion history
+;;; company-statistics.el --- Sort candidates using completion history -*-
lexical-binding: t -*-
-;; Copyright (C) 2014 Free Software Foundation, Inc.
+;; Copyright (C) 2014-2015 Free Software Foundation, Inc.
;; Author: Ingo Lohmar <address@hidden>
;; URL: https://github.com/company-mode/company-statistics
@@ -27,7 +27,7 @@
;;
;; Package installed from elpa.gnu.org:
;;
-;; (add-hook 'after-init-hook 'company-statistics-mode)
+;; (add-hook 'after-init-hook #'company-statistics-mode)
;;
;; Manually installed: make sure that this file is in load-path, and
;;
@@ -56,47 +56,40 @@
(defcustom company-statistics-size 400
"Number of completion choices that `company-statistics' keeps track of.
As this is a global cache, making it too small defeats the purpose."
- :group 'company-statistics
:type 'integer
- :initialize (lambda (option init-size) (setq company-statistics-size
init-size))
- :set 'company-statistics--log-resize)
+ :initialize #'custom-initialize-default
+ :set #'company-statistics--log-resize)
(defcustom company-statistics-file
(concat user-emacs-directory "company-statistics-cache.el")
"File to save company-statistics state."
- :group 'company-statistics
:type 'string)
(defcustom company-statistics-auto-save t
"Whether to save the statistics when leaving emacs."
- :group 'company-statistics
:type 'boolean)
(defcustom company-statistics-auto-restore t
"Whether to restore statistics when company-statistics is enabled and has
not been used before."
- :group 'company-statistics
:type 'boolean)
-(defcustom company-statistics-capture-context
'company-statistics-capture-context-heavy
+(defcustom company-statistics-capture-context
#'company-statistics-capture-context-heavy
"Function called with single argument (t if completion started manually).
This is the place to store any context information for a completion run."
- :group 'company-statistics
:type 'function)
-(defcustom company-statistics-score-change
'company-statistics-score-change-heavy
+(defcustom company-statistics-score-change
#'company-statistics-score-change-heavy
"Function called with completion choice. Using arbitrary other info,
it should produce an alist, each entry labeling a context and the
associated score update: ((ctx-a . 1) (\"str\" . 0.5) (nil . 1)). Nil is
the global context."
- :group 'company-statistics
:type 'function)
-(defcustom company-statistics-score-calc 'company-statistics-score-calc-heavy
+(defcustom company-statistics-score-calc #'company-statistics-score-calc-heavy
"Function called with completion candidate. Using arbitrary other info,
eg, on the current context, it should evaluate to the candidate's score (a
number)."
- :group 'company-statistics
:type 'function)
;; internal vars, persistence
@@ -113,7 +106,7 @@ number)."
(defun company-statistics--init ()
"Initialize company-statistics."
(setq company-statistics--scores
- (make-hash-table :test 'equal :size company-statistics-size))
+ (make-hash-table :test #'equal :size company-statistics-size))
(setq company-statistics--log (make-vector company-statistics-size nil)
company-statistics--index 0))
@@ -286,7 +279,7 @@ one. ALIST structure and cdrs may be changed!"
(company-statistics--alist-update
(gethash cand company-statistics--scores)
score-updates
- '+)
+ #'+)
company-statistics--scores))
(defun company-statistics--log-revert (&optional index)
@@ -302,8 +295,8 @@ one. ALIST structure and cdrs may be changed!"
(company-statistics--alist-update
(gethash cand company-statistics--scores)
score-updates
- '-
- 'zerop)))
+ #'-
+ #'zerop)))
(if new-scores ;sth left
(puthash cand new-scores company-statistics--scores)
(remhash cand company-statistics--scores))))))
- [elpa] master updated (f727b53 -> b727d25), Ingo Lohmar, 2015/06/28
- [elpa] master 2b5cc4d 1/7: fix typo, Ingo Lohmar, 2015/06/28
- [elpa] master 5873515 2/7: Merge pull request #6 from stardiviner/patch-2, Ingo Lohmar, 2015/06/28
- [elpa] master 68bb8c3 4/7: Update version, Ingo Lohmar, 2015/06/28
- [elpa] master 45bc13a 6/7: Bump version, Ingo Lohmar, 2015/06/28
- [elpa] master 5c3b6ae 5/7: Cleanup similar to ELPA version,
Ingo Lohmar <=
- [elpa] master c9874f0 3/7: Offer light and heavy context scoring, Ingo Lohmar, 2015/06/28
- [elpa] master b727d25 7/7: Merge commit '45bc13aec56fcd0b55686d2305cf6e6852d467e8' from company-statistics, Ingo Lohmar, 2015/06/28