用于调用“GUI 样式"的 Emacs M-x 命令菜单 [英] Emacs M-x commands for invoking "GUI-style" menus

查看:18
本文介绍了用于调用“GUI 样式"的 Emacs M-x 命令菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:在我的 Emacs 变体使用特定于操作系统的桌面功能的情况下,我如何找到在 Emacs 中执行基于 GUI 的操作的 M-x 等效命令?

Question: How could I find out the M-x equivalent commands for doing GUI-based operations in Emacs, in those cases where my Emacs-variant uses OS-specific desktop functionality?

背景: 传统的理解是,Emacs 中的一切都是命令,只要知道命令的名称,就可以通过 M-x 调用命令.假设这个陈述是正确的,那么在基于桌面"的 Emacs 变体中,如何找到用于触发GUI 样式"菜单的命令名称?

Background: Conventional understanding states that everything in Emacs is a command, and that commands can be invoked via M-x, as long as you know the name of the command. Assuming this statement is correct, what is the way to find the name of the commands used to trigger the "GUI-style" menus in a "desktop" based Emacs variant?

例如,如果我要通过鼠标选择文件"菜单来打开文件,则会弹出特定于操作系统的GUI"样式的文件打开对话框,等待我的输入.

For example, if I were to mouse-select the File menu to open a file, the OS-specific "GUI" style file-open dialog pops up, waiting for my input.

我怎样才能找到做同样事情的 M-x 等效命令?

How could I find out the M-x equivalent command for doing the exact same thing?

认为 describe-key 会告诉我我需要知道什么,但它是使用的指示:

I thought that describe-key would tell me what I needed to know, but it's indication to use:

M-x menu-find-file-existing

不调用GUI"样式的文件打开对话框.相反,它使用 Emacs 内部的非 GUI-OS-neutral 变体.

doesn't invoke the "GUI" style file-open dialog. Instead, it uses the Emacs internal non-GUI-OS-neutral variant.

推荐答案

你需要诱使 Emacs 认为键盘没有被使用,这不像诱使它认为鼠标 那样直观/em> 已使用.:)

You need to trick Emacs into thinking that the keyboard was not being used, which is not as intuitive as tricking it into thinking that the mouse was used. :)

(defadvice find-file-read-args (around find-file-read-args-always-use-dialog-box act)
  "Simulate invoking menu item as if by the mouse; see `use-dialog-box'."
  (let ((last-nonmenu-event nil))
    ad-do-it))

在 WinXP 上的 Emacs 22.2.1 上测试.不过,我相信该范式已经存在了一段时间,因此它应该适用于较旧的 Emacs.不知道 XEmacs 是否类似地工作.

Tested on Emacs 22.2.1 on WinXP. I believe the paradigm has been around for a while, though, so it should work on older Emacs. No clue if XEmacs works similarly or not.

这篇关于用于调用“GUI 样式"的 Emacs M-x 命令菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆