emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get a fixed search string into the editable area of an isearc


From: Robert Weiner
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

On Sat, Jun 4, 2016 at 5:46 PM, Juri Linkov <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]