bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#51210: Customizable other-window-for-scrolling


From: Juri Linkov
Subject: bug#51210: Customizable other-window-for-scrolling
Date: Sat, 29 Jan 2022 20:53:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu)

>> Sorry, I didn't notice it takes an argument.  Then it's strange
>> that it doesnt't recenter according to recenter-top-bottom that
>> uses recenter-positions.  So two most useful behaviors
>> (recenter-top-bottom for beginning-of-buffer-other-window and
>> no recentering for end-of-buffer-other-window) are not supported.
>> Since the default can't be changed, maybe a new optional argument
>> could define whether to use recenter-top-bottom, or no recenter at all.
>
> I don't mind having a new option, but is recenter-positions really
> relevant to beginning-of-buffer-other-window? why would users want to
> have beginning-of-buffer-other-window recenter in non-default ways,
> just because they customized recenter-positions?

beginning/end-of-buffer-other-window looked like abandoned commands,
so I thought they might need more work.  But since they will keep
the current behavior, it's much easier to customize them with advice:

  (advice-add 'beginning-of-buffer-other-window :after
              (lambda (&rest _args)
                (with-selected-window (other-window-for-scrolling)
                  (recenter-top-bottom))))

  (advice-add 'end-of-buffer-other-window :after
              (lambda (&rest _args)
                (with-selected-window (other-window-for-scrolling)
                  (recenter -1))))

Anyway, the objective of this request was completed, so it's already closed.





reply via email to

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