From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: emacs C++ auto code completion problem Date: Tue, 26 May 2009 18:30:07 +0000 Message-ID: <20090526183007.GC2919@muc.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1243362633 15404 80.91.229.12 (26 May 2009 18:30:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 May 2009 18:30:33 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Richard Riley Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 26 20:30:27 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M91Pt-0001Hj-BB for geh-help-gnu-emacs@m.gmane.org; Tue, 26 May 2009 20:30:25 +0200 Original-Received: from localhost ([127.0.0.1]:48750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M91Ps-0004hf-QP for geh-help-gnu-emacs@m.gmane.org; Tue, 26 May 2009 14:30:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M91Ot-0003wW-CL for help-gnu-emacs@gnu.org; Tue, 26 May 2009 14:29:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M91Oo-0003px-AQ for help-gnu-emacs@gnu.org; Tue, 26 May 2009 14:29:22 -0400 Original-Received: from [199.232.76.173] (port=58835 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M91Oo-0003pl-4w for help-gnu-emacs@gnu.org; Tue, 26 May 2009 14:29:18 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:2310 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M91On-000612-Gw for help-gnu-emacs@gnu.org; Tue, 26 May 2009 14:29:17 -0400 Original-Received: (qmail 15231 invoked by uid 3782); 26 May 2009 18:29:14 -0000 Original-Received: from acm.muc.de (pD9E500B3.dip.t-dialin.net [217.229.0.179]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 26 May 2009 20:29:12 +0200 Original-Received: (qmail 10465 invoked by uid 1000); 26 May 2009 18:30:07 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:64735 Archived-At: Hi, Richard! On Tue, May 26, 2009 at 05:55:18PM +0200, Richard Riley wrote: > GMS S writes: > Did you read > http://xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.html ? > Specifically > ,---- > | (defun my-c-mode-cedet-hook () > | (local-set-key "." 'semantic-complete-self-insert) > | (local-set-key ">" 'semantic-complete-self-insert)) <========= > | (add-hook 'c-mode-common-hook 'my-c-mode-cedet-hook) > `---- Please don't do this! In some CC Modes (C++ Mode, Java Mode, ...), ">" is bound to `c-electric-lt-gt', which deals with all sorts of nasty things that happen when ">" is a template bracket, or might be one. (Don't blame me for the stupidity/malice of the idiots who thought that the greater-than sign was so pretty it could be abused as a parenthesis, leading to syntactically unparseable code.) Please be careful when rebinding "ordinary" keys. Particularly in CC Mode, quite a lot of ordinary looking keys are actually "electric" keys. > I used company-mode as it has far better search and context help for > completion candidates. To use the semantic functions simply comment out > the "(company-mode 1") in the my-cedet-hook in the code below. > My own set up is here: > http://richardriley.net/projects/emacs/dotprogramming#sec-1.1 Hmm. You have an illicit '(local-set-key "\C-c\C-r" ...' in that file. C-c C- belongs to the major mode. You _probably_ meant to use C-c r. :-) > But borrowed heavily from Alex Ott's excellent article (I struggle > with the CEDET docs as they cover an awful lot of things I haven't a > clue about!). > Company mode: > http://nschum.de/src/emacs/company-mode/ -- Alan Mackenzie (Nuremberg, Germany).