From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Matthew O. Smith" Newsgroups: gmane.emacs.help Subject: Re: command help : matching braces Date: Mon, 8 Apr 2002 11:21:55 -0600 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <00c001c1df21$e26e9fa0$8f31d49f@HL7C711> References: <578F3C8F6DD3D411850600508BF320CAD014D6@aries-exch1.uk.eu.corp.vizzavi.net> <3CB1CE5F.9020604@fuego.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1018286689 12267 127.0.0.1 (8 Apr 2002 17:24:49 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 8 Apr 2002 17:24:49 +0000 (UTC) Cc: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16ucsq-0003Bk-00 for ; Mon, 08 Apr 2002 19:24:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16ucsJ-0004y8-00; Mon, 08 Apr 2002 13:24:15 -0400 Original-Received: from tethys.ihc.com ([159.212.70.7]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16ucqF-0004ig-00 for ; Mon, 08 Apr 2002 13:22:08 -0400 Original-Received: from [159.212.71.4] (helo=HL7C711) by tethys.ihc.com with smtp (Exim 3.32 #2) id 16ucq2-0003wt-00; Mon, 08 Apr 2002 11:21:54 -0600 Original-To: "Fernando Dobladez" , "Ambardekar, Shailesh" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.8 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:62 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:62 Hi, I added curly brace matching as well. Thanks. (defun match-paren (arg) "Go to the matching parenthesis if on parenthesis, otherwise insert %. (Like in VI editor). Thanks Fernando Dobladez " (interactive "p") (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) ((looking-at "\\s\{") (forward-list 1) (backward-char 1)) ((looking-at "\\s\}") (forward-char 1) (backward-list 1)) (t (self-insert-command (or arg 1))))) ----- Original Message ----- From: "Fernando Dobladez" To: "Ambardekar, Shailesh" Cc: Sent: Monday, April 08, 2002 11:07 AM Subject: Re: command help : matching braces > If you miss VI's % too much, you'd probably like to include the > following in your .emacs: > > (defun match-paren (arg) > "Go to the matching parenthesis if on parenthesis, otherwise insert %. > (Like in VI editor)" > (interactive "p") > (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) > ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) > (t (self-insert-command (or arg 1))))) > > (global-set-key "%" 'match-paren) > > > That will make the '%' go to the matching brace if the cursor is on a > brace, and it will insert "%" otherwise. > > Fernando. > > > Ambardekar, Shailesh wrote: > > >In gnu emacs 20.3.1 under Sun Solaris 2.6, > >what is the emacs command for going to the matching brace ? > >( looking for emacs equivalent of % vi command ). > > > >Thanks in advance. > > > >Shailesh > > > > > > > > _______________________________________________ > Help-gnu-emacs mailing list > Help-gnu-emacs@gnu.org > http://mail.gnu.org/mailman/listinfo/help-gnu-emacs