[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Insert ; after closing parenthesis when on it

From: Jiri Pejchal
Subject: Re: Insert ; after closing parenthesis when on it
Date: Wed, 14 Feb 2007 21:09:59 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux)

"weber" <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]