如何知道一个缓冲区位置对应的行号?
当 Emacs 报错时,它总是显示带有缓冲区位置的代码,用它来查找确切的单词位置非常不方便。
有什么方法可以知道缓冲区位置的确切行号吗?
When Emacs reports error it always show code with a buffer position, with which it is quite unconvenient to find out where the exact words locate.
It there any way to know the exact line number of the buffer position?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Cx = 绑定到
what-cursor-position
; 显示当前位置。Cx l 绑定到
count-lines-page
; 显示页面上点之前和之后的行数,以及页面上的总行数(其中“页面”跨越两个分页符^L
之间的行)。Mx 绑定到
what-line
; 显示当前行的行号(以及缩小的点的行号,如果适用)。但我认为你想要的是
Mx
goto-char
RET它可以让你去到位置当前缓冲区中的
。C-x = Bound to
what-cursor-position
; shows the current position.C-x l Bound to
count-lines-page
; shows how many lines are before and after point on page, and total number of lines on page (where "page" spans lines between two page-break symbols^L
).M-x Bound to
what-line
; shows line number of current line (and narrowed line number of point, if applicable).But I think what you want is
M-x
goto-char
RET<pos>
which lets you go to position
<pos>
in the current buffer.看来您需要 Goto line: Mg g
缓冲区位置的确切行号显示在 Emacs 缓冲区的状态行中。
It seems you need Goto line: M-g g
The exact line number of the buffer position is shown in the status line of your Emacs buffer.