summaryrefslogtreecommitdiff
path: root/test/lisp/misc-tests.el
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2022-05-21 11:23:17 +0200
committerTino Calancha <tino.calancha@gmail.com>2022-05-21 11:23:55 +0200
commit212aea97f9c9fdabdf7e8a47e64c8243953a7690 (patch)
treee7bdc796b65dfc310d200437761823d3cc38b8d5 /test/lisp/misc-tests.el
parent92fa0df30be7a4e3947cdeca89280947794ac7d6 (diff)
downloademacs-212aea97f9c9fdabdf7e8a47e64c8243953a7690.tar.gz
emacs-212aea97f9c9fdabdf7e8a47e64c8243953a7690.tar.bz2
emacs-212aea97f9c9fdabdf7e8a47e64c8243953a7690.zip
zap-to-char: case sensitive for upper-case characters
In interactive calls, behave case-sensitively if the given char is an upper-case character. Same for zap-up-to-char (Bug#54804). This is analog to what the user-level incremental search feature does. * lisp/misc.el (zap-up-to-char): Add an optional arg INTERACTIVE. Perform a case-sensitive search when INTERACTIVE is non-nil and CHAR is an upper-case character. * lisp/simple.el (zap-to-char): Same. * etc/NEWS (Editing Changes in Emacs 29.1): Announce this change. * test/lisp/misc-tests.el (misc-test-zap-up-to-char): Add test cases. * test/lisp/simple-tests.el (with-zap-to-char-test): Add helper macro. (simple-tests-zap-to-char): Add a test.
Diffstat (limited to 'test/lisp/misc-tests.el')
-rw-r--r--test/lisp/misc-tests.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/lisp/misc-tests.el b/test/lisp/misc-tests.el
index 36a8726b885..236223ef493 100644
--- a/test/lisp/misc-tests.el
+++ b/test/lisp/misc-tests.el
@@ -44,7 +44,14 @@
(zap-up-to-char 1 ?c))
(with-misc-test "abcde abc123" "c123"
(goto-char (point-min))
- (zap-up-to-char 2 ?c)))
+ (zap-up-to-char 2 ?c))
+ (let ((case-fold-search t))
+ (with-misc-test "abcdeCXYZ" "cdeCXYZ"
+ (goto-char (point-min))
+ (zap-up-to-char 1 ?C))
+ (with-misc-test "abcdeCXYZ" "CXYZ"
+ (goto-char (point-min))
+ (zap-up-to-char 1 ?C 'interactive))))
(ert-deftest misc-test-upcase-char ()
(with-misc-test "abcde" "aBCDe"