From: Marcin Borkowski <mbork@mbork.pl>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: How to get isearch-string, but only if I was in isearch?
Date: Mon, 13 Feb 2017 06:09:43 +0100 [thread overview]
Message-ID: <87h93yismg.fsf@mbork.pl> (raw)
In-Reply-To: <87poimkgtv.fsf@drachen>
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
next prev parent reply other threads:[~2017-02-13 5:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-12 7:04 How to get isearch-string, but only if I was in isearch? Marcin Borkowski
2017-02-13 1:41 ` Michael Heerdegen
2017-02-13 5:09 ` Marcin Borkowski [this message]
2017-02-18 16:10 ` Marcin Borkowski
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h93yismg.fsf@mbork.pl \
--to=mbork@mbork.pl \
--cc=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).