过滤自动完成下拉搜索结果

时间:2014-07-24 15:26:18

标签: emacs autocomplete elisp cedet

我已设置cedet + auto complete并获得推荐系统。但是,无论何时显示建议的下拉菜单,我都希望在输入字符时过滤结果。 这是截图: enter image description here

因此,当我输入pu时,我希望下拉菜单包含push_back之类的结果。我怎么做到的?

这是我的.emacs文件(相关部分):

;;; yasnippet
;;; should be loaded before auto complete so that they can work together
(require 'yasnippet)
(yas-global-mode 1)
(defun my:ac-c-header-init ()
  (require 'auto-complete-c-headers)
  (add-to-list 'ac-sources 'ac-source-c-headers)
  (add-to-list 'achead:include-directories '"/usr/include/c++/4.8"))

(add-hook 'c++-mode-hook 'my:ac-c-header-init) 
(add-hook 'c-mode-hook 'my:ac-c-header-init) 




(add-to-list 'load-path "~/.emacs.d/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(require 'auto-complete)
(ac-config-default)
(setq ac-auto-show-menu t)

(ac-flyspell-workaround)

;;cedet configuration
(semantic-mode 1)
(defun my:add-semantic-to-autocomplete ()
  (add-to-list 'ac-sources 'ac-source-semantic))
(add-hook 'c-mode-common-hook 'my:add-semantic-to-autocomplete)

(global-ede-mode 1)
(global-semantic-idle-scheduler-mode 1)
(add-hook 'c-mode-hook 'my:add-semantic-to-autocomplete)
(add-hook 'c++-mode-hook 'my:add-semantic-to-autocomplete)


;; (defun my-semantic-hook ()
;;   (imenu-add-to-menubar "TAGS"))
;; (add-hook 'semantic-init-hooks 'my-semantic-hook)
;(require 'semantic/ia)
;(require 'semantic/bovine/gcc)
(defun my-c-mode-cedet-hook ()
  (add-to-list 'ac-sources 'ac-source-gtags)
  (add-to-list 'ac-sources 'ac-source-semantic))
(add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook)
(add-hook 'c++-mode-common-hook 'my-c-mode-cedet-hook)


(semanticdb-enable-gnu-global-databases 'c-mode t)
(semanticdb-enable-gnu-global-databases 'c++-mode t)

1 个答案:

答案 0 :(得分:0)

我想你可以使用ac-isearch

}时,您可以在填充完成工具提示后通过C-s调用它。

  1. 弹出式完成工具提示(M-x auto-complete或自动启动)
  2. 调用ac-isearchC-s
  3. 过滤完成次数