[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Feature request: character based scrollbars
From: |
Eli Zaretskii |
Subject: |
Re: Feature request: character based scrollbars |
Date: |
Fri, 30 May 2025 15:54:25 +0300 |
> From: "Michael Grant" <mgrant@grant.org>
> Cc: emacs-devel@gnu.org, "Devon McCullough" <devon@csail.mit.edu>
> Date: Fri, 30 May 2025 12:27:26 +0000
>
> Where would you split things, as in, is there some sort of api or set of
> functions you call when there's a visual display that would need to be
> implemented similarly when there's only a character display?
Look at the scroll-bar interface in xterm.c and xfns.c. Here are the
functions Emacs expects to be able to call and how they are set for
the X Windows backend:
terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
terminal->set_horizontal_scroll_bar_hook = XTset_horizontal_scroll_bar;
terminal->set_scroll_bar_default_width_hook = x_set_scroll_bar_default_width;
terminal->set_scroll_bar_default_height_hook =
x_set_scroll_bar_default_height;
terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
terminal->judge_scroll_bars_hook = XTjudge_scroll_bars;
> How would you shrink each window so that there's space outside each
> buffer for the scrollbars?
This should be (almost) automatic: as soon as the various
FRAME_*_SCROLL_BAR_* macros return the correct values, the window
dimensions should follow suit. We'd only need to make sure some
text-terminal related code doesn't implicitly assume there are no
scroll bars and doesn't fail to call these macros where the GUI code
does.
> Will emacs get the mouse click in this region or i dunno whatever is
> needed to send events back to those existing scrollbar endpoints?
The mouse support on text terminals will need to generate events that
describe clicks and dragging on the scroll bars, yes. This needs to
be added, or at least the related code will need to be audited to make
sure it works on text-mode terminals as well, as soon as there's a
scroll bar.
> As I see it without knowing much, there seems to be 3 parts of this
> adventure. 1) how to shrink the windows and make room for the
> scrollbars, 2) mouse stuff (which may be there already), and 3) some
> glue to hook it up to the existing scrollbar stuff so it thinks it has
> toolkit scrollbars, as in, probably this presents itself like a
> "toolkit" which does scrollbars.
See above. I think I covered the basics.
> How can I move this along? What would make it easier for someone to
> implement? I do not personally feel capable of the work myself. Maybe
> Devon can maybe help some, not sure of his time commitment. When I
> chatted with RMS about this, he said there may be someone motivated
> within the emacs community on this list who could take this on?
Well, since you've posted to the list, I hope interested people will
chime in and volunteer to work on this.
Thanks.