help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Go to line


From: Tim X
Subject: Re: Go to line
Date: Tue, 24 Apr 2007 20:45:28 +1000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux)

james <james.kingston@gmail.com> writes:

> On Apr 23, 9:55 am, PAolo <paolopanta...@gmail.com> wrote:
>> Hi,
>>
>> is there some faster way to go to a certain line, rather than
>> M-x goto-line ?
>> Can I specify a line number when I open a file with C-x C-f?
>>
>> THnx
>> PAolo
>
> In my emacs, it is bound to M-g M-g (as well as M-g g).  If it isn't
> in yours, check what it is bound to with C-h k, and if it's clear (or
> you're willing to override it), add this to your .emacs:
>
> (global-set-key (kbd "M-g M-g") 'goto-line)
>
> Or perhaps use this binding, which is not to be used by any major
> modes, by convention:
> (global-set-key (kbd "C-c g") 'goto-line)
>
> FWIW, you can find out if a function is bound to, if anything, by
> bringing up the command's documentation.  C-h a  for apropos-command,
> then "goto-line".
>
>

FYI, binding of goto-line to M-g M-g etc was introduced in CVS emacs (Emacs 22).
Priot to that, the function was not bound to any key sequence by default. Prior
to using emacs 22, I use to bind it to F6. 

I don't believe there is any way to specify a line to go to with C-x C-f.
However, it wouldn't be that hard to write your own interactive find file
function that did this for you and prompted for the line number. You could even
use defadvice to modify how find-file works. have a go, post your attempts and
then we will provide assistance if needed.

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]