Sto usando cedet con emacs. Ho provato ad usare la versione cedet in Debian ma ha alcuni bug quindi l'ho disinstallata e ho scaricato la versione cvs da http://sourceforge.net/projects/cedet/develop
L'ho compilato nella mia directory ~/tmp/emacs-stuff/e ho aggiunto le seguenti righe al mio file ~/.emacs.d/custom.el:
;;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)
questo file viene invocato il mio file ~/.emacs che la riga seguente in esso: (load-file "~ /.emacs.d/custom.el ")
Ora quando si digita una variabile e si preme CTRL + MAIUSC + INVIO, un menu di selezioni genera suggerimenti.
Inoltre, se è stata impostata la variabile semantica completa-inline-analizzatore-idle-displayor-class per quotare semantic-displayor-tooltip, verrà visualizzato anche un suggerimento con suggerimenti dopo alcuni minuti di inattività (1 o 2 secondi) .
Per qualche breve introduzione, vedi http://xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.html
Per docs CEDET, vedi: http://cedet.sourceforge.net/
Buona fortuna.
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 –