unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Semantic & Autocomplete Usage
@ 2009-01-27  8:44 Les Harris
  2009-01-27 13:22 ` Shelagh Manton
  0 siblings, 1 reply; 4+ messages in thread
From: Les Harris @ 2009-01-27  8:44 UTC (permalink / raw)
  To: help-gnu-emacs


Does anyone have any experience using AutoComplete.el
(http://www.emacswiki.org/emacs/AutoComplete) with semantic
as a source?

I am also using Auto-Complete-Extension.el 
(http://www.emacswiki.org/cgi-bin/emacs/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)

<snip>

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

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:
pMyObject->
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.

Thanks!

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-27 14:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-27  8:44 Semantic & Autocomplete Usage Les Harris
2009-01-27 13:22 ` Shelagh Manton
2009-01-27 13:45   ` Shelagh Manton
     [not found]   ` <mailman.5954.1233063953.26697.help-gnu-emacs@gnu.org>
2009-01-27 14:05     ` Les Harris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).