* they never thought I would query-replace an uppercase
@ 2002-10-28 22:01 Dan Jacobson
[not found] ` <E186wTw-00031O-00@fencepost.gnu.org>
0 siblings, 1 reply; 3+ messages in thread
From: Dan Jacobson @ 2002-10-28 22:01 UTC (permalink / raw)
In todays episode a hasty Dan is again mislead by the documentation,
whereupon he stumbles upon something that needs to be documented. All
is well in the end though.
The help for query-replace-regexp just says: "Preserves case in each
replacement if `case-replace' and `case-fold-search' are non-nil and
REGEXP has no uppercase letters."
Therefore, the user in a rush to replace a certain capital letter
thinks: Oh great, I was hoping to match only "S" and not "s", but this
possibility was apparently overlooked [by guess who]. Same apparently
with plain query-replace.
(dired-do-query-replace-regexp "S" "000") is what I was poking around
with. Wanna know something really funny? That command pooped out
with "replaced 0 occurrences" resting on the first match [a little
"s"]. I had to use little "s" to get the usual behavior.
echo s>file1
echo S>file2
LC_ALL=C emacs --no-site-file -q .
m m [mark all files]
(dired-do-query-replace-regexp "S" "000")
see what I mean.
By the way, I did "man ascii" to get the octal code for S, but it
seems I just couldn't figure out how to fool query-replace-regexp with
it.
Back to the first problem: from the Info page we see that we should
try setting case-fold-search to nil. [We don't see such details
elsewhere, *Help* just sends us in my initial direction.] Didn't help:
perhaps because this becomes a local "t" variable in each new buffer
dired visits.
So you might mention on the dired-do-query-replace-regexp Help blurb
to do (set-default 'case-fold-search nil), which apparently has got me
rolling again.
--
http://jidanni.org/ Taiwan(04)25854780
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-11-03 21:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-28 22:01 they never thought I would query-replace an uppercase Dan Jacobson
[not found] ` <E186wTw-00031O-00@fencepost.gnu.org>
2002-10-30 22:37 ` Dan Jacobson
[not found] ` <E187YI7-0005sq-00@fencepost.gnu.org>
2002-11-03 21:10 ` Dan Jacobson
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.