Not logged in
Log in now
Create an account
Subscribe to LWN
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
Please, do tell! I tried CEDET a few releases ago and gave up because I couldn't get autocomplete/SB to work properly. Is there a guide somewhere?
Emacs 24.1 released
Posted Jun 15, 2012 12:42 UTC (Fri) by nix (subscriber, #2304)
My entire autocompletion configuration (using auto-complete.el to provide completion with intellisense-style pull-down menus that vanish at convenient times: tweaked locally, may be full of horrible typos):
;; Turn on project management.
(setq ede-locate-setup-options '(ede-locate-global ede-locate-locate ede-locate-base))
;; Kick off the semantic bovinator, function menu, C-warning mode, and flashing
(setq semantic-default-submodes (append semantic-default-submodes
(setq semantic-decoration-styles '(("semantic-decoration-on-includes" . t)
;; auto-complete should use Semantic.
(defun nix-setup-auto-complete-semantic ()
"Arrange to do semantic autocompletion."
(add-to-list 'ac-sources 'ac-source-semantic))
(add-hook 'c-mode-common-hook 'nix-setup-auto-complete-semantic t)
;; Some key bindings
(define-key semantic-mode-map (kbd "C-c , .") 'semantic-ia-fast-jump)
(define-key semantic-mode-map (kbd "C-c , P") 'semantic-analyze-proto-impl-toggle)
(define-key semantic-mode-map (kbd "C-c , h") 'semantic-decoration-include-visit)
That's enough global setup for C and C++ code to work, and almost all of it is unnecessary -- the system will sort of work with nothing but (semantic-mode 1). But you want some local per-project setup too, so it knows where your headers are and what #defines to apply when parsing them and stuff like that. Projects using Autoconf and Automake, and a few major projects such as the Linux kernel, are automatically detected, but for others you might need something like this for each project:
(ede-cpp-root-project "Blah Project" :file "/home/nix/src/blah/Makerules"
:include-path '("/include" "/local/include")
:system-include-path '("/home/nix/src/otherproject/include" "/usr/include")
:spp-table '(("_GNU_SOURCE" . "") ("_FILE_OFFSET_BITS" . "64") ("WOMBLE" . "foo")))
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds