From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Paulo J. Matos" Newsgroups: gmane.emacs.help Subject: Re: Adding Key bindings Date: Sat, 22 Jul 2006 02:36:06 +0100 Message-ID: <11b141710607211836q4e78cb75m38979633f6250dea@mail.gmail.com> References: <11b141710607200551j5d93c422yce9c8d5dba5d5530@mail.gmail.com> <11b141710607201740t1fda2df6k22dc05813b508016@mail.gmail.com> Reply-To: pocm@sat.inesc-id.pt NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1153532190 13471 80.91.229.2 (22 Jul 2006 01:36:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 22 Jul 2006 01:36:30 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 22 03:36:28 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G46Pp-0004qf-Fh for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Jul 2006 03:36:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G46Po-0006YL-Ts for geh-help-gnu-emacs@m.gmane.org; Fri, 21 Jul 2006 21:36:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G46Pb-0006Y0-Il for help-gnu-emacs@gnu.org; Fri, 21 Jul 2006 21:36:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G46PX-0006XF-Q9 for help-gnu-emacs@gnu.org; Fri, 21 Jul 2006 21:36:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G46PX-0006XC-MV for help-gnu-emacs@gnu.org; Fri, 21 Jul 2006 21:36:07 -0400 Original-Received: from [64.233.182.188] (helo=nf-out-0910.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G46Q4-0007LN-NH for help-gnu-emacs@gnu.org; Fri, 21 Jul 2006 21:36:40 -0400 Original-Received: by nf-out-0910.google.com with SMTP id a4so967395nfc for ; Fri, 21 Jul 2006 18:36:06 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iiHpZxi8aV9w2V/hBYSjycCnbPmTd4J7+cU6QUJ4iG5qv+k7vWyPFuA4hDZJFgtcL9SbNaMDmBErJ7ZOqhFvJcNb0k+d63Q8J+6raweBF5gC3uhK+BqKDr0sDm1Z7WsS24pgKvAca3RLJ8uiXalcLwYDlkl/U3Y0bstJUWNiolA= Original-Received: by 10.78.140.17 with SMTP id n17mr655258hud; Fri, 21 Jul 2006 18:36:06 -0700 (PDT) Original-Received: by 10.78.119.7 with HTTP; Fri, 21 Jul 2006 18:36:06 -0700 (PDT) Original-To: help-gnu-emacs@gnu.org In-Reply-To: Content-Disposition: inline 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:36152 Archived-At: On 21/07/06, Kevin Rodgers wrote: > Paulo J. Matos wrote: > > I did: > > (add-hook 'c++-mode-hook > > '(lambda () > > (define-key c++-mode-map "\011" 'semantic-ia-complete-symbol))) > > > > However, this rebinds TAB to semantic-ia-complete-symbol and it will > > not indent anymore. I don't want previous actions to disappear, I want > > to add semantic-ia-complete-symbol action to the TAB key. How can I > > mend this? > > How about: > > (defun c++-complete-or-indent () > (interactive) > "Try to complete the current symbol at point, otherwise indent." > ;; Kludge this because semantic-ia-complete-symbol really doesn't > ;; return anything useful: > (when (equal (semantic-ia-complete-symbol (point)) > "No smart completions found.") > (c-indent-command current-prefix-arg))) > > (add-hook 'c++-mode-hook > (lambda () > (local-set-key "\t" c++-complete-or-indent))) > Loved it! Thanks, need to learn more about Emacs Lisp! :-) > -- > Kevin > > > > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs > -- Paulo Jorge Matos - pocm at sat inesc-id pt Web: http://sat.inesc-id.pt/~pocm Computer and Software Engineering INESC-ID - SAT Group