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: scroll buffer so that current line becomes first visible line Date: Fri, 24 Apr 2009 18:35:25 +1000 Organization: Rapt Technologies Message-ID: <87iqku1mb6.fsf@lion.rapttech.com.au> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1240562462 794 80.91.229.12 (24 Apr 2009 08:41:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Apr 2009 08:41:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 24 10:42:22 2009 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 1LxGz8-0006zz-5D for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Apr 2009 10:42:14 +0200 Original-Received: from localhost ([127.0.0.1]:41656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxGxj-0002Jr-1m for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Apr 2009 04:40:47 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!newshub.sdsu.edu!news.astraweb.com!border5.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) Cancel-Lock: sha1:bLCSZ6+bzWrSt36270iEfv0n3x8= Original-Lines: 26 Original-NNTP-Posting-Host: c95e2a8a.news.astraweb.com Original-X-Trace: DXC=DBcGP3:cVkF^MAbH1]K; 0BL?0kYOcDh@J3jG[IJI 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:64002 Archived-At: Will Willis writes: > Hello, Is there a command/key binding to scroll my buffer so that the > current line (the one with my cursor) becomes the first visible line > in the window. This is akin to C-l, but instead of centering to the > point, sticking the current line at the top of the window. I'm _not_ > looking to move the point to the first line (M-0 M-r). > > I'm not sure how this would work for shorter files, say only a few > lines long, would a buffer who's length is shorter than the window > height be able to scroll? > maybe of no real help, but.... Emacs 23 (CVS emacs) has re-worked C-l. When you press it the first time, it centers (old behavior). Press it again and the line is put at the top of the buffer, hit it a third time and it goes to the bottom. I've found it really useful. It may be possible to retro-fit it to emacs 22? Tim -- tcross (at) rapttech dot com dot au