From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: scroll buffer so that current line becomes first visible line Date: Fri, 24 Apr 2009 18:28:58 +0300 Organization: SunSITE.dk - Supporting Open source Message-ID: <8763gugjet.fsf@kobe.laptop> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1240591358 1855 80.91.229.12 (24 Apr 2009 16:42:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Apr 2009 16:42:38 +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 18:43:58 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 1LxOTZ-0001YK-Pa for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Apr 2009 18:42:09 +0200 Original-Received: from localhost ([127.0.0.1]:59795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxOSA-0005TD-DM for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Apr 2009 12:40:42 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!goblin2!goblin.stu.neva.ru!news.net.uni-c.dk!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) Cancel-Lock: sha1:XyLNnr680CSgqmszEnUL9qS9t08= Original-Lines: 15 Original-NNTP-Posting-Host: 77.49.226.3 Original-X-Trace: news.sunsite.dk DXC=1>; ^B5eOdQhO3d^23S\Y2mYSB=nbEKnkkf2; 89Q0P2=bL^MjgbH?lJH1Tkjlm2Xee=P_CZcoG3`F@Mfk5k Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:168734 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:64007 Archived-At: On Thu, 23 Apr 2009 21:18:20 -0500, Will Willis wrote: > 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? `C-l' works with a prefix too, so you can type `C-u 0 C-l' to redisplay the buffer with the current line on top, or `C-u 30 C-l' to redisplay everything and move the current line at line 30.