Reposted from weechat/scripts.
It would be nice to be able to get bars to scroll automatically. Consider the buffers bar, for example. Here it is, at the top, exhibiting the current behavior:

And here is the desired behavior:

A similar feature seems to have been requested some years ago.
This would be really nice to have (especially for buffers).
While discussing this issue in #weechat, I thought of a potential way to solve this in WeeChat itself and allow any bar item (in this case "buffers") to suggest which part of the item should definitely be visible on-screen by scrolling the bar to a suitable position automatically, overriding the user set scroll position. It goes like this:
To allow any item to flexibly use this, I suggest introducing a hidden marker value to mark this part of the bar's content. This could be a special "color" code (like there currently are the 19+"b" ones) which would mark the spot that should be on screen.
In reality this poses a question for the bar item content creator: where exactly to place that hidden marker to guarantee that an entire word is visible? It matters because having the marker in the beginning or end (or any other position really) may mean that end (part) of the word is indeed autoscrolled on screen but not the whole word if it's long enough and the scrolling happens in some specific way. So to ask for the best guarantee it'd be beneficial to allow multiple of these markers to be put into the content, i.e. to either end of the word. When the autoscrolling logic scrolls the bar, it'd preferably scroll to such position where both are on-screen. Theoretically there could be no limit on the marker count, only problem being the case where the bar suddenly is too small to allow all of them to be autoscrolled to be visible on the same time.
Unfortunately, I'm unsure on the implementation details because in order to be able to determine the autoscroll position from the markers, the bar should be likely simulation drawn beforehand to make it possible to find the scroll positions required. It is due to the autoscrollable position _not only depending_ on the current bar item, but any others which might be drawn in the same bar (although that potentially could get messy if they both want autoscroll, but I doubt that'd be needed by anyone in practice).
I added the option buflist.look.auto_scroll to auto scroll the buflist bar, but due to the complexity of auto-scrolling a bar according to the items displayed, the bar position and filling, this works only if the bar is in position left/right, with vertical filling, and "buflist" must be the first item displayed in bar.
This could be improved in future, but as @sim642 said, this is not easy to implement.
For anyone looking for something similar when using highmon as a bar, highmon has plugins.var.perl.highmon.bar_scrolldown option, setting to on will automatically scroll.
Most helpful comment
I added the option buflist.look.auto_scroll to auto scroll the buflist bar, but due to the complexity of auto-scrolling a bar according to the items displayed, the bar position and filling, this works only if the bar is in position left/right, with vertical filling, and "buflist" must be the first item displayed in bar.
This could be improved in future, but as @sim642 said, this is not easy to implement.