Emacs Ch c 似乎不适用于 3 个和弦组合长?
我正在尝试在 emacs 中使用 Ch c
来找出组合键所绑定的内容。该组合是Cu Cc Cq
,它在组织模式下重新对齐标签。然而,Emacs 只是尝试查找 Cu Cc
,然后就失败了。我做错了什么?我意识到我可以轻松地查看 orgmode 源代码或其他东西来解决这个问题,但为了将来的参考,我会做什么来弄清楚这样的函数绑定到什么函数?
编辑:好的,所以它实际上是 Cu
后跟 Cc Cq
,根据 emacs,这就是该组合所绑定的内容:
(org-set-tags-command 和可选参数 just-align)
为当前条目调用 set-tags 命令。
那么给这个命令赋予参数 4 到底意味着什么呢?
哦,只是给出一个解释:我正在尝试开始学习 emacs-lisp 和自定义,我想做的一件事就是将此命令添加到 before-save-hook 中,以便当我保存 org 文件时,标签会自动对齐。
最终编辑:我弄清楚了为什么这个命令的行为如此;给定前缀参数,它会改变其行为。在 elisp 中调用函数时如何设置前缀参数?
I'm trying to use C-h c
in emacs to figure out what a key combination is bound to. The combination is C-u C-c C-q
, which realigns tags in org-mode. However, Emacs just tries to look up C-u C-c
and then fails. What am I doing wrong? I realize I could easily look at the orgmode source or something to figure this out, but for future reference what would I do to figure out what function something like this is bound to?
Edit: OK, so it's actually C-u
followed by C-c C-q
, and according to emacs this is what that combination is bound to:
(org-set-tags-command &optional arg just-align)
Call the set-tags command for the current entry.
So what exactly does it mean to give this command the argument 4?
Oh, just to give an explanation: I'm trying to start learning emacs-lisp and customization and one of the things I wanted to do was to have this command added to the before-save-hook so that when I save an org file, the tags get automatically aligned.
Final edit: I figured out why this command behaves as it does; given the prefix argument it changes its behavior. How can I set the prefix argument when calling the function in elisp?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于三个键长的组合来说,这不是一个普遍问题:例如,Ch c ESC ESC ESC(键盘转义退出)或 Ch c Cx rt(字符串矩形)都可以正常工作。
当我在组织模式下尝试 Ch c Cu Cc Cq 时,该命令在 Cu 之后中断并显示:
在迷你缓冲区中,这是正确的。所以,事实上,“Cu Cc Cq”不是一个命令,它是命令“Cc Cq”(org-table-wrap-region),以一个附加参数开头(4 - 请参阅 Ch k Cu 进行解释)。
It's not a general problem with combinations that are three keys long: For example, C-h c ESC ESC ESC (keyboard-escape-quit) or C-h c C-x r t (string-rectangle) both work fine.
When I try C-h c C-u C-c C-q in org-mode, the command interrupts after C-u and shows:
in the minibuffer, which is correct. So, in fact, "C-u C-c C-q" is not a command, it's the command "C-c C-q" (org-table-wrap-region) started with an additional argument (4 -- see C-h k C-u for an explanation).