From: Alan Mackenzie <acm@muc.de>
To: Richard Riley <rileyrgdev@googlemail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: emacs C++ auto code completion problem
Date: Tue, 26 May 2009 18:30:07 +0000 [thread overview]
Message-ID: <20090526183007.GC2919@muc.de> (raw)
In-Reply-To: <gvh3d9$nn6$1@news.eternal-september.org>
Hi, Richard!
On Tue, May 26, 2009 at 05:55:18PM +0200, Richard Riley wrote:
> GMS S <gmspro@yahoo.com> 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-<letter> 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).
next prev parent reply other threads:[~2009-05-26 18:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.7830.1243346544.31690.help-gnu-emacs@gnu.org>
2009-05-26 15:55 ` emacs C++ auto code completion problem Richard Riley
2009-05-26 18:30 ` Alan Mackenzie [this message]
[not found] ` <mailman.7843.1243362567.31690.help-gnu-emacs@gnu.org>
2009-05-27 2:18 ` Richard Riley
2009-05-25 17:08 GMS S
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090526183007.GC2919@muc.de \
--to=acm@muc.de \
--cc=help-gnu-emacs@gnu.org \
--cc=rileyrgdev@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.