unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: William Xu <william.xwl@gmail.com>
Subject: Re: Two Emacs challenges
Date: Sat, 17 Jun 2006 11:42:33 +0800	[thread overview]
Message-ID: <87ver0jvme.fsf@www.williamxu.com> (raw)
In-Reply-To: <m21wto98cf.fsf@sl392.st-edmunds.cam.ac.uk> (Leon's message of "Fri, 16 Jun 2006 21:03:12 +0100")

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

  parent reply	other threads:[~2006-06-17  3: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 [this message]
2006-06-17  9:42   ` Leon
     [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

  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=87ver0jvme.fsf@www.williamxu.com \
    --to=william.xwl@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.
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).