如何整合 isearch 模式中发生的任何事情
我非常喜欢 anything.el
。一切 UI 都很棒。
我也经常使用 isearch
,它提供了键绑定 Ms o 以使用 isearch
输入字符串调用 occurr
。但本机发生模式还不够强大。
在occurr-mode
中,您无法再次过滤结果。跳跃功能也是基本的。
我发现 anything-occur
比 < code>occurr,你可以过滤结果,以任何方式跳转一个位置。
但有一个问题,如何集成anything-occurr
?我的最后一次尝试是:
(defun occur-in-isearch ()
(interactive)
(let ((case-fold-search isearch-case-fold-search))
(occur (if isearch-regexp isearch-string (regexp-quote isearch-string)))))
我用 anything-occurr
替换 occurr
,但没有用。 anything-occurr
是一个不带参数的 defun。我无法将 isearch 字符串传递给 anything-occurr
。
我如何集成anything-occurr
?或者是否有更好的方法在isearch-mode
中使用anything-occurr
?
I like anything.el
a lot. The anything UI is wonderful.
I also use isearch
very often, and it provides the keybinding M-s o to invoke occur
using the isearch
input string. But native occur mode is not powerful enough.
In occur-mode
you cannot filter result again. And jumping function is basic too.
I find anything-occur
is more powerful than occur
, you can filter result, jump a position in anything style.
But there is a problem , How to integrate anything-occur
? My last attempt is:
(defun occur-in-isearch ()
(interactive)
(let ((case-fold-search isearch-case-fold-search))
(occur (if isearch-regexp isearch-string (regexp-quote isearch-string)))))
I replace occur
with anything-occur
, but it is no use. anything-occur
is a defun which takes no parameters. I cannot pass the isearch string to anything-occur
.
How might I integrate anything-occur
? Or is there a better way to use anything-occur
within isearch-mode
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不是任何东西的用户,但是这段代码可以完成你想要的 99% 的事情。唯一需要注意的是,当您键入 backspace 时,初始输入字符串不会正确更新。我不知道为什么会这样。其他一切似乎都按预期工作。
I'm not a user of anything, but this code does 99% of what you want. The only caveat is that the initial input string doesn't get properly updated when you type backspace. I don't know why that is. Everything else works seems to work as expected.
非常相似——
在Icicles中,在Isearch期间点击
S-TAB
。按RET
接受相同的搜索模式,或先对其进行编辑,然后按RET
。这将打开 Icicles 搜索,并将所有匹配项作为搜索上下文。要使用进一步的模式缩小/过滤这些上下文,只需输入更多文本即可。
要逐步过滤多个模式,请在模式之间点击
M-SPC
。使用C-down
(等)在匹配项之间循环,或完成其中任何一个,或在*Completions< 中的任何一个上单击
C-mouse-2
/代码>。http://www.emacswiki.org/emacs/Icicles_-_Isearch_Enhancements#IciclesSearchFromIsearch
Very similar --
In Icicles, during Isearch hit
S-TAB
. HitRET
to accept the same search pattern, or edit it first and then hitRET
.That opens Icicles search with all matches as the search contexts. To narrow/filter those contexts with a further pattern, just type more text.
To filter progressively with multiple patterns, hit
M-SPC
between patterns. Cycle among the matches usingC-down
(etc.) or complete to any of them or clickC-mouse-2
on any of them in*Completions
.http://www.emacswiki.org/emacs/Icicles_-_Isearch_Enhancements#IciclesSearchFromIsearch