From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Francois Fleuret Newsgroups: gmane.emacs.help Subject: Re: match if-then-else, brackets etc. Date: 10 Apr 2003 17:33:02 +0200 Organization: I.N.R.I.A Rocquencourt Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1049990185 6081 80.91.224.249 (10 Apr 2003 15:56:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 10 Apr 2003 15:56:25 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 10 17:56:24 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 193ePR-0001ZZ-00 for ; Thu, 10 Apr 2003 17:56:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 193eOr-0007rG-02 for gnu-help-gnu-emacs@m.gmane.org; Thu, 10 Apr 2003 11:55:41 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!freenix!teaser.fr!news.cs.univ-paris8.fr!ciril.fr!cines.fr!univ-lyon1.fr!unice.fr!news.cma.fr!news-sop.inria.fr!news-rocq.inria.fr!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 34 Original-NNTP-Posting-Host: wasabi.inria.fr Original-X-Trace: news-rocq.inria.fr 1049988782 21374 128.93.23.201 (10 Apr 2003 15:33:02 GMT) Original-X-Complaints-To: usenet@inria.fr Original-NNTP-Posting-Date: Thu, 10 Apr 2003 15:33:02 +0000 (UTC) X-Attribution: FF X-Url: http://www-rocq.inria.fr/~fleuret User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Xref: shelby.stanford.edu gnu.emacs.help:111852 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:8353 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:8353 Hi, Detlef Jockheck wrote on 10 Apr 2003 16:26:20 MET: > whenever I analyze a programm in c, perl or pythen I have some > problems to find the matching statement. Thant means I'm looking for > the end of an if-declaration. Or where does this bracket belong > to. Is there a plugin to hilight this dependencies in emacs? This will highlight the matching parenthesis/curly bracket/whatever: ,---- | (setq show-paren-delay 0) | (show-paren-mode t) `---- And this will make control-right to move the cursor to the matching parenthesis/curly bracket/whatever ,---- | (defun match-paren (arg) | "Go to the matching parenthesis" | (interactive "p") | (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) | ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) | (t (condition-case nil (progn (re-search-forward "\\s\(") (backward-char 1)) (error nil))) | )) | | (define-key global-map [(control right)] 'match-paren) `---- Regards, FF