From: Gregory Heytings <gregory@heytings.org>
To: Juri Linkov <juri@linkov.net>
Cc: Ergus <spacibba@aol.com>, 47599-done@debbugs.gnu.org
Subject: bug#47599: 28.0.50; Feature request improve/update isearch
Date: Tue, 06 Apr 2021 21:32:51 +0000 [thread overview]
Message-ID: <acf6f0cd7e5595b11fe8@heytings.org> (raw)
In-Reply-To: <acf6f0cd7e01a47f33b5@heytings.org>
[-- Attachment #1: Type: text/plain, Size: 804 bytes --]
>>>> 1) Option or command to automatically go to the other end on exit.
>>>
>>> It seems the conclusion was that it should not be an option. As for a
>>> command, there were objections against binding it to a key, but
>>> without a keybinding such command has little sense.
>>
>> I attach a patch which implements these two "options" in isearch-exit.
>
> And of course my patch had an error ;-)
>
While we're improving isearch, there is another minor change that I think
would improve its behavior, namely to go to the next/previous match when
changing the search direction, instead of hitting the same match before
moving to the next/previous one with the next C-s/C-r. This change is so
small that I'm not sure it's worth creating a defcustom for it, but you
might have a different opinion.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=0001-Find-another-match-when-changing-direction-in-isearc.patch, Size: 932 bytes --]
From 63e74e7a06df1ebf05061328de7edb1b5f9f8200 Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Tue, 6 Apr 2021 21:24:47 +0000
Subject: [PATCH] Find another match when changing direction in isearch.
* lisp/isearch.el (isearch-repeat): Move point to the other end when
changing direction, to find another match.
---
lisp/isearch.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index a828c569aa..7241b6b319 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1847,6 +1847,7 @@ Use `isearch-exit' to quit without signaling."
(funcall isearch-wrap-function)
(goto-char (if isearch-forward (point-min) (point-max))))))
;; C-s in reverse or C-r in forward, change direction.
+ (if isearch-other-end (goto-char isearch-other-end))
(setq isearch-forward (not isearch-forward)
isearch-success t))
--
2.30.2
next prev parent reply other threads:[~2021-04-06 21:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210405020725.ob7bewlin7cid4pa.ref@Ergus>
2021-04-05 2:07 ` bug#47599: 28.0.50; Feature request improve/update isearch Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-06 19:16 ` Juri Linkov
2021-04-06 20:38 ` Gregory Heytings
2021-04-06 21:01 ` Gregory Heytings
2021-04-06 21:32 ` Gregory Heytings [this message]
2021-04-06 22:39 ` bug#47599: [External] : " Drew Adams
2021-04-06 22:43 ` Gregory Heytings
2021-04-06 23:26 ` Gregory Heytings
2021-04-07 16:20 ` Juri Linkov
2021-04-07 17:58 ` Gregory Heytings
2021-04-08 19:05 ` Juri Linkov
2021-04-07 2:29 ` Eli Zaretskii
2021-04-07 10:44 ` Gregory Heytings
2021-04-07 11:20 ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-04-07 11:33 ` Gregory Heytings
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=acf6f0cd7e5595b11fe8@heytings.org \
--to=gregory@heytings.org \
--cc=47599-done@debbugs.gnu.org \
--cc=juri@linkov.net \
--cc=spacibba@aol.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).