emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: query-replace-interactive not documented


From: Richard Stallman
Subject: Re: query-replace-interactive not documented
Date: Mon, 21 Jun 2004 05:31:30 -0400

    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)))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]