How to refresh the status bar

I want to display some information in the status bar which can change without the buffer changing.

Is there a way to provoke a refresh of the status bar from lisp?

A little poking around in the source answers my own question:


refreshes the status bar from lisp. Maybe someone will find this helpful.

1 Like

Indeed. Please note this API is not exported :slight_smile: it will probably work for a while, but it carries no guarantees that would normally work for something like a minor version update.

I understand. Please consider providing a public API for this sort of thing: one could imagine several use-cases beyond my one such as a clock in the status bar.

Come to that, how is a normal vs insert indicator accomplished in vi-mode?

We will probably make it public in 3.0.0 and commit to sticking to an API (we are working on 3.0.0 now). The normal vi indicator is accomplished via the function: vi-format-status which is called by format-status. Based on whether vi normal mode is activated or not, it will alter how it prints the status.

My point was how does the status line know how to refresh itself to change the indicator when I hit ESC in vi-insert-mode. However, I now see that modes call print-status when they are toggled.