diff options
| author | Tino Calancha | 2018-04-09 11:47:47 +0900 |
|---|---|---|
| committer | Tino Calancha | 2018-04-09 11:47:47 +0900 |
| commit | 32dc0cb1b5ae895d237c7118ccaeb084715934fd (patch) | |
| tree | fb8f4645d3584fdf5281bc78e662d5c893e56bea /lisp/replace.el | |
| parent | 24f7defaf79e5afc38f40de01c78a4a7ed51dbd4 (diff) | |
| download | emacs-32dc0cb1b5ae895d237c7118ccaeb084715934fd.tar.gz emacs-32dc0cb1b5ae895d237c7118ccaeb084715934fd.zip | |
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.
* test/lisp/replace-tests.el (query-replace-undo-bug31073): Add test.
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index c28c9b36f05..4916cb138e6 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -2619,6 +2619,7 @@ It must return a string." | |||
| 2619 | (let ((stack-idx 0) | 2619 | (let ((stack-idx 0) |
| 2620 | (stack-len (length stack)) | 2620 | (stack-len (length stack)) |
| 2621 | (num-replacements 0) | 2621 | (num-replacements 0) |
| 2622 | (nocasify t) ; Undo must preserve case (Bug#31073). | ||
| 2622 | search-string | 2623 | search-string |
| 2623 | next-replacement) | 2624 | next-replacement) |
| 2624 | (while (and (< stack-idx stack-len) | 2625 | (while (and (< stack-idx stack-len) |