Emacs meets Xul Runner

http://conkeror.org/
I tried this a few years back when it was still a FF extension, and couldn’t get into it.
It’s been a standalone Xul Runner app for a couple of years now.
It’s like an Emacs browser that runs Java Script, etc, and the browser scripting language is in Java Script. (Which makes sense as it’s on Xul Runner, but is wacky from an Emacs perspective)

 

#conkeror - thanks to all in IRC for tips (other than “don’t use windows”)

 

 

bookmark management

Looks like the (modified) ViewMarks extension is the only in-Conkeror viewing solution.

 

this email details some of the use-cases, and shortcomings.

 

I’d be happy with a test-window like Emacs’ bookmark viewer.
Hrm.....

 

 

maximizing screen re-estate

mode-line-mode - remove or add the mode-line, as required
tab-bar-mode  - remove or add the tab-bar, as required

 

Full-screen mode

/*
 * Make conkeror use the whole screen. Useful when running the windows
 * version.
 */

interactive("toggle-fullscreen",
            "Toggle whether conkeror uses the whole screen.",
            function(I) {
                if(I.window.fullScreen==false){
                    I.window.fullScreen=true;
                }else{
                    I.window.fullScreen=false;
                }
            });

define_key(default_global_keymap,  "M-f11", "toggle-fullscreen");

 

 

re-loading conkerorrc, hooks, and a close-prompt

I like to be prompted when closing, just in case I’m making a mistake, or didn’t notice that the tab I’m closing is the only tab in the window.
But I found that sometimes I was having to hit ‘y’ mutliple times.
Turns out, I was having to hit ‘y’ the same number of times as I had reloaded my conkerorrc file.
So, the hook needs to be cleared first, if it exists.

// based on http://conkeror.org/Tips#Askbeforeclosingthewindow
// add_hook will add an additional hook each time you re-load your conkerorrc
// unless you clear the hook PRIOR to (re)define/(re)add
remove_hook("window_before_close_hook", window_close_prompt);

var window_close_prompt = function () {
             var w = get_recent_conkeror_window();
             var result = (w == null) ||
                 "y" == (yield w.minibuffer.read_single_character_option(
                     $prompt = "Quit Conkeror? (y/n)",
                     $options = ["y", "n"]));
             yield co_return(result);
         };
// see http://conkeror.org/Hooks?highlight=%28hook%29
add_hook("window_before_close_hook", window_close_prompt);

 

Hooks are arrays.
Adding to a hook adds and object to the array
When you re-load your conkerorrc, a new object is created, with an identical name to the previous object.
when you add_hook, you are adding the new object, not redefining or removing the previous object
remove_hook must be called PRIOR to the redefinition, as they are separate objects (and the previous object will not be garbage collected since there is a hook pointing to it).
so... remove (if it exists), define, add.
If you re-load your conkerorrc, no multiple prompts.

 

Export keywords

http://conkeror.org/Tips#ExportFirefoxKeywordSearchesasConkerorWebjumps

path\to\sqlite\sqlite3 places.sqlite "select keyword,url from moz_keywords left join moz_bookmarks on moz_keywords.id = keyword_id) left join moz_places on (fk = moz_places.id);" > keyword_dump.txt

 

I then used Emacs to break it apart via

^\([a-z\-]+\)|\(.*\)$
define_webjump("\1", "\2");

 

There was one bookmarklet that had quotation marks in it, so had to be manually changed to use single-quotes. Could have been just as true in the obverse.

 

required http://www.sqlite.org/

 

See Also

Xul Runner

 

 

Tags

browsers xulApplications thingsThatAreHighlyReminiscentOfEmacs