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 20:38:49 +0000 [thread overview]
Message-ID: <acf6f0cd7e8e56885611@heytings.org> (raw)
In-Reply-To: <87mtubrzp3.fsf@mail.linkov.net>
[-- Attachment #1: Type: text/plain, Size: 340 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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff; name=0001-Add-options-when-exiting-isearch.patch, Size: 1537 bytes --]
From e7df31567e9175392a677c225825a4f2784376eb Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Tue, 6 Apr 2021 20:33:09 +0000
Subject: [PATCH] Add options when exiting isearch
* lisp/isearch.el (isearch-exit): Add two options when exiting isearch.
---
lisp/isearch.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 943e24aa56..a2ac4964d2 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1523,12 +1523,20 @@ REGEXP if non-nil says use the regexp search ring."
"Exit search normally.
However, if this is the first command after starting incremental
search and `search-nonincremental-instead' is non-nil, do a
-nonincremental search instead via `isearch-edit-string'."
+nonincremental search instead via `isearch-edit-string'.
+With a single prefix argument, move point to the beginning of the
+search string, unless the region is active.
+With two prefix arguments, activate the region around the match,
+unless the region is already active."
(interactive)
(if (and search-nonincremental-instead
(= 0 (length isearch-string)))
(let ((isearch-nonincremental t))
(isearch-edit-string)) ;; this calls isearch-done as well
+ (if (and (> arg 1) isearch-other-end (not (use-region-p)))
+ (if (> arg 4)
+ (push-mark isearch-other-end t 'activate)
+ (goto-char isearch-other-end)))
(isearch-done))
(isearch-clean-overlays))
--
2.30.2
next prev parent reply other threads:[~2021-04-06 20:38 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 [this message]
2021-04-06 21:01 ` Gregory Heytings
2021-04-06 21:32 ` Gregory Heytings
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=acf6f0cd7e8e56885611@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).