From 8e9783b4ce42122a8670f16f21a73597a226b674 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 18 Jan 2023 20:05:19 +0200 Subject: [PATCH] =?utf8?q?Rebind=20in=20read-regexp-map=20=E2=80=98M-c?= =?utf8?q?=E2=80=99=20to=20=E2=80=98M-s=20c=E2=80=99=20compatible=20with?= =?utf8?q?=20search-map?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Also it's compatible with 'M-s c' (isearch-toggle-case-fold) used during Isearch. Also makes possible to use the global keybinding 'M-c' (capitalize-dwim) in the minibuffer. * doc/lispref/minibuf.texi (Text from Minibuffer): Rename ‘M-c’ to ‘M-s c’. * lisp/replace.el (read-regexp-map): Rebind ‘M-c’ to ‘M-s c’ (bug#60741). (read-regexp-toggle-case-fold): Rename from read-regexp-toggle-case-folding to more standard name. --- doc/lispref/minibuf.texi | 2 +- etc/NEWS | 2 +- lisp/replace.el | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 18125c372ce..114e5d38a80 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -312,7 +312,7 @@ to @code{regexp-history}. @cindex @code{case-fold}, text property @findex read-regexp-case-fold-search -The user can use the @kbd{M-c} command to indicate whether case +The user can use the @kbd{M-s c} command to indicate whether case folding should be on or off. If the user has used this command, the returned string will have the text property @code{case-fold} set to either @code{fold} or @code{inhibit-fold}. It is up to the caller of diff --git a/etc/NEWS b/etc/NEWS index 14941b906ef..9f735bec443 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3807,7 +3807,7 @@ These function now take an optional comparison PREDICATE argument. ** 'read-multiple-choice' can now use long-form answers. +++ -** 'M-c' in 'read-regexp' now toggles case folding. +** 'M-s c' in 'read-regexp' now toggles case folding. +++ ** 'completing-read' now allows a function as its REQUIRE-MATCH argument. diff --git a/lisp/replace.el b/lisp/replace.el index 2f063bbf66b..3c2b925ea92 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -824,11 +824,11 @@ by this function to the end of values available via (defvar-keymap read-regexp-map :parent minibuffer-local-map - "M-c" #'read-regexp-toggle-case-folding) + "M-s c" #'read-regexp-toggle-case-fold) (defvar read-regexp--case-fold nil) -(defun read-regexp-toggle-case-folding () +(defun read-regexp-toggle-case-fold () (interactive) (setq read-regexp--case-fold (if (or (eq read-regexp--case-fold 'fold) @@ -875,7 +875,7 @@ in \":\", followed by optional whitespace), DEFAULT is added to the prompt. The optional argument HISTORY is a symbol to use for the history list. If nil, use `regexp-history'. -If the user has used the \\\\[read-regexp-toggle-case-folding] command to specify case +If the user has used the \\\\[read-regexp-toggle-case-fold] command to specify case sensitivity, the returned string will have a text property named `case-fold' that has a value of either `fold' or `inhibit-fold'. (It's up to the caller of `read-regexp' to -- 2.39.5