From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: query-replace-interactive not documented Date: Mon, 21 Jun 2004 05:31:30 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <20040528.181649.25475113.wl@gnu.org> <873c5jug73.fsf@mail.jurta.org> <87oenqa4lu.fsf@mail.jurta.org> <873c51w5rq.fsf@mail.jurta.org> <87659snbd8.fsf@mail.jurta.org> <87llin98sc.fsf@mail.jurta.org> <87hdtbtnsg.fsf@mail.jurta.org> <87brjhwe2c.fsf@mail.jurta.org> Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BcL9o-0003E9-00 for ; Mon, 21 Jun 2004 11:32:04 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BcL9o-0006a4-00 for ; Mon, 21 Jun 2004 11:32:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BcLB3-0000Kc-9i for emacs-devel@quimby.gnus.org; Mon, 21 Jun 2004 05:33:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BcLAz-0000K1-Gj for emacs-devel@gnu.org; Mon, 21 Jun 2004 05:33:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BcLAy-0000JQ-KY for emacs-devel@gnu.org; Mon, 21 Jun 2004 05:33:16 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BcLAy-0000J9-6d for emacs-devel@gnu.org; Mon, 21 Jun 2004 05:33:16 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BcL9H-0003wB-A3 for emacs-devel@gnu.org; Mon, 21 Jun 2004 05:31:31 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1BcL9G-00013m-BL; Mon, 21 Jun 2004 05:31:30 -0400 Original-To: David Kastrup In-reply-to: (message from David Kastrup on 20 Jun 2004 23:05:25 +0200) 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:25142 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25142 So what is the rule? The problem is that currently I just use read-from-string, and that can't distinguish between 'symbol and (quote symbol) I had not been thinking about that because I was assuming that the reader itself would swallow the space. However, in writing my code I found it does not. Indeed I forgot to handle this distinction. Since the value is supposed to be a string, perhaps neither of these cases matters much. However, I think it would be easy to distinguish them by testing whether the expression began with an open-paren. ;; Swallow a space after a symbol ;; if there is a space. (if (and (or (symbolp (car pos)) ;; Swallow a space after 'foo ;; but not after (quote foo). (and (eq (car-safe (car pos)) 'quote) (= ?\( (aref to-string 0)))) (equal " " (substring to-string (cdr pos) (1+ (cdr pos)))))