From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.devel 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 Message-ID: <87si2l858a.fsf@mbork.pl> References: <87y4cd8usv.fsf@mbork.pl> <83oad9dyzj.fsf@gnu.org> <87twn188bf.fsf@mbork.pl> <83wprxcdwm.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1451414690 19269 80.91.229.3 (29 Dec 2015 18:44:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Dec 2015 18:44:50 +0000 (UTC) Cc: Emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 29 19:44:44 2015 Return-path: Envelope-to: ged-emacs-devel@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 1aDzGF-00027X-H3 for ged-emacs-devel@m.gmane.org; Tue, 29 Dec 2015 19:44:43 +0100 Original-Received: from localhost ([::1]:49740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDzGE-0008I4-NT for ged-emacs-devel@m.gmane.org; Tue, 29 Dec 2015 13:44:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDzGB-0008Hz-IC for Emacs-devel@gnu.org; Tue, 29 Dec 2015 13:44:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aDzG8-0004i9-Ck for Emacs-devel@gnu.org; Tue, 29 Dec 2015 13:44:39 -0500 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:55547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aDzG8-0004hp-5J; Tue, 29 Dec 2015 13:44:36 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id DCA068F2017; Tue, 29 Dec 2015 19:44:33 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F-fF6cNUc-vI; Tue, 29 Dec 2015 19:44:26 +0100 (CET) Original-Received: from localhost (unknown [109.232.24.28]) by mail.mojserwer.eu (Postfix) with ESMTPSA id B13908F200B; Tue, 29 Dec 2015 19:44:25 +0100 (CET) User-agent: mu4e 0.9.13; emacs 25.0.50.1 In-reply-to: <83wprxcdwm.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2a01:5e00:2:52::8 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197129 Archived-At: On 2015-12-29, at 19:23, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Cc: Emacs-devel@gnu.org >> Date: Tue, 29 Dec 2015 18:37:40 +0100 >>=20 >> > Because it needs to determine the new window-start which is a >> > window-full above or below the current one, without assuming that al= l >> > the lines have the same height in pixels. How do you do that in Lis= p? >> > (The current implementation simulates display.) >>=20 >> Interesting, though I know too little about Emacs internals to fully >> understand your answer. I thought it just does something like >>=20 >> (save-excursion >> (other-buffer) >> (scroll-up)) >>=20 >> Why my (probably na=C3=AFve) 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=E2=84=A2. 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 and 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, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University