help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: multi-char key


From: Elena
Subject: Re: multi-char key
Date: Wed, 08 Dec 2010 15:36:33 -0000
User-agent: G2/1.0

On 17 Nov, 10:12, Andrea Crotti <andrea.crott...@gmail.com> wrote:
> I have a small problem with semantic and completion.
> In C++ it's very nice to have completion after
> "::"
> So I did this
>
>   (defun my-cpp-cedet-hook ()
>     (local-set-key ":" 'semantic-complete-self-insert))
>
> and it sort of works, the problem is that it starts to look for also
> after the first ":", becoming quite slower.
> It should be instead be smart enough to look for only after two ":", is
> that somehow possible??

(defun my-cpp-smart-colon ()
  (interactive)
  (call-interactively (if (eql (char-before) ?:)
                          #'semantic-complete-self-insert
                        #'self-insert-command)))

(local-set-key (kbd ":") #'my-cpp-smart-colon)



reply via email to

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