# HG changeset patch # User Juri Linkov # Date 1088463786 0 # Node ID 610a9a9c39d04b485f8f3358381b1a7dfa21357a # Parent 134a7ba00965fb5b227c407c06f04205810e81b3 (query-replace-read-args): Swallow a space after everything except )]" which in most cases means after a symbol. diff -r 134a7ba00965 -r 610a9a9c39d0 lisp/replace.el --- a/lisp/replace.el Mon Jun 28 22:31:09 2004 +0000 +++ b/lisp/replace.el Mon Jun 28 23:03:06 2004 +0000 @@ -109,23 +109,18 @@ ((eq char ?\,) (setq pos (read-from-string to)) (push `(replace-quote ,(car pos)) list) - (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-string 0)))) - (equal " " (substring to-string (cdr pos) - (1+ (cdr pos))))) - (1+ (cdr pos)) - (cdr pos)))) - (setq to (substring to end))))) + (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)))))) (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))) (setq to (nreverse (delete "" (cons to list))))) (replace-match-string-symbols to) - (setq to (cons 'replace-eval-replacement + (setq to (cons 'replace-eval-replacement (if (> (length to) 1) (cons 'concat to) (car to))))) @@ -1397,7 +1392,7 @@ ((eq def 'act-and-exit) (or replaced (setq noedit - (replace-match-maybe-edit + (replace-match-maybe-edit next-replacement nocasify literal noedit real-match-data) replace-count (1+ replace-count)))