all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Francois Fleuret <francois.fleuret@inria.fr>
Subject: Re: match if-then-else, brackets etc.
Date: 10 Apr 2003 17:33:02 +0200	[thread overview]
Message-ID: <s027ka25pw1.fsf@wasabi.inria.fr> (raw)
In-Reply-To: t0fgm-0lg.ln1@java.adp-entwicklung.gauselmann.de

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

  reply	other threads:[~2003-04-10 15:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-10 15:26 match if-then-else, brackets etc Detlef Jockheck
2003-04-10 15:33 ` Francois Fleuret [this message]
2003-04-10 15:42 ` Kai Großjohann
2003-04-11  5:58   ` Detlef Jockheck
2003-04-11 10:33     ` Detlef Jockheck
2003-04-11 16:28       ` Kai Großjohann
2003-04-10 17:55 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s027ka25pw1.fsf@wasabi.inria.fr \
    --to=francois.fleuret@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.