From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William Xu Newsgroups: gmane.emacs.help Subject: Re: Two Emacs challenges Date: Sat, 17 Jun 2006 11:42:33 +0800 Organization: the Church of Emacs Message-ID: <87ver0jvme.fsf@www.williamxu.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1150515733 17847 80.91.229.2 (17 Jun 2006 03:42:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 17 Jun 2006 03:42:13 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 17 05:42:11 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FrRhH-0007zb-3f for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Jun 2006 05:42:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FrRhG-0005ku-Ij for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Jun 2006 23:42:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FrRh5-0005kP-2K for help-gnu-emacs@gnu.org; Fri, 16 Jun 2006 23:41:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FrRh3-0005jl-Ew for help-gnu-emacs@gnu.org; Fri, 16 Jun 2006 23:41:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FrRh3-0005jg-9H for help-gnu-emacs@gnu.org; Fri, 16 Jun 2006 23:41:53 -0400 Original-Received: from [166.111.70.144] (helo=localhost) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FrRqo-0006F0-CJ for help-gnu-emacs@gnu.org; Fri, 16 Jun 2006 23:51:58 -0400 Original-Received: from localhost ([127.0.0.1] helo=www.williamxu.com) by localhost with esmtp (Exim 3.36 #1 (Debian)) id 1FrRhh-0002j0-00 for ; Sat, 17 Jun 2006 11:42:33 +0800 Original-To: help-gnu-emacs@gnu.org In-Reply-To: (Leon's message of "Fri, 16 Jun 2006 21:03:12 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35517 Archived-At: Leon 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