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#12401: scroll-preserve-screen-position broken with font height faces Date: Mon, 10 Sep 2012 21:02:04 +0300 Message-ID: <83bohdlpsz.fsf@gnu.org> References: <83mx0yl4s2.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1347300166 4147 80.91.229.3 (10 Sep 2012 18:02:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2012 18:02:46 +0000 (UTC) Cc: 12401@debbugs.gnu.org To: Le Wang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 10 20:02:48 2012 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 1TB8Jn-00036C-B0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2012 20:02:43 +0200 Original-Received: from localhost ([::1]:57642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB8Jj-0002rQ-T7 for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Sep 2012 14:02:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB8Jb-0002r6-W4 for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 14:02:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TB8JX-0000KW-Eb for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 14:02:31 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TB8JX-0000KS-Ao for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 14:02:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TB8K6-0007FA-Fm for bug-gnu-emacs@gnu.org; Mon, 10 Sep 2012 14:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Sep 2012 18:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12401 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12401-submit@debbugs.gnu.org id=B12401.134730016627822 (code B ref 12401); Mon, 10 Sep 2012 18:03:02 +0000 Original-Received: (at 12401) by debbugs.gnu.org; 10 Sep 2012 18:02:46 +0000 Original-Received: from localhost ([127.0.0.1]:52688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TB8Jm-0007Ec-3u for submit@debbugs.gnu.org; Mon, 10 Sep 2012 14:02:46 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:46735) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TB8Jg-0007EO-8u for 12401@debbugs.gnu.org; Mon, 10 Sep 2012 14:02:40 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MA500000BENZW00@a-mtaout22.012.net.il> for 12401@debbugs.gnu.org; Mon, 10 Sep 2012 21:01:58 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MA500M9JBF9PFP0@a-mtaout22.012.net.il>; Mon, 10 Sep 2012 21:01:57 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:64067 Archived-At: > Date: Mon, 10 Sep 2012 20:37:06 +0800 > From: Le Wang > Cc: 12401@debbugs.gnu.org > > Thanks for the quick response, Eli. > > On Mon, Sep 10, 2012 at 3:23 PM, Eli Zaretskii wrote: > > scroll-preserve-screen-position tries to preserve the > > _screen_position_ of point, i.e. where you find the cursor, after it > > executes one of the scrolling commands. But since arbitrary pixel > > coordinates on the screen might in general (in the presence of > > variable-size fonts) correspond to one of 2 possible text lines, Emacs > > needs to choose where to put the cursor. What exactly do you expect > > Emacs to do in such a situation, where it simply _cannot_ keep the > > same pixel coordinates? > > I understand the problem. > > > IOW, what is the "contract" that you expect Emacs to keep under > > scroll-preserve-screen-position? Is it just that doing N C-v's > > followed by N M-v's brings point to the same location where it was > > before this sequence of 2N commands? Or do you also expect something > > from each individual C-v/M-v, and if so, what exactly? > > The contract should be C-v followed by M-v should bring the point back > to the same line. Then that feature is not currently available in Emacs scrolling, sorry. scroll-preserve-screen-position simply puts the point at or near the same screen position after the window is scrolled. That is all it does. The manual says that this returns to the previous point when you scroll back, but that promise has no basis. When some faces are higher than the default font, the way Emacs scrolls windows cannot make sure you will return to the same place. It can only work when all the faces use fonts that are no higher than the default face. > >> For reference this package works just fine with variable height faces: > >> http://www.cs.utah.edu/~eeide/emacs/scroll-in-place.el.gz > > > > I cannot use it, neither in Emacs 24.2 nor in the current trunk code: > > it complains about a missing function screen-width. Please provide a > > complete recipe for using this package, starting with "emacs -Q", in > > Emacs 24.2 or newer, so I could study what it does and how. > > Sorry about this. It seems the version I use comes from XEmacs and > I've made a small fix. I've placed it here: > > https://gist.github.com/3690403 This package uses an entirely different method of scrolling, one that is based on lines, not pixels. I wonder how well it works when (large) images, display strings, invisible text, and other calamities are present in the buffer. In any case, using such a method would mean a thorough rewrite of window-scrolling primitives. Volunteers welcome.