emacs - 在 Emacs 中动态显示/隐藏菜单栏

标签 emacs menu elisp menubar

我有 menu-bar-open绑定(bind) f11 并关闭菜单栏,因此,f11 调用 tmm-menubar ,这很不方便,并且由于某种原因没有特定于模式的菜单项(例如 org-mode 中的 org 和 tbl )。我希望它以这种方式运行:使菜单栏可见,使用户能够选择菜单项,然后再次使菜单栏不可见。

最惯用和最优雅的方式是什么?

我考虑过编写建议,但 Emacs 开发人员通常不建议这样做,因为它会导致调试问题,而且标准 Emacs 代码不包含建议。

我在 GUI 中使用 Emacs 24.1。

最佳答案

在 Emacs-24 中,您可以简单地这样做:

(global-set-key [f9] 'toggle-menu-bar-mode-from-frame)
  • 不确定 Emacs 24 之前的版本。
  • 请确保 f9 在您的安装中确实可用。
  • 关于emacs - 在 Emacs 中动态显示/隐藏菜单栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11176138/

    相关文章:

    emacs - 这是从 .emacs 加载用户 .el 文件的正确 Emacs (24.3.2) lisp 样式吗?

    emacs - 最常见的 EMACS 命令是什么?

    python - 在 emacs 中以 comint 模式执行带有参数的 python 脚本

    emacs - 使用 org-mode 折叠/展开 .emacs 文件的部分

    python - 如何在 org 模式下设置 python env

    点等于之前的 emacs 字符

    css - 选择元素的父元素

    Powershell 控制台菜单选项 - 需要添加换行符吗?

    javascript - 无法使用媒体查询隐藏固定菜单

    emacs - 如何在 elisp 中捕获 shell 命令的标准输出?