emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/consult fbfb30a 2/3: Clarify consult-grep docs regardin


From: ELPA Syncer
Subject: [elpa] externals/consult fbfb30a 2/3: Clarify consult-grep docs regarding its usage of Emacs regexp syntax (See #476)
Date: Thu, 2 Dec 2021 04:57:14 -0500 (EST)

branch: externals/consult
commit fbfb30a473786424812ab44045df31b31c1cb1d5
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Clarify consult-grep docs regarding its usage of Emacs regexp syntax (See 
#476)
---
 README.org | 16 ++++++++++------
 consult.el | 19 ++++++++++++-------
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/README.org b/README.org
index 8c581b4..507629d 100644
--- a/README.org
+++ b/README.org
@@ -244,8 +244,10 @@ their descriptions.
    term. After at least =consult-async-min-input= characters, the search gets
    started. Consult splits the input string into two parts, if the first
    character is a punctuation character, like =#=. For example
-   =#grep-regexps#filter-string=, is split at the second =#=. The string
-   =grep-regexps= is passed to Grep. If you enter multiple regular expressions
+   =#regexps#filter-string=, is split at the second =#=. The string =regexps= 
is
+   passed to Grep. Note that Consult transforms Emacs regular expressions to
+   expressions understand by the search program. Always use Emacs regular
+   expressions at the prompt. If you enter multiple regular expressions
    separated by space only lines matching all regular expressions are shown. In
    order to match space literally, escape the space with a backslash. The
    =filter-string= is passed to the /fast/ Emacs filtering to further narrow 
down
@@ -509,10 +511,10 @@ their descriptions.
 
  Consult has support for asynchronous generation of candidate lists. This
  feature is used for search commands like =consult-grep=, where the list of
- matches is generated dynamically while the user is typing a grep regular
- expression. The grep process is executed in the background. When modifying the
- grep regular expression, the background process is terminated and a new 
process
- is started with the modified regular expression.
+ matches is generated dynamically while the user is typing a regular 
expression.
+ The grep process is executed in the background. When modifying the regular
+ expression, the background process is terminated and a new process is started
+ with the modified regular expression.
 
  The matches, which have been found, can then be narrowed using the installed
  Emacs completion-style. This can be powerful if you are using for example the
@@ -536,6 +538,8 @@ their descriptions.
 
  - =#defun=: Search for "defun" using grep.
  - =#consult embark=: Search for both "consult" and "embark" using grep.
+ - =#\(consult\|embark\)=: Search for "consult" or "embark" using grep. Note 
the
+   usage of Emacs-style regular expressions.
  - =#defun#consult=: Search for "defun" using grep, filter with the word
    "consult".
  - =/defun/consult=: It is also possible to use other punctuation
diff --git a/consult.el b/consult.el
index 409188c..2f628c2 100644
--- a/consult.el
+++ b/consult.el
@@ -4231,13 +4231,18 @@ INITIAL is inital input."
 (defun consult-grep (&optional dir initial)
   "Search for regexp with grep in DIR with INITIAL input.
 
-The input string is split, the first part of the string is passed to
-the asynchronous grep process and the second part of the string is
-passed to the completion-style filtering. The input string is split at
-a punctuation character, which is given as the first character of the
-input string. The format is similar to Perl-style regular expressions,
-e.g., /regexp/. Furthermore command line options can be passed to
-grep, specified behind --.
+The input string is split, the first part of the string is passed to the
+asynchronous grep process and the second part of the string is passed to
+the completion-style filtering. Note that the input string is
+transformed from Emacs regular expressions to Posix regular expressions
+Always enter Emacs regular expressions at the prompt. `consult-grep'
+behaves like builtin Emacs search commands (Isearch etc) which take
+Emacs regular expressions.
+
+The input string is split at a punctuation character, which is given as
+the first character of the input string. The format is similar to
+Perl-style regular expressions, e.g., /regexp/. Furthermore command line
+options can be passed to grep, specified behind --.
 
 Example: #async-regexp -- grep-opts#filter-string
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]