Tôi đang sử dụng cedet với các emac. Tôi đã thử sử dụng phiên bản cedet trong Debian nhưng nó có một số lỗi nên tôi đã gỡ cài đặt và tải xuống phiên bản cvs từ http://sourceforge.net/projects/cedet/develop
Tôi biên dịch nó trong thư mục ~/tmp/emacs/stuff và sau đó thêm các dòng sau vào ~/.emacs.d/custom.el file:
;;needed if cedet is in a custom location
(load-file "~/tmp/emacs-stuff/cedet/common/cedet.el")
;; Enable EDE (Project Management) features
(global-ede-mode t)
;;to enable code folding
(global-semantic-tag-folding-mode)
;; Enabling Semantic (code parsing, smart completion) features
;; (select only one)
;;(semantic-load-enable-minimum-features)
;;(semantic-load-enable-code-helpers)
(semantic-load-enable-gaudy-code-helpers)
;;(semantic-load-enable-all-exuberent-ctags-support)
(global-semantic-idle-scheduler-mode 1) ;The idle scheduler with automatically reparse buffers in idle time.
(global-semantic-idle-completions-mode 1) ;Display a tooltip with a list of possible completions near the cursor.
(global-semantic-idle-summary-mode 1) ;Display a tag summary of the lexical token under the cursor.
;;to work with my include files and cedet
(semantic-add-system-include "~/include" 'c++-mode)
(semantic-add-system-include "~/include" 'c-mode)
;;To use additional features for names completion, and displaying of information for tags & classes,
;; you also need to load the semantic-ia package. This could be performed with following command:
(require 'semantic-ia)
;;to work with systme include files and gcc
(require 'semantic-gcc)
;;integrate semantic with Imenu
(defun my-semantic-hook()
(imenu-add-to-menubar "TAGS"))
(add-hook 'semantic-init-hooks 'my-semantic-hook)
;;load Semanticdb
(require 'semanticdb)
;;(global-semanticdb-minor-mode 1)
;;working with tags
;; gnu global support
(require 'semanticdb-global)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
;; ctags
(require 'semanticdb-ectag)
(semantic-load-enable-primary-exuberent-ctags-support)
(defun my-semantic-hook()
(imenu-add-to-menubar "TAGS"))
(add-hook 'semantic-init-hooks 'my-semantic-hook)
tập tin này được gọi bởi tập tin ~/emacs của tôi mà dòng sau trong đó: (tải tập tin "~ /.emacs.d/custom.el ")
Bây giờ khi bạn đang gõ một biến và nhấn CTRL + SHIFT + ENTER, một menu các lựa chọn sẽ đưa ra các gợi ý.
Hơn nữa, nếu bạn đã đặt biến ngữ nghĩa-đầy đủ-inline-analyzer-idle-displayor-class thành báo giá ngữ nghĩa-displayor-tooltip, chú giải công cụ với các đề xuất cũng sẽ xuất hiện sau một số thời gian rảnh (1 hoặc 2 giây) .
Đối với một số giới thiệu ngắn, xem http://xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.html
Đối với tài liệu Cedet, xem: http://cedet.sourceforge.net/
Chúc may mắn.
http://stackoverflow.com/questions/129257/eclipse-sytle-function-completions-in-emacs-for-cc-and-java, http://stackoverflow.com/questions/1285971/emacs-code -completion-for-cc –