[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Semantic & Autocomplete Usage

From: Les Harris
Subject: Semantic & Autocomplete Usage
Date: Tue, 27 Jan 2009 00:44:27 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Does anyone have any experience using AutoComplete.el
( with semantic
as a source?

I am also using Auto-Complete-Extension.el 
which provides among other things ac-source-semantic.

My configuration in .emacs:

(require 'auto-complete)
(require 'auto-complete-extension) ; Provides ac-source-semantic
(global-auto-complete-mode t)

(define-key ac-complete-mode-map "\C-\M-n" 'ac-next)
(define-key ac-complete-mode-map "\C-\M-p" 'ac-previous)
(define-key ac-complete-mode-map "\t" 'ac-expand)
(define-key ac-complete-mode-map "\r" 'ac-complete)


(add-hook 'c-mode-common-hook '(lambda ()
        (c-toggle-auto-state 1)
        (set (make-local-variable 'ac-sources) 
                                  (append '(ac-source-semantic)))
;       (set (make-local-variable 'ac-candidate-function) (append

It apparently does nothing :)  When I uncomment the
ac-candidate-function line I get a syntax error:

Error in post-command-hook: (wrong-number-of-arguments (lambda (prefix) 
(if (memq major-mode (quote (c-mode c++-mode jde-mode java-mode)))
(prog1 (mapcar (quote semantic-tag-name) (ignore-errors (or
 (semantic-ia-get-completions (semantic-analyze-current-context) 
(point)) (senator-find-tag-for-completion 
(regexp-quote prefix)))))))) 0)

Which is from auto-complete-extension.el. Doesn't inspire confidence.

If I try running something like semantic-analyze-possible-completions on
the following:
It will correctly list the members of that struct so I am confidant
semantic itself is working correctly.

So I'm stuck.  Anyone help at all would be very appreciated.


Do they only stand
By ignorance, is that their happy state,
The proof of their obedience and their faith?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]