ubuntu的Linux,在emacs23中打算去到某一行,使用M-g 或者 M-x goto-line 命令却起不到作用。
在如下的链接中,找到了答案。输入 M-g-g 命令, 就会 提示 Goto line: 在冒号后面输入目的行号就OK了。
http://www.stylesen.org/emacs_goto_line
原文如下:
Emacs goto line
I was reading through this post and thought I can share my recipe for the same problem. In the past (3 years back) I had the same difficulty of instructing emacs to goto a line. Each time I want to do that I need to "M-x" and type "goto-line" (tab completion is there). But this is annoying since I may need to do this 'n' number of times while writing code. I wanted a good short cut, I chose 'C-l' for this and hence came up with the following lines in my .emacs file which am so used to that in any system as soon as I open and read code in emacs, I keep pressing 'C-l' :)
;; Goto-line short-cut key
(global-set-key "\C-l" 'goto-line)
Though I learnt from Senthilkumaran's blog post comments that the default that comes along in emacs is 'M-g-g' (which works in Debian and Ubuntu boxes), but I somewhat feel it will take time for me to make my fingers learn this deafult.
Having said that, I ve put my .emacs file in the attachments of this post, which may help someone.