GNU bug report logs - #29321
Isearch hit count

Previous Next

Package: emacs;

Reported by: charles <at> aurox.ch (Charles A. Roelli)

Date: Thu, 16 Nov 2017 19:28:02 UTC

Severity: wishlist

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Live System User <nyc4bos <at> aol.com>
Cc: 29321 <at> debbugs.gnu.org
Subject: bug#29321: Isearch hit count
Date: Sun, 04 Nov 2018 02:04:52 +0200
>   Now that you have the count, would it be posible to add a
>   command to specify which occurane of a match to go to and/or
>   highlight?
>
>   Lets say there are 100 matches.  I search through them and wind
>   up at 42/100.  I stop seaching and do something else.  I decide
>   I want to go back to my previous search.  It would be very handy
>   to have a command to do "goto match 42" or "goto match 67" or
>   "goto match last-match" .e.g. go directly to 100/100 (since 100
>   is the last found numbered match reported by isearch) and I would
>   then see the 100th match highlighted and the indicator displaying
>   "100/100".
>
>   Let me know if this should be a separate enhancement request.

Thanks for the enhancement request.  This is possible to do with
this patch.  It allows to go to the beginning of the buffer and type
'C-s C-4 C-2 C-s', and it will go to the 42th match using the
previous search string:

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 580b3ac40a..2dbb890d88 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1563,15 +1572,19 @@ isearch-repeat
   (isearch-push-state)
   (isearch-update))
 
-(defun isearch-repeat-forward ()
-  "Repeat incremental search forwards."
-  (interactive)
-  (isearch-repeat 'forward))
+(defun isearch-repeat-forward (&optional arg)
+  "Repeat incremental search forwards.
+With a prefix argument, repeat a search ARG times."
+  (interactive "p")
+  (dotimes (_ (or arg 1))
+    (isearch-repeat 'forward)))
 
-(defun isearch-repeat-backward ()
-  "Repeat incremental search backwards."
+(defun isearch-repeat-backward (&optional arg)
+  "Repeat incremental search backwards.
+With a prefix argument, repeat a search ARG times."
   (interactive)
-  (isearch-repeat 'backward))
+  (dotimes (_ (or arg 1))
+    (isearch-repeat 'backward)))
 
 
 ;;; Toggles for `isearch-regexp-function' and `search-default-mode'.




This bug report was last modified 6 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.