From: Leon <sdl.web@gmail.com>
Subject: Re: Two Emacs challenges
Date: Sat, 17 Jun 2006 10:42:08 +0100 [thread overview]
Message-ID: <m2mzccjez3.fsf@sl392.st-edmunds.cam.ac.uk> (raw)
In-Reply-To: 87ver0jvme.fsf@www.williamxu.com
William Xu <william.xwl@gmail.com> writes:
> 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)
>
This is a very nice function. Thanks.
>> 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.
Sometimes I just want to insert a missing ( or [ etc before a word or
something. But now skeleton-pair-insert-maybe can handle this well.
--
Leon
next prev parent reply other threads:[~2006-06-17 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-16 20:03 Two Emacs challenges Leon
2006-06-16 20:15 ` Lennart Borgman
2006-06-16 20:21 ` Lennart Borgman
2006-06-16 20:21 ` Leon
2006-06-17 3:42 ` William Xu
2006-06-17 9:42 ` Leon [this message]
[not found] <mailman.2952.1150488218.9609.help-gnu-emacs@gnu.org>
2006-06-17 0:26 ` Joe Fineman
2006-06-17 10:07 ` Leon
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=m2mzccjez3.fsf@sl392.st-edmunds.cam.ac.uk \
--to=sdl.web@gmail.com \
/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.