diff options
author | Juri Linkov <juri@jurta.org> | 2004-06-28 23:03:06 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2004-06-28 23:03:06 +0000 |
commit | aed44c443384c97d6e15559ecd01723397683c00 (patch) | |
tree | 6a272943ca774ef41a79833d85a3d525074ddf43 /lisp/replace.el | |
parent | 783d1108007516c27b6f30024b9fa63aaf0ec1e2 (diff) | |
download | emacs-aed44c443384c97d6e15559ecd01723397683c00.tar.gz |
(query-replace-read-args): Swallow a space after
everything except )]" which in most cases means after a symbol.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r-- | lisp/replace.el | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index c68a420db7a..c2305cdecc6 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -109,23 +109,18 @@ strings or patterns." ((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 @@ make, or the user didn't cancel the call." ((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))) |