Rebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible with search-map

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.
This commit is contained in:
Juri Linkov 2023-01-18 20:05:19 +02:00
parent 78f93d92b2
commit 8e9783b4ce
3 changed files with 5 additions and 5 deletions

View file

@ -312,7 +312,7 @@ to @code{regexp-history}.
@cindex @code{case-fold}, text property @cindex @code{case-fold}, text property
@findex read-regexp-case-fold-search @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 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 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 either @code{fold} or @code{inhibit-fold}. It is up to the caller of

View file

@ -3807,7 +3807,7 @@ These function now take an optional comparison PREDICATE argument.
** 'read-multiple-choice' can now use long-form answers. ** '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. ** 'completing-read' now allows a function as its REQUIRE-MATCH argument.

View file

@ -824,11 +824,11 @@ by this function to the end of values available via
(defvar-keymap read-regexp-map (defvar-keymap read-regexp-map
:parent minibuffer-local-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) (defvar read-regexp--case-fold nil)
(defun read-regexp-toggle-case-folding () (defun read-regexp-toggle-case-fold ()
(interactive) (interactive)
(setq read-regexp--case-fold (setq read-regexp--case-fold
(if (or (eq read-regexp--case-fold '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. The optional argument HISTORY is a symbol to use for the history list.
If nil, use `regexp-history'. If nil, use `regexp-history'.
If the user has used the \\<read-regexp-map>\\[read-regexp-toggle-case-folding] command to specify case If the user has used the \\<read-regexp-map>\\[read-regexp-toggle-case-fold] command to specify case
sensitivity, the returned string will have a text property named sensitivity, the returned string will have a text property named
`case-fold' that has a value of either `fold' or `case-fold' that has a value of either `fold' or
`inhibit-fold'. (It's up to the caller of `read-regexp' to `inhibit-fold'. (It's up to the caller of `read-regexp' to