unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jiri Pejchal <jiri.pejchal@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Insert ; after closing parenthesis when on it
Date: Wed, 14 Feb 2007 21:09:59 +0100	[thread overview]
Message-ID: <87lkj0lcvc.fsf@gmail.com> (raw)
In-Reply-To: 1171479816.170529.163000@a75g2000cwd.googlegroups.com

"weber" <hugows@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

  reply	other threads:[~2007-02-14 20:09 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 [this message]
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
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

  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=87lkj0lcvc.fsf@gmail.com \
    --to=jiri.pejchal@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.
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).