[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get isearch-string, but only if I was in isearch?
From: |
Marcin Borkowski |
Subject: |
Re: How to get isearch-string, but only if I was in isearch? |
Date: |
Mon, 13 Feb 2017 06:09:43 +0100 |
User-agent: |
mu4e 0.9.19; emacs 26.0.50.3 |
On 2017-02-13, at 02:41, Michael Heerdegen <michael_heerdegen@web.de> wrote:
> Marcin Borkowski <mbork@mbork.pl> writes:
>
>> Is there a way for an Emacs command to "know" that isearch was active
>> when it was invoked?
>
> Looking at how things are implemented...maybe there isn't.
Well, after I sent my message, it occurred to me that I could check if
the first 7 characters of (symbol-name last-command) are "isearch". Not
exactly a clean method (neither extremely reliable), but might work.
>> (I could use an approach similar to the above, but with a longer list
>> of commands, including most/all things from isearch-mode-map, but this
>> seems fragile and far from elegant.)
>
> Maybe you could use `isearch-mode-end-hook' in some clever way?
Hm. I could use it to set 'this-command to 'isearch. I wonder what
could break then, though...
> Regards,
>
> Michael.
Thanks a lot!
--
Marcin Borkowski