emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scroll-down with pixel transition


From: Eli Zaretskii
Subject: Re: scroll-down with pixel transition
Date: Mon, 17 Apr 2017 11:54:53 +0300

> From: Tak Kunihiro <address@hidden>
> Date: Mon, 17 Apr 2017 08:06:32 +0900
> Cc: Kunihiro Tak <address@hidden>,
>  address@hidden,
>  address@hidden,
>  address@hidden
> 
> 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)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]