Emacs Cc } 命令和括号匹配检查
我正在 Emacs 23 中工作,通过 AUCTeX 编辑 LaTeX。我注意到在 emacs 中,当我按 Cc }
时,我收到了迷你缓冲区消息
扫描错误:“括号不平衡”,16026、16440
问题 1. 该命令到底在做什么?
问题 2. 更一般地说,我如何确定给定的宏正在做什么?例如,是否存在一个通用命令,该命令请求键盘快捷键作为输入并输出该快捷键所绑定的命令的描述?是否有所有活动键盘快捷键的列表?
问题 3. 如何找到不匹配的括号? 此处的帖子推荐了命令Mx check-parens
,但它对我没有任何帮助,甚至没有迷你缓冲区消息。
I am working in Emacs 23, editing LaTeX via AUCTeX. I noticed in emacs that when I press C-c }
, I receive the minibuffer message
Scan error: "Unbalanced parentheses", 16026, 16440
Question 1. What exactly is this command doing?
Question(s) 2. More generally, how can I determine what I a given macro is doing? Is there, for example, a universal command that request the keyboard shortcut as an input and outputs a description of the command to which that shortcut is bound? Is there a list of all active keyboard shortcuts?
Question 3. How can I find my unmatched parentheses? The post here recommends the command M-x check-parens
, but it availed me nothing, not even a minibuffer message.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1 和 2 的答案是执行
Ch k Cc }
并查看帮助缓冲区告诉您的内容。这是允许我们将 Emacs 称为自文档编辑器的功能之一。不要忘记,您可以通过帮助缓冲区中的链接访问实现此函数的源代码和其他文档。您可能还想使用
Ch m
查看当前启用的主要和次要模式添加的所有按键绑定,并使用Ch ?
查看还有哪些其他有趣的帮助功能是。我从未专门使用过 check-parens,但它确实在我当前的缓冲区(即 javascript)中工作。我从它的文档(
Ch f check-parens
)中看到它依赖于当前的语法表,因此对于 TeX 来说,语法表可能没有包含足够的信息用于check-syntax
code> 来查找错误。The answer to 1 and 2 is to do
C-h k C-c }
and see what the help buffer tells you. This is one of the features that allows us to call Emacs a self-documenting editor. Don't forget that you can follow the links in the help buffer to both the source code where this function is implemented and to other documentation.You may also want to use
C-h m
to see all the key bindings added by the major and minor modes that are currently enabled andC-h ?
to see what other interesting help functions there are.I've never used
check-parens
specifically, but it does work in my current buffer, which is javascript. I see from its documentation (C-h f check-parens
) that it relies on the current syntax table, so perhaps for TeX the syntax table doesn't contain enough information forcheck-syntax
to find the error.