From: "weber" <hugows@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Insert ; after closing parenthesis when on it
Date: 14 Feb 2007 12:36:26 -0800 [thread overview]
Message-ID: <1171485386.809853.269080@q2g2000cwa.googlegroups.com> (raw)
In-Reply-To: <mailman.4523.1171483812.2155.help-gnu-emacs@gnu.org>
On 14 fev, 17:09, Jiri Pejchal <jiri.pejc...@gmail.com> wrote:
> "weber" <hug...@gmail.com> writes:
> > There's probably a faster way, but the way I know is remapping the ';'
> > key like this:
>
> > (global-set-key ";" 'insert-closepar)
>
> > where the function insert-closepar would be something like this
> > (tested) :
>
> > (defun insert-closepar ()
> > "Close parenthesis Jiri's way"
> > (interactive)
> > (if (looking-at ")")
> > (forward-char))
> > (insert ";"))
>
> > Oh, and you probably don't want to make that binding global map,
> > because you are only going to use it on specific modes. Try doing:
> > (define-key somelanguage-mode-map ";" 'insert-closepar)
>
> Thanks a lot! But I would like to keep the electric behaviour of ';'
> too. It's bound to c-electric-semi&comma.
>
> --
> Jiri Pejchal
I couldn't test that here, but maybe just doing something like this
works ?
(defun jump-closepar ()
"Close parenthesis Jiri's way"
(interactive)
(if (looking-at ")")
(forward-char))
(c-electric-semi&comma))
Just a guess...
cheers,
weber
next prev parent reply other threads:[~2007-02-14 20:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.4516.1171478780.2155.help-gnu-emacs@gnu.org>
2007-02-14 19:03 ` Insert ; after closing parenthesis when on it weber
2007-02-14 20:09 ` Jiri Pejchal
2007-02-14 20:41 ` Matthew Flaschen
2007-02-15 2:36 ` Herbert Euler
2007-02-15 2:40 ` Herbert Euler
[not found] ` <mailman.4523.1171483812.2155.help-gnu-emacs@gnu.org>
2007-02-14 20:36 ` weber [this message]
2007-02-14 21:36 ` Jiri Pejchal
[not found] ` <mailman.4529.1171488981.2155.help-gnu-emacs@gnu.org>
2007-02-16 7:34 ` Markus Triska
2007-02-16 18:32 ` Jiri Pejchal
2007-02-14 19:08 ` weber
2007-02-14 18:44 Jiri Pejchal
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=1171485386.809853.269080@q2g2000cwa.googlegroups.com \
--to=hugows@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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.