Hi all,
I just pushed a redesign of the buffer-mode and page-mode system, and if
you have defined any buffer or page modes in your rc, or use either of two
util functions, you will need to update your code when you update your
conkeror. Here are the changes:
* build_url_regex renamed to build_url_regexp.
* choice_regex renamed to choice_regexp.
These were done for consistency with other usage in Conkeror and with
the Mozilla platform, and frankly, the abbreviation "regex" is a bit of
a pet peeve for me. Hope it hasn't inconvenienced anybody.
* The call forms of define_buffer_mode and define_page_mode have changed.
Rather that go into the specifics here, I am going to assume that
anybody who has written a buffer-mode or page-mode can refer to the
Conkeror source and the wiki for the details on the new call forms.
The wiki does not have good complete documentation on these two
subjects yet, but I plan to work on improving it over the next day or
three.
* The way to deactivate page-modes has changed.
Instead of the old way of doing complicated array manipulations on
'auto_mode_list', the new way is much simpler. If I want to deactivate
xkcd-mode for example (make it so it won't automatically turn on when I
visit xkcd), I do the following:
page_mode_deactivate(xkcd_mode);
* The call form to enable or disable a buffer-mode or page-mode in
javascript has also changed. (Note the distinction between
'deactivating' and 'disabling'.) Instead of the mode being a function
that takes a flag -1/+1 or true/false (like in emacs), it is now an
object with 'enable' and 'disable' methods:
some_mode.enable(buffer);
some_mode.disable(buffer);
The reason for these changes is actually pretty exciting: the new design
allows multiple page-modes to be enabled at one time. This means that
instead of monolithic modes with ad hoc methods for enabling and disabling
their features, there can be a one-to-one correspondence between
page-modes and features, with a simple and uniform way to turn features on
and off. Note, the multi-feature page-modes that are built into conkeror
have not yet been split up; that will be one of the next undertakings.
Page-modes under the new design are also a little bit easier to write and
read, and a new subtype of page-mode, called a 'keymaps-page-mode'
eliminates the boilerplate code common to all page-modes that install
keymaps. Ultimately, I think that this redesign will make page-modes and
buffer modes easier to create and use, and allow us to get more use out of
them.
Any questions, comments?
--
John Foerch
_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror