From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xiao-Yong Jin Newsgroups: gmane.emacs.help Subject: Re: scroll buffer so that current line becomes first visible line Date: Thu, 23 Apr 2009 22:49:41 -0400 Message-ID: <87ljpqwyt6.fsf@columbia.edu> References: <6ee1e6090904231918h45f0416ap24fa9d775348b628@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1240541443 16146 80.91.229.12 (24 Apr 2009 02:50:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Apr 2009 02:50:43 +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 04:52:03 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 1LxBW8-0003B5-6g for geh-help-gnu-emacs@m.gmane.org; Fri, 24 Apr 2009 04:51:56 +0200 Original-Received: from localhost ([127.0.0.1]:45642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxBUi-0006Oc-RE for geh-help-gnu-emacs@m.gmane.org; Thu, 23 Apr 2009 22:50:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LxBUN-0006Nn-4L for help-gnu-emacs@gnu.org; Thu, 23 Apr 2009 22:50:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LxBUI-0006Kw-He for help-gnu-emacs@gnu.org; Thu, 23 Apr 2009 22:50:06 -0400 Original-Received: from [199.232.76.173] (port=35249 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LxBUI-0006Kk-9K for help-gnu-emacs@gnu.org; Thu, 23 Apr 2009 22:50:02 -0400 Original-Received: from jalapeno.cc.columbia.edu ([128.59.29.5]:63194) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LxBUH-0006M1-RE for help-gnu-emacs@gnu.org; Thu, 23 Apr 2009 22:50:01 -0400 Original-Received: from lattice (dyn-160-39-50-200.dyn.columbia.edu [160.39.50.200]) (user=xj2106 mech=PLAIN bits=0) by jalapeno.cc.columbia.edu (8.14.3/8.14.1) with ESMTP id n3O2nsO8016471 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Thu, 23 Apr 2009 22:49:55 -0400 (EDT) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEXcBwj0AgP8AADrysTUU1gp luy9AAACUklEQVQ4jW1U0bHjIAwUhgIs2QUYzgXgEQWYiP5ruhVO8u7NnD4yxMsirVZA2st/4jCq 2RdZfn2Xkig8y8y/oJyJh0dIqm0phQv+B2wrlE0R1X8DSCsWDadkyishmjJLzrzj6zoRYt9bWxM/ OM1vYHWh3CbDhux84DsjgDCAhOQtat+W4046ow4HIlad9yuGLHHWOHpGDhzFTPd52VKy0QzOMssN ueleDfn1fRQYZaX4WptZUwc+R0H5zbEDwD4I1sC0ojKBcpXYrG6pNjn0E21BjgVlXdu4msy+WfNf IbE73mkCaFDgsr2QFk0sLkOvOC6Fcq0AvNCFJH4YKkyksr32Nm75MtIFHbnEZXv96SgcOZDOqgMw agLIUtyoAB3V0hWXIhzDBESmDheINMs/OgAM3nseY+17OOwLMBVGK+GvGyTPrHDObm106x96STAm SxJMC3RgFHMaOqwjh/uJFt8ZOi7Uj/4t8dob6dtcCNzQtJtJg73OKkZo4xgE4PQNc99y1mL2ZZz6 7vUtp3ZLdqNjhO4eGoo7hxE/Mapg3FMgSpUJQMZem5GNgLregDuACk4AP4zDp2OfyZ0BHTStnYAw Zj72/WHom9HmXZK8XQD0Ue6Ms1Egb95k6DqBUN4CKzjmOTQ+RwHYPoAnV33GGsplqy4BJWvYa1Tj 7GkEfrz8MrsnYBxq4uZUWOvAvNqeI2tc1uYDCUb3ozBShqpYY8B1vQVG7Z/ksZ+KEUPngBQK8wVw wIdF+0CbOUF5z3M+/JaLL9ifmIwWtZ/HxWGR5zGyv9F0pEDk9NRcAAAAAElFTkSuQmCC Mail-Followup-To: help-gnu-emacs@gnu.org In-Reply-To: <6ee1e6090904231918h45f0416ap24fa9d775348b628@mail.gmail.com> (Will Willis's message of "Thu, 23 Apr 2009 21:18:20 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.65 on 128.59.29.5 X-detected-operating-system: by monty-python.gnu.org: Solaris 9 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:63996 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? Yes. From my emacs version 23.0.92 C-l runs the command recenter-top-bottom, which is an interactive compiled Lisp function in `window.el'. It is bound to C-l. (recenter-top-bottom &optional arg) Move current line to window center, top, and bottom, successively. With no prefix argument, the first call redraws the frame and centers point vertically within the window. Successive calls scroll the window, placing point on the top, bottom, and middle consecutively. The cycling order is middle -> top -> bottom. A prefix argument is handled like `recenter': With numeric prefix arg, move current line to window-line arg. With plain `C-u', move current line to window center. Top and bottom destinations are actually `scroll-margin' lines the from true window top and bottom. -- c/* __o/* <\ * (__ */\ <