如何在emacs中找到丢失或不匹配的大括号/括号? [英] How can I find missing or mismatched braces / parens in emacs?

查看:154
本文介绍了如何在emacs中找到丢失或不匹配的大括号/括号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案(1)当我的代码无法编译并且告诉我可能丢失一个封闭的大括号时,是否有一种简单的方式在emacs中找到它?

对于C,C ++和Java等语言,命令 check-parens 将检查括号(()),括号( [] )和大括号( {} ):

  Mx check-parens< RET> 

该点将移动到不匹配的包围字符,状态行将报告问题。



与其他人一样,将这一点与 show-paren-mode 一起使用是个好主意。 p>

When my code fails to compile and tells me that I am likely missing a closed brace, is there an easy way to find it in emacs?

解决方案

For languages like C, C++, and Java, the command check-parens will check parens (()), brackets ([]), and braces ({}):

M-x check-parens <RET>

The point will move to a bracketing character that is unmatched, and the status line will report the problem.

It's a good idea to use this in conjunction with show-paren-mode as others have said.

这篇关于如何在emacs中找到丢失或不匹配的大括号/括号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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