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: Thu, 29 Apr 2004 14:59:57 +0300 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87k6zzkn9e.fsf@mail.jurta.org> References: <87brlb1840.fsf@mail.jurta.org> <87llkfoxpr.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 1083246586 21129 80.91.224.253 (29 Apr 2004 13:49:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 29 Apr 2004 13:49:46 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Apr 29 15:49:38 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 1BJBv0-0004X4-00 for ; Thu, 29 Apr 2004 15:49:38 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BJBv0-0005t6-00 for ; Thu, 29 Apr 2004 15:49:38 +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 1BJBZy-00075N-Is for emacs-devel@quimby.gnus.org; Thu, 29 Apr 2004 09:27:54 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BJBOC-00046i-9x for emacs-devel@gnu.org; Thu, 29 Apr 2004 09:15:44 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BJATb-0004Ag-Um for emacs-devel@gnu.org; Thu, 29 Apr 2004 08:17:48 -0400 Original-Received: from [66.33.219.19] (helo=spoon.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BJAE5-0002f3-Dq for emacs-devel@gnu.org; Thu, 29 Apr 2004 08:01:13 -0400 Original-Received: from mail.jurta.org (80-235-36-125-dsl.mus.estpak.ee [80.235.36.125]) by spoon.dreamhost.com (Postfix) with ESMTP id A837C13D891; Thu, 29 Apr 2004 05:01:06 -0700 (PDT) Original-To: Andreas Schwab In-Reply-To: (Andreas Schwab's message of "Thu, 29 Apr 2004 13:21:26 +0200") 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:22357 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22357 Andreas Schwab writes: > Juri Linkov writes: > >> To fix it, it seems reasonable to check for character syntax of >> arguments before inserting a space, i.e. insert a space >> when character syntax of adjacent characters is the same, >> (plus ?w and ?_, i.e. inside words as it was before): >> >> - (memq (char-syntax (preceding-char)) '(?w ?_ ?\) )) >> + (memq (char-syntax (preceding-char)) (list ?w ?_ (char-syntax close))) > > What's wrong with leaving it as it is? I wanted to follow the same logic of inserting a space for other possible character pairs: ", ', `, <>, [], {}. For example, inserting a quote character next to an existing quote character could insert a space between them. Anyway, the docstring of `insert-parentheses' says: "If `parens-require-spaces' is non-nil, this command also inserts a space before and after, depending on the surrounding characters." What does "depending on the surrounding characters" mean, when applied to other characters, can be interpreted differently. -- Juri Linkov http://www.jurta.org/emacs/