From 3716acbb5529092fe7697c18f3a02e3919b02bfb Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 28 Jan 2015 18:06:02 +0200 Subject: [PATCH] Enable company-search-map in company-search-mode body Fixes #289 --- company.el | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/company.el b/company.el index 4c7e16066..d620e38f0 100644 --- a/company.el +++ b/company.el @@ -5,7 +5,7 @@ ;; Author: Nikolaj Schumacher ;; Maintainer: Dmitry Gutov ;; 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")) @@ -1573,7 +1573,11 @@ from the rest of the back-ends in the group, if any, will be left at the end." (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") @@ -1615,12 +1619,7 @@ from the rest of the back-ends in the group, if any, will be left at the end." (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 () @@ -1731,10 +1730,10 @@ Don't start this directly, use `company-search-candidates' or (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 @@ -1762,8 +1761,7 @@ Regular characters are appended to the search string. 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))) -- 2.39.2