1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-18 00:50:44 -08:00

Add a M-c' command to read-regexp'

* doc/lispref/minibuf.texi (Text from Minibuffer): Document it.

* lisp/replace.el (read-regexp): Add a `M-c' command to indicate
case folding (bug#16913).
This commit is contained in:
Lars Ingebrigtsen 2022-06-13 15:31:25 +02:00
parent 86325f960a
commit 027fecb24b
3 changed files with 62 additions and 10 deletions

View file

@ -309,6 +309,20 @@ The optional argument @var{history}, if non-@code{nil}, is a symbol
specifying a minibuffer history list to use (@pxref{Minibuffer
History}). If it is omitted or @code{nil}, the history list defaults
to @code{regexp-history}.
The user can use the @kbd{M-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
@code{read-regexp} to actually use this value, and the convenience
function @code{read-regexp-case-fold-search} is provided for that. A
typical usage pattern here might look like:
@lisp
(let* ((regexp (read-regexp "Search for: "))
(case-fold-search (read-regexp-case-fold-search regexp)))
(re-search-forward regexp))
@end lisp
@end defun
@defopt read-regexp-defaults-function