[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: query-replace-regexp-yank
From: |
Andreas Roehler |
Subject: |
Re: query-replace-regexp-yank |
Date: |
Mon, 15 Jan 2007 20:42:40 +0100 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060516) |
At the moment I use `isearch-yank-kill' to insert
regexps into the `query-replace-regexp' minibuffer to
have them quoted as necessary.
It seems `query-replace-regexp' handles termes with
backslashes now not due `isearch-yank-kill' but as a
result of an `regexp-quote' inserted into
`query-replace-read-from' - see the diff below.
As an uncomfortable side-effect, however, terms
delivered by `query-replace-history' in a following
query are quoted again and again, are no longer
usable. So this isn't a solution still.
diff -bc --suppress-common-lines
/usr/local/share/emacs/22.0.92/lisp/replace.el replace.el
*** /usr/local/share/emacs/22.0.92/lisp/replace.el 2007-01-15
11:36:52.000000000 +0100
--- replace.el 2007-01-15 16:26:25.000000000 +0100
***************
*** 101,110 ****
(car (if regexp-flag regexp-search-ring search-ring))
(let* ((history-add-new-input nil)
(from
- ;; The save-excursion here is in case the user marks and copies
- ;; a region in order to specify the minibuffer input.
- ;; That should not clobber the region for the query-replace
itself.
(save-excursion
(read-from-minibuffer
(if query-replace-defaults
(format "%s (default %s -> %s): " prompt
--- 101,110 ----
(car (if regexp-flag regexp-search-ring search-ring))
(let* ((history-add-new-input nil)
(from
(save-excursion
+ ;; 2007-01-15 a.roehler@web.de changed section start
+ (regexp-quote
+ ;; 2007-01-15 a.roehler@web.de changed section end
(read-from-minibuffer
(if query-replace-defaults
(format "%s (default %s -> %s): " prompt
***************
*** 114,119 ****
--- 114,122 ----
nil nil nil
query-replace-from-history-variable
nil t))))
+ ;; 2007-01-15 a.roehler@web.de changed section start
+ )
+ ;; 2007-01-15 a.roehler@web.de changed section end
(if (and (zerop (length from)) query-replace-defaults)
(cons (car query-replace-defaults)
(query-replace-compile-replacement
__
Andreas Roehler