[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Two Emacs challenges
From: |
William Xu |
Subject: |
Re: Two Emacs challenges |
Date: |
Sat, 17 Jun 2006 11:42:33 +0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux) |
Leon <sdl.web@gmail.com> writes:
[...]
> (2) pairs
>
> How to bind keys such as (, [, {, " etc to perform such function
>
> When type once, it will insert a pair while twice insert itself for
> example: `[' will insert `[]' and leave the cursor in the middle
Set this,
(setq skeleton-pair t)
(global-set-key (kbd "(") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "[") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "{") 'skeleton-pair-insert-maybe)
> while `[[' will insert `['?
i don't understand why you would like this. Suppose we want to write a
nested list, like '((a) (b)), same insert scheme is still useful.
--
William
Battle, n.:
A method of untying with the teeth a political knot that
will not yield to the tongue.
-- Ambrose Bierce