;; Author: Nikolaj Schumacher
;; Maintainer: Dmitry Gutov <dgutov@yandex.ru>
;; URL: http://company-mode.github.io/
-;; Version: 0.8.9
+;; Version: 0.8.9-cvs
;; Keywords: abbrev, convenience, matching
;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
(defvar-local company-search-string "")
-(defvar-local company-search-lighter " Search: \"\"")
+(defvar company-search-lighter '(" "
+ (company-search-filtering "Filter" "Search")
+ ": \""
+ company-search-string
+ "\""))
(defvar-local company-search-filtering nil
"Non-nil to filter the completion candidates by the search string")
(let* ((pos (company--search new (nthcdr company-selection company-candidates))))
(if (null pos)
(ding)
- (setq company-search-string new
- company-search-lighter (format " %s: \"%s\""
- (if company-search-filtering
- "Filter"
- "Search")
- new))
+ (setq company-search-string new)
(company-set-selection (+ company-selection pos) t))))
(defun company--search-assert-input ()
(if (company-manual-begin)
(progn
(setq company--search-old-selection company-selection)
- (company-call-frontends 'update))
+ (company-call-frontends 'update)
+ (company-enable-overriding-keymap company-search-map))
(setq company-search-mode nil))
(kill-local-variable 'company-search-string)
- (kill-local-variable 'company-search-lighter)
(kill-local-variable 'company-search-filtering)
(kill-local-variable 'company--search-old-selection)
(when company-backend
The command `company-search-toggle-filtering' (\\[company-search-toggle-filtering])
uses the search string to filter the completion candidates."
(interactive)
- (company-search-mode 1)
- (company-enable-overriding-keymap company-search-map))
+ (company-search-mode 1))
(defvar company-filter-map
(let ((keymap (make-keymap)))