From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: scroll-down with pixel transition Date: Mon, 17 Apr 2017 11:54:53 +0300 Message-ID: <83lgqze7mq.fsf@gnu.org> References: <83o9vzh22i.fsf@gnu.org> <20170415.073252.508582486.tkk@misasa.okayama-u.ac.jp> <83zifif073.fsf@gnu.org> <20170416.173541.214118934.tkk@misasa.okayama-u.ac.jp> <83efwsfy1a.fsf@gnu.org> <83d1ccfg7o.fsf@gnu.org> <837f2kfd0z.fsf@gnu.org> <693E1D44-797B-4B0D-9D0B-6FEB6DF32531@misasa.okayama-u.ac.jp> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1492419274 27722 195.159.176.226 (17 Apr 2017 08:54:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Apr 2017 08:54:34 +0000 (UTC) Cc: cpitclaudel@gmail.com, emacs-devel@gnu.org, yuri.v.khan@gmail.com To: Tak Kunihiro Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 17 10:54:27 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d02QV-00076K-Ht for ged-emacs-devel@m.gmane.org; Mon, 17 Apr 2017 10:54:27 +0200 Original-Received: from localhost ([::1]:35484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d02Qb-0007lJ-Au for ged-emacs-devel@m.gmane.org; Mon, 17 Apr 2017 04:54:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d02QU-0007l0-PI for emacs-devel@gnu.org; Mon, 17 Apr 2017 04:54:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d02QQ-0005Bi-Td for emacs-devel@gnu.org; Mon, 17 Apr 2017 04:54:26 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d02QQ-0005Be-Qq; Mon, 17 Apr 2017 04:54:22 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1104 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d02QQ-0005Sb-0B; Mon, 17 Apr 2017 04:54:22 -0400 In-reply-to: <693E1D44-797B-4B0D-9D0B-6FEB6DF32531@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Mon, 17 Apr 2017 08:06:32 +0900) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214048 Archived-At: > From: Tak Kunihiro > Date: Mon, 17 Apr 2017 08:06:32 +0900 > Cc: Kunihiro Tak , > cpitclaudel@gmail.com, > yuri.v.khan@gmail.com, > emacs-devel@gnu.org > > I meant a line with “(dir)Top” will not be shown by pixel-scroll-down-and-set-window-vscroll. I suppose you refer the line as “breadcrumbs”. > > emacs -Q > M-x load-file RET pixel-scroll.el RET > M-x info > C-s gnus RET > M-x pixel-scroll-down > M-x pixel-scroll-down > M-x pixel-scroll-down You need to carefully examine the behavior of the functions you use near that special place, as some of them might behave unexpectedly when an overlay string is present that hides some of the buffer text, which makes the effect of these functions not well-defined. The diffs below should give you a start, but there still are some minor glitches near the beginning of an Info node; these are left as exercises ;-) --- pixel-scroll.el~0 2017-04-16 13:19:06.708750000 +0300 +++ pixel-scroll.el 2017-04-17 11:48:10.661875000 +0300 @@ -235,7 +235,15 @@ (let ((pos (save-excursion (goto-char (window-start)) - (beginning-of-visual-line 0)))) + (if (bobp) + (point-min) + ;; When there's an overlay string at window-start, + ;; (beginning-of-visual-line 0) stays put. + (let* ((ppos (point)) + (tem (beginning-of-visual-line 0))) + (if (eq tem ppos) + (vertical-motion -1)) + (point)))))) (set-window-start nil pos t) (set-window-vscroll nil vscroll t)))