[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there any particular reason `scroll-other-window' is written in C
From: |
Marcin Borkowski |
Subject: |
Re: Is there any particular reason `scroll-other-window' is written in C and not in ELisp? |
Date: |
Tue, 29 Dec 2015 19:44:21 +0100 |
User-agent: |
mu4e 0.9.13; emacs 25.0.50.1 |
On 2015-12-29, at 19:23, Eli Zaretskii <address@hidden> wrote:
>> From: Marcin Borkowski <address@hidden>
>> Cc: address@hidden
>> Date: Tue, 29 Dec 2015 18:37:40 +0100
>>
>> > Because it needs to determine the new window-start which is a
>> > window-full above or below the current one, without assuming that all
>> > the lines have the same height in pixels. How do you do that in Lisp?
>> > (The current implementation simulates display.)
>>
>> Interesting, though I know too little about Emacs internals to fully
>> understand your answer. I thought it just does something like
>>
>> (save-excursion
>> (other-buffer)
>> (scroll-up))
>>
>> Why my (probably naïve) implementation won't work?
>
> (You forget other-window-for-scrolling, but that's beside the point.)
Yes.
> How would that help? The guts are in scroll-up, which is in C (as all
> the scrolling commands).
Well, I should have written explicitly what's wrong with the current
implementation.
When I view a pdf (in pdf-tools as well as in doc-view-mode), I'd like
C-M-v / C-M-S-v to change page when they reach the bottom/top of the
page. Currently, they don't do it, which is a Very Bad Thing™.
Now that I think of it, I guess rewriting scroll-other-window in Elisp
wouldn't help a lot - I'd probably still have to advise them, or else
C-M-v should check what is bound to <next> and <prior> in the buffer to
be scrolled. Does anyone have a better idea how to be able to scroll
a pdf in other window using C-M-v and C-M-S-v?
TIA,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University