[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a850cdb 51/66: Privatize some search functions (and a var)
From: |
Dmitry Gutov |
Subject: |
[elpa] master a850cdb 51/66: Privatize some search functions (and a var) |
Date: |
Tue, 13 Jan 2015 02:45:03 +0000 |
branch: master
commit a850cdbcf99207acb1df0c91effd9ae17bbe4f16
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Privatize some search functions (and a var)
---
company.el | 56 ++++++++++++++++++++++++++++----------------------------
1 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/company.el b/company.el
index d0f8b7d..3e3047c 100644
--- a/company.el
+++ b/company.el
@@ -1571,9 +1571,9 @@ from the rest of the back-ends in the group, if any, will
be left at the end."
(defvar-local company-search-lighter " Search: \"\"")
-(defvar-local company-search-old-selection 0)
+(defvar-local company--search-old-selection 0)
-(defun company-search (text lines)
+(defun company--search (text lines)
(let ((quoted (regexp-quote text))
(i 0))
(cl-dolist (line lines)
@@ -1589,30 +1589,30 @@ from the rest of the back-ends in the group, if any,
will be left at the end."
(defun company-search-printing-char ()
(interactive)
- (company-search-assert-enabled)
- (company-search--update-string (concat company-search-string
+ (company--search-assert-enabled)
+ (company--search-update-string (concat company-search-string
(string last-command-event))))
-(defun company-search--update-string (new)
- (let* ((pos (company-search new (nthcdr company-selection
company-candidates))))
+(defun company--search-update-string (new)
+ (let* ((pos (company--search new (nthcdr company-selection
company-candidates))))
(if (null pos)
(ding)
(setq company-search-string new
company-search-lighter (concat " Search: \"" new "\""))
(company-set-selection (+ company-selection pos) t))))
-(defun company-search--assert-input ()
- (company-search-assert-enabled)
+(defun company--search-assert-input ()
+ (company--search-assert-enabled)
(unless (cl-plusp (length company-search-string))
(error "Empty search string")))
(defun company-search-repeat-forward ()
"Repeat the incremental search in completion candidates forward."
(interactive)
- (company-search--assert-input)
- (let ((pos (company-search company-search-string
- (cdr (nthcdr company-selection
- company-candidates)))))
+ (company--search-assert-input)
+ (let ((pos (company--search company-search-string
+ (cdr (nthcdr company-selection
+ company-candidates)))))
(if (null pos)
(ding)
(company-set-selection (+ company-selection pos 1) t))))
@@ -1620,16 +1620,16 @@ from the rest of the back-ends in the group, if any,
will be left at the end."
(defun company-search-repeat-backward ()
"Repeat the incremental search in completion candidates backwards."
(interactive)
- (company-search--assert-input)
- (let ((pos (company-search company-search-string
- (nthcdr (- company-candidates-length
- company-selection)
- (reverse company-candidates)))))
+ (company--search-assert-input)
+ (let ((pos (company--search company-search-string
+ (nthcdr (- company-candidates-length
+ company-selection)
+ (reverse company-candidates)))))
(if (null pos)
(ding)
(company-set-selection (- company-selection pos 1) t))))
-(defun company-create-match-predicate ()
+(defun company--search-create-predicate ()
(let ((ss company-search-string))
(setq company-candidates-predicate
(when ss (lambda (candidate) (string-match ss candidate)))))
@@ -1640,7 +1640,7 @@ from the rest of the back-ends in the group, if any, will
be left at the end."
(defun company-filter-printing-char ()
(interactive)
- (company-search-assert-enabled)
+ (company--search-assert-enabled)
(company-search-printing-char)
(company-create-match-predicate)
(company-call-frontends 'update))
@@ -1648,7 +1648,7 @@ from the rest of the back-ends in the group, if any, will
be left at the end."
(defun company-search-kill-others ()
"Limit the completion candidates to the ones matching the search string."
(interactive)
- (company-search-assert-enabled)
+ (company--search-assert-enabled)
(company-create-match-predicate)
(company-search-mode 0)
(company-call-frontends 'update))
@@ -1656,21 +1656,21 @@ from the rest of the back-ends in the group, if any,
will be left at the end."
(defun company-search-abort ()
"Abort searching the completion candidates."
(interactive)
- (company-search-assert-enabled)
- (company-set-selection company-search-old-selection t)
+ (company--search-assert-enabled)
+ (company-set-selection company--search-old-selection t)
(company-search-mode 0))
(defun company-search-other-char ()
(interactive)
- (company-search-assert-enabled)
+ (company--search-assert-enabled)
(company-search-mode 0)
(company--unread-last-input))
(defun company-search-delete-char ()
(interactive)
- (company-search-assert-enabled)
+ (company--search-assert-enabled)
(when (cl-plusp (length company-search-string))
- (company-search--update-string (substring company-search-string 0 -1))))
+ (company--search-update-string (substring company-search-string 0 -1))))
(defvar company-search-map
(let ((i 0)
@@ -1717,15 +1717,15 @@ Don't start this directly, use
`company-search-candidates' or
(if company-search-mode
(if (company-manual-begin)
(progn
- (setq company-search-old-selection company-selection)
+ (setq company--search-old-selection company-selection)
(company-call-frontends 'update))
(setq company-search-mode nil))
(kill-local-variable 'company-search-string)
(kill-local-variable 'company-search-lighter)
- (kill-local-variable 'company-search-old-selection)
+ (kill-local-variable 'company--search-old-selection)
(company-enable-overriding-keymap company-active-map)))
-(defun company-search-assert-enabled ()
+(defun company--search-assert-enabled ()
(company-assert-enabled)
(unless company-search-mode
(company-uninstall-map)
- [elpa] master ccecb37 32/66: Merge pull request #252 from markus1189/bbdb-customize-group, (continued)
- [elpa] master ccecb37 32/66: Merge pull request #252 from markus1189/bbdb-customize-group, Dmitry Gutov, 2015/01/12
- [elpa] master 6ff5ed3 40/66: Clear out unused variable warnings, Dmitry Gutov, 2015/01/12
- [elpa] master 8b587c0 43/66: Add .elpaignore, Dmitry Gutov, 2015/01/12
- [elpa] master eef07a5 44/66: Support template functions in company-clang annotations, Dmitry Gutov, 2015/01/12
- [elpa] master 80620a1 45/66: Remove ineffective change from c6e9fbad312fc62876d40032a84a94439a055d05, Dmitry Gutov, 2015/01/12
- [elpa] master 829b40f 46/66: company--continue-failed: Don't burp on `stop', Dmitry Gutov, 2015/01/12
- [elpa] master 0a172c5 47/66: company-search-map: Support keypad numbers, Dmitry Gutov, 2015/01/12
- [elpa] master ff9bafc 41/66: Don't idle-begin when company-candidates is non-nil, Dmitry Gutov, 2015/01/12
- [elpa] master 9335f7b 48/66: company-search-delete-char: New command, Dmitry Gutov, 2015/01/12
- [elpa] master 048a9c4 50/66: company-search-old-map: Remove, unused, Dmitry Gutov, 2015/01/12
- [elpa] master a850cdb 51/66: Privatize some search functions (and a var),
Dmitry Gutov <=
- [elpa] master 7b312dd 52/66: Introduce `company-search-toggle-filtering', Dmitry Gutov, 2015/01/12
- [elpa] master 0d2757c 56/66: company-search-map: Add M-n and M-p bindings, Dmitry Gutov, 2015/01/12
- [elpa] master f5942e9 55/66: company-fill-propertize: Don't highlight match beg till common part, Dmitry Gutov, 2015/01/12
- [elpa] master aa7c1ca 57/66: Simplify NEWS entry, Dmitry Gutov, 2015/01/12
- [elpa] master eb1f0db 58/66: Fixup a test, Dmitry Gutov, 2015/01/12
- [elpa] master 9c99c7c 60/66: company-search-abort: Move predicate reset to the mode function, Dmitry Gutov, 2015/01/12
- [elpa] master 31d352f 53/66: Update NEWS.md, Dmitry Gutov, 2015/01/12
- [elpa] master 559b4f2 49/66: Don't repeat search with empty string, Dmitry Gutov, 2015/01/12
- [elpa] master 388545b 54/66: Add company-complete-common-or-cycle, Dmitry Gutov, 2015/01/12
- [elpa] master 160ab01 63/66: Split company--process-candidates into -pre and -post, Dmitry Gutov, 2015/01/12