From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Go to line Date: Tue, 24 Apr 2007 20:45:28 +1000 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <87odlevynr.fsf@lion.rapttech.com.au> References: <1177340103.887135.165610@p77g2000hsh.googlegroups.com> <1177340898.990872.278280@o5g2000hsb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177414564 29123 80.91.229.12 (24 Apr 2007 11:36:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Apr 2007 11:36:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 24 13:36:01 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HgJJR-00049e-2k for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Apr 2007 13:36:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HgJOw-0003fm-8b for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Apr 2007 07:41:42 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!feeder.news-service.com!newsgate.cistron.nl!xs4all!news.wiretrip.org!feeder1.cambrium.nl!feed.tweaknews.nl!138.199.65.86.MISMATCH!sn-xt-ams-06!sn-xt-ams-05!sn-ams!sn-feed-ams-01!sn-post-ams-02!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) Cancel-Lock: sha1:pY/c3sKnLjOTTJulDpCPC7WULtg= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 42 Original-Xref: shelby.stanford.edu gnu.emacs.help:147458 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:43064 Archived-At: james writes: > On Apr 23, 9:55 am, PAolo 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