[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
Re: How to get a fixed search string into the editable area of an isearch.
Thu, 02 Jun 2016 00:21:47 +0200
Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (gnu/linux)
Robert Weiner <address@hidden> writes:
> I have a need for a command that starts an isearch with a specific
> string in the editable area that I can add and subtract characters
> from interactively during the search. I have things working with the
> following code except the string does not appear in the editable area
> even though the search is done for the fixed string. Can anyone solve
> this? I couldn't get any of the isearch-yank-* commands to do the
> right thing here either. Please help. Thanks.
I'm just a user like you, but figured out some missing elements I think.
(defun my-isearch-for-string ()
(cons (lambda ()
(setq isearch-string "test"
You probably want to add your updating of the search ring and other
AFAICT, the text displayed in the minibuffer is (based on) the current
binding of the variable `isearch-message', and it is up to you to update
it properly (it doesn't happen automatically).
`isearch-search-and-update' triggers, yes, what it says.
I'm not sure why isearch-yank-flag -> t was useful, a comment in my code
| ;; Don't move cursor in reverse search.
BTW, in your code:
(let* ((match-str "fixed-string")
(append '((lambda () (interactive) (setq isearch-string match-str)))
there is a quoted lambda; it's better to avoid quoted lambdas for