From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18923: Alternative scrolling model Date: Mon, 03 Nov 2014 05:45:30 +0200 Message-ID: <83sii1vtet.fsf@gnu.org> References: <87wq7e9zcn.fsf@gmail.com> <83a949y6r1.fsf@gnu.org> <87r3xla7zw.fsf@gmail.com> <8338a1y377.fsf@gnu.org> <87ppd5a46w.fsf@gmail.com> <831tplxy1x.fsf@gnu.org> <87mw89a07z.fsf@gmail.com> <83wq7dwgdf.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1414986385 7004 80.91.229.3 (3 Nov 2014 03:46:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Nov 2014 03:46:25 +0000 (UTC) Cc: 18923@debbugs.gnu.org To: esabof@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 03 04:46:18 2014 Return-path: Envelope-to: geb-bug-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 1Xl8aw-0008BY-1o for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Nov 2014 04:46:18 +0100 Original-Received: from localhost ([::1]:60275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl8av-0004Oe-KU for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Nov 2014 22:46:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl8am-0004OM-MI for bug-gnu-emacs@gnu.org; Sun, 02 Nov 2014 22:46:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xl8ag-0001Mk-Pu for bug-gnu-emacs@gnu.org; Sun, 02 Nov 2014 22:46:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl8ag-0001Mg-Lm for bug-gnu-emacs@gnu.org; Sun, 02 Nov 2014 22:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xl8ag-00036n-6M for bug-gnu-emacs@gnu.org; Sun, 02 Nov 2014 22:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Nov 2014 03:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18923-submit@debbugs.gnu.org id=B18923.141498635011926 (code B ref 18923); Mon, 03 Nov 2014 03:46:02 +0000 Original-Received: (at 18923) by debbugs.gnu.org; 3 Nov 2014 03:45:50 +0000 Original-Received: from localhost ([127.0.0.1]:46601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xl8aT-00036H-LH for submit@debbugs.gnu.org; Sun, 02 Nov 2014 22:45:49 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:39643) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xl8aR-000361-AD for 18923@debbugs.gnu.org; Sun, 02 Nov 2014 22:45:48 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NEG00J0023Q1W00@a-mtaout22.012.net.il> for 18923@debbugs.gnu.org; Mon, 03 Nov 2014 05:45:41 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NEG00JQ12G41P10@a-mtaout22.012.net.il>; Mon, 03 Nov 2014 05:45:41 +0200 (IST) In-reply-to: <83wq7dwgdf.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95413 > Date: Sun, 02 Nov 2014 21:29:32 +0200 > From: Eli Zaretskii > Cc: 18923@debbugs.gnu.org > > > > I meant call window-body-height with PIXELWISE non-nil. Then the > > > return value doesn't depend on what is displayed, it just gives you > > > the height of the text area in pixels. Subtracting from that the > > > pixel coordinates of point returned by pos-visible-in-window-p or > > > posn-at-point will give you how many pixels are there to the top and > > > bottom of the window. This should eliminate the need to count pixels > > > by moving one screen line at a time via vertical-motion, which is less > > > efficient, I think. > > > > I'm not sure how knowing the distance of a point to the bottom of the window would benefit me, but indeed I could bulk-measure several lines in some cases. > > IMO the most important case is when you need to scroll almost the full > window, in which case the pixel size of the window is the main piece > of information. In addition, you could change st-move to work in pixels instead of lines. Then you could use posn-at-x-y inside st-move to find the position at a given Y offset from the current window-start, and move the new window-start to that position. This should eliminate the need to use vertical-motion in st-move even if you need to scroll by one or a few screen lines. The conversion of the number of lines to pixels is straightforward using default-line-height.