From: "Daniel Martín" <mardani29@yahoo.es>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Hongyi Zhao <hongyi.zhao@gmail.com>,
help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Automatically highlight all same occurrence of same stuff which has been currently marked/selected.
Date: Mon, 22 May 2023 13:16:53 +0200 [thread overview]
Message-ID: <m1y1lgsjiy.fsf@yahoo.es> (raw)
In-Reply-To: <87cz2udugp.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 21 May 2023 07:17:26 +0000")
Philip Kaludercic <philipk@posteo.net> writes:
>
> I have this command
>
> ;;;; Search the selected region
> (defun site/isearch-region (start end)
> "Start isearch with the contents between START and END."
> (interactive (if (use-region-p)
> (list (region-beginning) (region-end))
> (user-error "No region")))
> (when (and start end)
> (deactivate-mark)
> (isearch-mode t)
> (isearch-yank-string (buffer-substring start end))))
>
> (global-set-key (kbd "M-s M-s") #'site/isearch-region)
>
> that searches for whatever is selected. That also highlights every
> occurrence.
>
And, since Emacs 28.1, one can select the region and press M-s
M-. (`isearch-forward-thing-at-point`). By default, Emacs will try to
search for the active region first (see `isearch-forward-thing-at-point`
to customize this behavior).
next prev parent reply other threads:[~2023-05-22 11:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-21 0:47 Automatically highlight all same occurrence of same stuff which has been currently marked/selected Hongyi Zhao
2023-05-21 1:13 ` Michael Heerdegen
2023-05-21 1:44 ` Hongyi Zhao
2023-05-21 7:17 ` Philip Kaludercic
2023-05-22 11:16 ` Daniel Martín [this message]
2023-05-25 13:27 ` Rudolf Adamkovič
2023-05-25 14:29 ` Hongyi Zhao
2023-05-25 14:35 ` tomas
2023-05-25 15:31 ` Daniel Martín
2023-05-26 11:47 ` Rudolf Adamkovič
2023-05-26 12:26 ` Hongyi Zhao
2023-05-26 12:38 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m1y1lgsjiy.fsf@yahoo.es \
--to=mardani29@yahoo.es \
--cc=help-gnu-emacs@gnu.org \
--cc=hongyi.zhao@gmail.com \
--cc=philipk@posteo.net \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.