From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Insert character pairs Date: Sat, 01 May 2004 11:19:32 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87smeka7aj.fsf@mail.jurta.org> References: <87brlb1840.fsf@mail.jurta.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1083400027 31055 80.91.224.253 (1 May 2004 08:27:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 1 May 2004 08:27:07 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat May 01 10:26:58 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BJppq-0008QY-00 for ; Sat, 01 May 2004 10:26:58 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BJppq-0006wt-00 for ; Sat, 01 May 2004 10:26:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BJpmH-0001QR-MP for emacs-devel@quimby.gnus.org; Sat, 01 May 2004 04:23:17 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BJplr-0001K2-48 for emacs-devel@gnu.org; Sat, 01 May 2004 04:22:51 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BJplD-0008OX-QD for emacs-devel@gnu.org; Sat, 01 May 2004 04:22:45 -0400 Original-Received: from [66.33.219.19] (helo=spoon.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BJplB-0008JV-SM for emacs-devel@gnu.org; Sat, 01 May 2004 04:22:09 -0400 Original-Received: from mail.jurta.org (80-235-32-234-dsl.mus.estpak.ee [80.235.32.234]) by spoon.dreamhost.com (Postfix) with ESMTP id 283E313D883 for ; Sat, 1 May 2004 01:22:11 -0700 (PDT) Original-To: emacs-devel@gnu.org In-Reply-To: <87brlb1840.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 29 Apr 2004 11:48:48 +0300") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22484 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22484 > Also it adds the functions for some most frequent character pairs > to be able to bind them to the keys like M-", M-', M-`, M-[. It seems all these functions might be added only with adding the corresponding key bindings at the same time. But some keys are already bound: M-' to abbrev-prefix-mark, M-` to tmm-menubar, M-{ to backward-paragraph. M-" and M-[ are unbound, but they might be reserved to something different. Anyhow, the function `open-pair' allows everyone to bind a key to `open-pair' with desired character arguments in .emacs. BTW, I didn't find anywhere in Emacs a command that promotes a list up in the tree. It would be useful to add this command to `emacs-lisp/lisp.el': (defun promote-list (&optional arg) "Promote expressions higher up the tree." (interactive "p") (let ((str (if (and transient-mark-mode mark-active) (buffer-substring (region-beginning) (region-end)) (buffer-substring (point) (save-excursion (forward-sexp arg) (point)))))) (backward-up-list 1) (delete-region (point) (save-excursion (forward-sexp 1) (point))) (save-excursion (insert str)))) Maybe, a better name is `move-up-list' (however, not good since the word `move' often means `move the point') or `lift-up-list'? The command `promote-list' is basically opposite to `insert-parentheses', so another possible name is `remove-parentheses', but it is misleading, because it removes more than only enclosing parentheses. -- Juri Linkov http://www.jurta.org/emacs/