# HG changeset patch # User Richard M. Stallman # Date 1088812334 0 # Node ID 06c785c5e65558eb9e3a68d24071274dc9042cfc # Parent e6bf7376c962df22e8e82ceda9b481723a59db5a (query-replace-read-args): Swallow space after symbols, not after closeparens. But avoid error if string ends there. diff -r e6bf7376c962 -r 06c785c5e655 lisp/replace.el --- a/lisp/replace.el Fri Jul 02 23:49:50 2004 +0000 +++ b/lisp/replace.el Fri Jul 02 23:52:14 2004 +0000 @@ -118,14 +118,18 @@ ((eq char ?\,) (setq pos (read-from-string to)) (push `(replace-quote ,(car pos)) list) - (setq to (substring - to (+ (cdr pos) - ;; Swallow a space after a symbol - ;; if there is a space. - (if (string-match - "^[^])\"] " - (substring to (1- (cdr pos)))) - 1 0)))))) + (let ((end + ;; 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 0)))) + (string-match " " to (cdr pos))) + (1+ (cdr pos)) + (cdr pos)))) + (setq to (substring to end))))) (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))) (setq to (nreverse (delete "" (cons to list))))) (replace-match-string-symbols to)