GNU bug report logs -
#31073
27.0.50; query-replace undo might change the word case
Previous Next
Reported by: Tino Calancha <tino.calancha <at> gmail.com>
Date: Fri, 6 Apr 2018 05:03:01 UTC
Severity: normal
Found in version 27.0.50
Done: Tino Calancha <tino.calancha <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
>> this feature was introduced for Emacs-26 release. Should the fix go
>> into that branch (Emacs-26)?
>
> It's too late for Emacs 26.1. For the other 26.x, I'd need to see the
> patch first.
I see.
The patch is pretty obvious: just 1 line:
--8<-----------------------------cut here---------------start------------->8---
commit a70414e82048f425cdb00e3cd30c15fcb9fbab86
Author: Tino Calancha <tino.calancha <at> gmail.com>
Date: Fri Apr 6 14:03:55 2018 +0900
Preserve case in query-replace undo
If the user query and replaces 'foo' with 'BAR', then
undo must comeback to 'foo', not to 'FOO' (Bug#31073).
* lisp/replace.el (perform-replace): Bind nocasify to non-nil
value during undo/undo-all actions.
diff --git a/lisp/replace.el b/lisp/replace.el
index c28c9b36f0..2b0555d580 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2619,6 +2619,7 @@ perform-replace
(let ((stack-idx 0)
(stack-len (length stack))
(num-replacements 0)
+ (nocasify t) ; Bug#31073.
search-string
next-replacement)
(while (and (< stack-idx stack-len)
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 27.0.50 (build 25, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
Repository revision: 8df23a82042fa7dbaaa4377bc376d705595b073f
This bug report was last modified 7 years and 47 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.