[Conkeror] [patch] modeline buffer session history widget

Jeremy Maitin-Shepard jeremy at jeremyms.com
Sun Sep 28 12:37:34 PDT 2008


"Jens Petersen" <juhpetersen at gmail.com> writes:

>> Here is a initial draft patch that just makes conkeror [show] the
>> number of previous and next pages in the session history of the
>> current buffer.

> I attach a reworked patch which hopefully does this right as a separate widget.

>> I would really like to implement a function to
>> display the history as a completion popup

> Still planning to do this.  (eg I think w3m-el provides 'h' for this.)

>> Also making the modeline display configurable would be nice.

> (To clarify I think an equivalent of Emacs' mode-line-format is
> needed.)

The modeline display is fully configurable.  You can, for instance,
first remove all of the existing mode line widgets from mode_line_hook.
Note that in modules/mode-line.js there are these three calls that are
responsible for the default mode line:

add_hook("mode_line_hook", mode_line_adder(current_buffer_name_widget));
add_hook("mode_line_hook", mode_line_adder(clock_widget));
add_hook("mode_line_hook", mode_line_adder(current_buffer_scroll_position_widget));

Unfortunately, due to the nature of mode_line_adder, it was previously
not possible to merely substitute remove_hook for add_hook to reverse
the action, because a new function closure would be generated by the
call to mode_line_adder, rather than exactly the same one generated in
the call to add_hook.  Thus, the only option would be to clear the hook,
e.g. by setting mode_line_hook.length = 0;  I pushed a fix, though, so that now you can
indeed call:

remove_hook("mode_line_hook", mode_line_adder(current_buffer_name_widget));
remove_hook("mode_line_hook", mode_line_adder(clock_widget));
remove_hook("mode_line_hook", mode_line_adder(current_buffer_scroll_position_widget));

To remove all of the default mode line widgets.

-- 
Jeremy Maitin-Shepard


More information about the Conkeror mailing list