From: Robert Weiner <rsw@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: How to get a fixed search string into the editable area of an isearch.
Date: Sat, 4 Jun 2016 18:42:10 -0400 [thread overview]
Message-ID: <CA+OMD9gnn6NE4kUhjd1zibQ56gVCeeJv-U8m11akzZ9SDq1_HQ@mail.gmail.com> (raw)
In-Reply-To: <871t4cd58e.fsf@mail.linkov.net>
[-- Attachment #1: Type: text/plain, Size: 898 bytes --]
On Sat, Jun 4, 2016 at 5:46 PM, Juri Linkov <juri@linkov.net> wrote:
>
> Maybe this is what you need?
>
> (defun isearch-for-string ()
> (interactive)
> (isearch-forward nil 1)
> (isearch-yank-string "test"))
>
Thank you. That is a nice clean-looking solution. I had tried
isearch-yank-string but missed the recursive-minibuffer argument to the
isearch-forward, without which it doesn't work at all which led me to think
that isearch-yank-string was not the right approach. The only limitation
with this solution is that if you start to delete search characters, the
entire search string provided to the yank is deleted at once rather than
character by character. A pretty minor limitation which is resolved by the
first solution, using unread-command-events.
Thanks to all, these have been very helpful and definitely should find some
place in the isearch documentation.
Bob
[-- Attachment #2: Type: text/html, Size: 1337 bytes --]
prev parent reply other threads:[~2016-06-04 22:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-31 19:13 How to get a fixed search string into the editable area of an isearch Robert Weiner
2016-06-01 5:07 ` Tom
2016-06-01 22:21 ` Michael Heerdegen
2016-06-04 21:46 ` Juri Linkov
2016-06-04 22:42 ` Robert Weiner [this message]
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=CA+OMD9gnn6NE4kUhjd1zibQ56gVCeeJv-U8m11akzZ9SDq1_HQ@mail.gmail.com \
--to=rsw@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.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.