开发者

Google-like search info for Emacs

开发者 https://www.devze.com 2023-03-28 04:38 出处:网络
Is there a package/function to search info pages from emacs similarly to web search? I mean you just give few words, and the emacs returns you all the pages with these words. The words can be in any o

Is there a package/function to search info pages from emacs similarly to web search? I mean you just give few words, and the emacs returns you all the pages with these words. The words can be in any order, maybe use fuzzy match etc., regexp does not help a lot in this case. The similar question is discussed in http://www.emacswiki.org/emacs/SearchNear but I'm not satisfied with the solution. Does anybody know more general software?

Ideally, such kind o开发者_运维问答f search should handle not only info pages, but any source, for example all open buffers.


I think that you may be looking for info-apropos which you can call with M-x info-apropos. This performs a full-text search of the info files and returns a hyperlink list of sections containing the word.

I don't think that it does multiple words like a search engine, but it may get you started.


Anything.el has a configuration for searching Info pages. It's called anything-c-info-pages and looks like it searches for info topics, so it's not exactly what you want, but if you know elisp then you can copy this source and easily modify it to perform full text search instead.

If you don't know Anything then here's an introduction and an other one about creating your own sources for it.


For a more powerful and flexible alternative see Emacs Anything. To fetch it do

git clone git://repo.or.cz/anything-config.git ~/anything-config

in your terminal. Then add the following code snippet to your Emacs configuration file ~/.emacs:

(byte-recompile-directory "~/anything-config")
(add-to-list 'load-path "~/anything-config" t)
(load "~/anything-config/anything.elc")
(load "~/anything-config/anything-config.elc")

Finally run it using M-x anything.

I prefer to bind it to Alt-X by adding the following line to ~/.emacs.:

(global-set-key (kbd "M-X") 'anything)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号