emacs c++ code completion help

Suvayu Ali fatkasuvayu+linux at gmail.com
Tue May 26 21:38:12 UTC 2009


Armin Moradi wrote:
> 
> Here we go, I got it working:
> Download these files:
> auto-complete.el
> auto-complete-cpp.el
> auto-complete-gtags.el
> auto-complete-semantic.el
> auto-complete-yasnippet.el
> 
> put them in a directory, let's say ~/.emacs.d/elisp/
> 
> then add this to your ~/.emacs file:
> 
> ====================
> (add-to-list 'load-path "~/.emacs.d/elisp")
> (require 'auto-complete)
> (global-auto-complete-mode)
> ====================
> 
> It worked for me, but let me know if it worked for you too!  (the
> auto-completion is really nice btw!)
> 

I couldn't get it to auto-complete C++ keywords _not_ present in the 
buffer. So I changed my auto-complete-cpp.el (attached below). I made 
some minor changes to an example code posted on the emacs wiki page to 
include auto-complete both from the current buffer and from a list of 
keywords defined in auto-complete-cpp.el.

Now my .emacs looks like this,

;; load path for elisp files
(add-to-list 'load-path "~/.emacs.d/elisp")

;; autocomplete extension
(require 'auto-complete)
(when (require 'auto-complete nil t)
   (require 'auto-complete-cpp)

   (global-auto-complete-mode))

-- 
Suvayu

Open source is the future. It sets us free.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: auto-complete-cpp.el
Type: text/x-emacs-lisp
Size: 2111 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090526/6ecdb2db/attachment-0001.bin>


More information about the fedora-list mailing list