From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Scrolling the screen vertically Date: Wed, 04 Jul 2012 23:20:43 +0300 Message-ID: <834npn46sk.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1341433275 2043 80.91.229.3 (4 Jul 2012 20:21:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2012 20:21:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 04 22:21:15 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SmW4S-00027z-7E for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 22:21:08 +0200 Original-Received: from localhost ([::1]:36376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmW4R-0005ly-6U for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 16:21:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmW4L-0005lV-CC for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 16:21:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmW4J-0007Fw-Lr for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 16:21:00 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:63304) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmW4J-0007Fl-Df for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 16:20:59 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M6N00A00KFJIG00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 23:20:43 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M6N00AUQKIIBL40@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 23:20:43 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85665 Archived-At: > Date: Wed, 4 Jul 2012 21:19:08 +0300 > From: Valera Rozuvan > > 1.) move to the column X + ((80 / 2) - 2) (scroll by half the screen's > width to the right, with an overlap of 2 columns) > 2.) move to the column X - ((80 / 2) - 2) (scroll by half the screen's > width to the left, with an overlap of 2 columns) > 3.) move the cursor to Y - 2, where Y is the right-most column visible > on the screen > 4.) move the cursor to Z + 2, where Z is the left-most column visible > on the screen > > Note that cases 1 and 3 are not the same, because the cursor can be > positioned anywhere (for example X = Y - 2). Same with cases 2 and 4. > > So I need functions to determine X, Y, Z, and the screen's width. Then > I can write a function which will move the cursor forward and backward > by a calculated number of characters. Look at window-width and window-hscroll, I think they give you all you need. The functions to actually scroll are those bound to the keys I mentioned, and you can control by how much to scroll by giving them an argument (see their doc strings).