« Return to Thread: hooks, functions and features of interactive

hooks, functions and features of interactive

by David Kettler-2 :: Rate this Message:

Reply to Author | View in Thread

There are various places in conkeror (some user variables and hooks)
where the user specifies a function.  Some of the features of
interactive commands would be useful for those functions; I wonder if it
would be useful to have a callback() function (analogous to interactive)
to define such functions.  In particular, they could be given
documentation in this way (although its not clear how that documentation
should be presented).

Another feature of interactive that would be useful is the alternates
mechanism.  For instance I usually want url_remoting_fn to
OPEN_NEW_BUFFER.  But sometimes I want OPEN_NEW_BUFFER_BACKGROUND.  I
currently use the code below, but alternates would be nicer.

Does this sound like something worth pursuing?

Examples of variables, other than hooks, that are expected to be set to
a function:
    media_scrapers
    read_url_handler_list
    run_external_editor_function
    url_remoting_fn

Current code that would be neater with alternates:

/* For url_remoting_fn; load in a new buffer.  If -uu is given on the
 * command line, do so in the background. */
function load_url_in_new_buffer_perhaps_bg(url, ctx) {
    create_buffer_in_current_window(
        buffer_creator(content_buffer, $load = url,
                       $configuration = ctx.config),
        ctx.prefix_argument ? OPEN_NEW_BUFFER_BACKGROUND : OPEN_NEW_BUFFER,
        !ctx.prefix_argument);
}

url_remoting_fn = load_url_in_new_buffer_perhaps_bg;

regards, David
_______________________________________________
Conkeror mailing list
Conkeror@...
https://www.mozdev.org/mailman/listinfo/conkeror

 « Return to Thread: hooks, functions and features of interactive