From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marc Tfardy Newsgroups: gmane.emacs.help Subject: Re: matching parenthesis Date: Tue, 26 Jul 2005 09:36:39 +0100 Message-ID: <3km7jnFu15jhU1@individual.net> References: <1122282552.326737.301880@z14g2000cwz.googlegroups.com> 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 1122366855 7799 80.91.229.2 (26 Jul 2005 08:34:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Jul 2005 08:34:15 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jul 26 10:34:15 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DxKt4-00085T-HQ for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Jul 2005 10:34:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DxKvO-000720-P8 for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Jul 2005 04:36:31 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 Original-X-Trace: individual.net Ahpu522M1cU1IaMXjkUIjA/De0WinLppYABbU8AyprW8u5bb/s User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en In-Reply-To: Original-Xref: shelby.stanford.edu gnu.emacs.help:132672 Original-To: help-gnu-emacs@gnu.org 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:28194 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28194 Martin Slouf schrieb: > not exactly what you ask for, but i know this one: > > (show-paren-mode 1) > ;; define function to match a parenthesis otherwise insert a '~' > (defun goto-match-paren (arg) > "Go to the matching parenthesis if on parenthesis otherwise insert '~'." > (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 (kbd "~") 'goto-match-paren) > > copy to your .emacs and pressing '~' will jump to matching parenthesis instead > of inserting '~' if and only if your point is on the parenthesis > > this is not mine function, it was stolen from somenone else by me. > > (so i can thank him for it now :) And I thank too! Very very useful function! It is already in my .emacs :-) regards Marc