From 027fecb24bb0a17543efb0ef63bb7b160e2630d1 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 13 Jun 2022 15:31:25 +0200 Subject: 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). --- doc/lispref/minibuf.texi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'doc') diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 1451e59d05c..a59261cb9df 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -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 -- cgit v1.2.1