7

是否有 GNU emacs 的 func-menu 等价物?当我可以访问 xemacs 时,我使用了 func-menu,我更喜欢它的行为而不是 speedbar 或 sr-speedbar。具体来说:

  • 我喜欢只显示当前文件的功能。

  • 函数列表可以从当前帧中弹出,而不是我可能已经掩盖的单独窗口。

  • 当前函数名称显示在模式行中。

是否有更接近 func-menu 的 GNU emacs 软件包?

4

3 回答 3

8

imenu将是 GNU Emacs 中的类似功能。

C-hf imenu-add-menubar-index RET
您可以在模式挂钩中调用它以获得imenu支持的模式。

自然是支持 elisp 的,所以快速演示一下:

  • M-x find-library RET imenu RET
  • M-x imenu-add-menubar-index RET

然后在菜单栏中看到新的“索引”项,以及C-<mouse3>

当然还有一个键盘界面,只需调用M-x imenu RET(使用 TAB 完成),但我强烈建议添加ido可以在EmacsWiki * 上找到的集成——我发现它通常是比使用鼠标更快的界面。

有关更多详细信息,请参阅C-hig (elisp) Imenu RET

配置见M-x customize-group RET imenu RET

(*) 以及许多其他增强功能的方法,因此即使您不想使用ido,在您看到基本版本的实际操作后,您绝对应该阅读该 Wiki 页面。

于 2012-05-31T11:21:46.173 回答
3

Is this the XEmacs func-menu mode you're talking about? It gives you a list of functions in the current file.

If so, then you can mostly replicate the functionality in GNU Emacs with the Collection of Emacs Development Tools, CEDET (specifically the Semantic code parser), and the Emacs Code Browser, ECB.

  • The ECB Methods window shows you all the symbols in the selected source code buffer. It is a separate window in the Emacs sense - that is, a editing area showing a single buffer, several of which can be within a single window-manager window. It is not a Emacs frame so it won't be covered up.
  • Semantic's stickyfunc-mode can show the current function in a line at the top of your source code buffer. It uses the GNU Emacs-specific header line feature. This is not quite the same as showing the function name in the mode line, but close enough.

Note that ECB requires CEDET and both tend to be tricky to install without XEmacs's package manager.

于 2012-01-20T21:15:25.867 回答
0

我不确定,但我认为“跳转到缓冲区内的函数”被称为烟雾模式。如果是这样,搜索烟雾模式的模拟可能会帮助您将您正在寻找的东西归零。

XEmacs这是手册中提到烟雾模式的摘录:

"41. 跳转到缓冲区内的函数。

假设你有一个文件,里面有很多函数。好吧,这个包可以很容易地跳转到任何这些功能。当前缓冲区中的函数名称会自动放入菜单栏菜单中,您选择其中一个函数名称并将点移至该函数。标记被推到标记环上,因此您可以轻松回到原来的位置。或者,您可以通过提供完整读取输入的 minibuffer 使用输入所需函数的名称。此外,点之前的函数名称可选地显示在模式行中。

支持以下模式:

Ada, Assembly, BibTex, C++, C, Dired, Ehdm, ELisp, FORTRAN, Ksh, Latex, Lelisp, Makefile, Maple, Modula2, Modula3, Outline, Objective-C, Pascal, Perl, Postscript, Prolog, PVS, Python, SGML、Scheme、Tcl、Verilog、手册、Ruby、JavaScript

要安装此软件包,请将以下内容添加到您的初始化文件中:

(add-hook 'find-file-hooks 'fume-setup-buffer)

(add-hook 'Manual-mode-hook 'turn-on-fume-mode)"
于 2012-05-31T11:08:11.420 回答