From: Marc Tfardy <m-t-o___CUT_IT___@web.de>
Subject: Re: matching parenthesis
Date: Tue, 26 Jul 2005 09:36:39 +0100 [thread overview]
Message-ID: <3km7jnFu15jhU1@individual.net> (raw)
In-Reply-To: <mailman.1684.1122325407.20277.help-gnu-emacs@gnu.org>
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
prev parent reply other threads:[~2005-07-26 8:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-22 12:30 matching parenthesis Jan Guido Donath
2005-07-22 14:12 ` Johan Bockgård
2005-07-22 19:58 ` Klaus Berndl
2005-07-25 9:09 ` Sergei
2005-07-25 20:57 ` Martin Slouf
2005-07-26 0:24 ` Johan Bockgård
2005-07-26 3:41 ` Sergei
[not found] ` <mailman.1684.1122325407.20277.help-gnu-emacs@gnu.org>
2005-07-26 8:36 ` Marc Tfardy [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3km7jnFu15jhU1@individual.net \
--to=m-t-o___cut_it___@web.de \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).