[Top][All Lists]

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

master 7320a812e9: Wrap around the search on typing a letter (bug#56535)

From: Juri Linkov
Subject: master 7320a812e9: Wrap around the search on typing a letter (bug#56535)
Date: Mon, 1 Aug 2022 15:19:38 -0400 (EDT)

branch: master
commit 7320a812e9e0624480406309a3cad18db38ff87a
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    Wrap around the search on typing a letter (bug#56535)
    * doc/emacs/search.texi (Repeat Isearch): Improve values no/no-ding.
    * lisp/isearch.el (isearch-search-and-update): Try to repeat the search
    on an error when isearch-wrap-pause is no/no-ding.
 doc/emacs/search.texi | 5 +++--
 etc/NEWS              | 5 +++++
 lisp/isearch.el       | 4 +++-
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 27d4db8541..582e764c55 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -228,8 +228,9 @@ customizing the @code{isearch-wrap-pause} user option.  If 
it is
 @code{t} (the default), signal an error.  (Repeating the search will
 wrap around.)  If @code{no}, issue a @code{ding} and wrap immediately
 after reaching the last match.  If @code{no-ding}, wrap immediately,
-but don't @code{ding}.  Finally, if @code{nil}, never wrap, but just
-stop at the last match.
+but don't @code{ding}.  With the values @code{no} and @code{no-ding}
+the search will try to wrap around also on typing a character.
+Finally, if @code{nil}, never wrap, but just stop at the last match.
 @cindex search ring
 @findex isearch-ring-advance
diff --git a/etc/NEWS b/etc/NEWS
index b011413cbc..7aff7921f9 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1457,6 +1457,11 @@ outside the echo area, Emacs will, by default, end the 
Isearch and
 yank the text at mouse cursor.  But if 'mouse-yank-at-point' is
 non-nil, the text will now be added to the Isearch instead.
+*** Changes for values 'no' and 'no-ding' of 'isearch-wrap-pause'.
+Now with these values the search will wrap around not only on repeating
+with 'C-s C-s', but also after typing a character.
 *** New user option 'char-fold-override'.
 Non-nil means that the default definitions of equivalent characters
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 8f480a87d9..336c5f1bde 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2838,7 +2838,9 @@ The command accepts Unicode names like \"smiling face\" or
                            (1+ isearch-other-end)))))
-      ))
+      (when (and (memq isearch-wrap-pause '(no no-ding))
+                 (not isearch-success))
+        (isearch-repeat (if isearch-forward 'forward 'backward)))))
   (if isearch-op-fun (funcall isearch-op-fun))

reply via email to

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