From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#20236: 25.0.50; Feature Request: scroll-other-window does not allow setting of scroll function Date: Thu, 02 Dec 2021 19:41:20 +0200 Organization: LINKOV.NET Message-ID: <86bl1y3otk.fsf@mail.linkov.net> References: <87zj6th18o.fsf@gmail.com> <87mtlj5ncu.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33900"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 20236@debbugs.gnu.org, Stefan Monnier , "Tory S. Anderson" To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 02 18:59:04 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msqMJ-0008YH-V0 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Dec 2021 18:59:03 +0100 Original-Received: from localhost ([::1]:40630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msqMI-0006Jc-Tp for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Dec 2021 12:59:02 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msqHS-0005Vq-Aa for bug-gnu-emacs@gnu.org; Thu, 02 Dec 2021 12:54:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msqHS-0005B7-2x for bug-gnu-emacs@gnu.org; Thu, 02 Dec 2021 12:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1msqHR-000318-TK for bug-gnu-emacs@gnu.org; Thu, 02 Dec 2021 12:54:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Dec 2021 17:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20236 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 20236-submit@debbugs.gnu.org id=B20236.163846763811589 (code B ref 20236); Thu, 02 Dec 2021 17:54:01 +0000 Original-Received: (at 20236) by debbugs.gnu.org; 2 Dec 2021 17:53:58 +0000 Original-Received: from localhost ([127.0.0.1]:49176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msqHO-00030q-65 for submit@debbugs.gnu.org; Thu, 02 Dec 2021 12:53:58 -0500 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:48757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msqHM-00030c-D3 for 20236@debbugs.gnu.org; Thu, 02 Dec 2021 12:53:57 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id B561BC0011; Thu, 2 Dec 2021 17:53:47 +0000 (UTC) In-Reply-To: <87mtlj5ncu.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 02 Dec 2021 11:10:09 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221332 Archived-At: >>> the c-code scroll-other-window functions do not allow specification of >>> the function to be used for scrolling, which means they have problems >>> with other-window modes like Info and PDF-View. It would be >>> tremendously useful if support for dynamic setting of the >>> scroll-other-window functions would be allowed (based on the mode of >>> other-window). >> >> Agreed. Patch welcome. > > Hm... I don't think modes explicitly define a scrolling command -- they > just rebind etc? > > So for this to work, we'd have to introduce a scroll-command variable > that buffers could set locally, and then have scroll_command call that > instead of doing its thing if it's set? > > Anybody have an opinion here? Looks like this could be useful in e.g. `follow-mode'. `follow-mode-map' binds only these keys: (define-key map "\C-v" #'follow-scroll-up) (define-key map "\M-v" #'follow-scroll-down) So users of follow-mode need to add more customization: (with-eval-after-load 'follow (define-key follow-mode-map [prior] 'follow-scroll-down) (define-key follow-mode-map [next] 'follow-scroll-up)) that still doesn't work in view-mode where the scrolling key SPC is bound to View-scroll-page-forward. Oh, wait a sec. Maybe remapping is sufficient. And indeed, everything is achievable with just: (with-eval-after-load 'follow (define-key follow-mode-map [remap scroll-up-command] #'follow-scroll-up) (define-key follow-mode-map [remap scroll-down-command] #'follow-scroll-down) (define-key follow-mode-map [remap View-scroll-page-forward] #'follow-scroll-up) (define-key follow-mode-map [remap View-scroll-page-forward-set-page-size] #'follow-scroll-up) (define-key follow-mode-map [remap View-scroll-page-backward] #'follow-scroll-down))