From jeremy at jeremyms.com Mon Sep 1 16:40:11 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Mon, 01 Sep 2008 16:40:11 -0700 Subject: [Conkeror] my first command In-Reply-To: <87myits2a9.wl%jim@sdf-eu.org> (Jim Burton's message of "Sun, 31 Aug 2008 15:10:54 +0100") References: <87myits2a9.wl%jim@sdf-eu.org> Message-ID: <8763pftoys.fsf@jeremyms.com> Jim Burton writes: > Hi, I want a command that posts urls to citeulike.org (a bookmarking > type site for academic references). In firefox this is simply done > with a bookmark like this: > javascript:location.href='http://www.citeulike.org/posturl?username=USER&bml=nopopup&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title); > I don't seem to be able to add such a bookmark -- is this because of > the protocol? So, I tried a command -- see below. This moves to the > new location but the minibuffer and status bar disappear and conkeror > stops responding to commands. I have to kill the window to start > again. What am I doing wrong? Thanks. > /*citeulike*/ > function citeulike_post (i) { > var w = i.window; > w.location.href='http://www.citeulike.org/posturl?username=USER&bml=nopopup&url='+encodeURIComponent(w.location.href)+'&title='+encodeURIComponent(i.buffer.document.title); > } i.window refers to the top-level window that contains the Conkeror UI, and therefore you should not be accessing it like that. Instead try: check_buffer(i.buffer, content_buffer); let title = i.buffer.title; let url = i.buffer.display_URI_string; i.buffer.load("http://www.citeulike.org/posturl?username=USER&bml=nopopup&url="+encodeURIComponent(url)+'&title='+encodeURIComponent(title)); > interactive ("citeulike-post", "post the current location to citeulike", > function (I) { > citeulike_post (I); > }); No need for this extra wrapper, you can just do: interactive("citeulike-post", "post the current location to citeulike", citeulike_post); > I'd like to tell you which version I'm using but don't know how to > find out! I got rid of the tarball, the version number doesn't seem to > be in any of the readmes etc and M-x conkeror-version prints > $CONKEROR_VERSION$, unhelpfully. Yes, for git snapshots the version is not contained in the snapshot. If you use git this is not so much of a problem. -- Jeremy Maitin-Shepard From nicktastic at gmail.com Wed Sep 3 13:17:51 2008 From: nicktastic at gmail.com (Nick) Date: Wed, 3 Sep 2008 16:17:51 -0400 Subject: [Conkeror] Another isearch bug Message-ID: This bug appears when using the tab-bar and/or clicks-in-new-buffer modes. 1. Load a page. 2. isearch for something. 3. Middle click to load a new page and switch to that page by clicking its tab or click the X on the tab to close the buffer. In either case, do not close the isearch. 4. Continue isearching in box from previous page. 5. Observe failure which of course varies depending on whether you opened a new buffer or closed the old buffer. In the latter case it is sometimes difficult get the isearch to close at all. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmhouse at gmail.com Thu Sep 4 05:55:59 2008 From: dmhouse at gmail.com (David House) Date: Thu, 4 Sep 2008 13:55:59 +0100 Subject: [Conkeror] [PATCH] Session management: restore saved buffers from a JSON file. In-Reply-To: <> References: <> Message-ID: <1220532959-9121-1-git-send-email-dmhouse@gmail.com> This is the first round of session management support. It's not feature-complete, and it's not bug free, but it's just about useful, so I thought it was about time to ship some code. To restore the buffers at startup that were open last time (in the correct windows), add the following line to your RC file: restore_session(); You can also use M-x restore-session at any time to load the stored buffers (this does nothing to your currently-open buffers). At the moment, the following restrictions are in place: 1. You must use conkeror -batch to start conkeror, otherwise you will get an additional window containing the homepage. 2. By virtue of the above, opening conkeror via a remoting function (i.e. clicking on a link in some other application to start conkeror) will open your saved buffers and the new buffer in different windows. 3. You must quit conkeror using C-x C-c, rather than through your window manager, if you want the session to be saved. Work to be done: 1. Refactor the new modules/json.js to use modules/io.js. 2. Get rid of the code duplication in modules/buffers.js by making modules/window.js aware of which windows aren't fully initialised. 3. Resolve the above restrictions 4. Add additional features: at a minimum I think we should also save buffer history (so that `go-back' will work on restored buffers) and minibuffer history. --- components/application.js | 2 + defaults/preferences/default-modules.js | 2 + modules/buffer.js | 40 +++++++++++++++ modules/json.js | 66 +++++++++++++++++++++++++ modules/session.js | 81 +++++++++++++++++++++++++++++++ modules/window.js | 25 +++++---- 6 files changed, 205 insertions(+), 11 deletions(-) create mode 100644 modules/json.js create mode 100644 modules/session.js diff --git a/components/application.js b/components/application.js index 035bb0e..1ccb844 100644 --- a/components/application.js +++ b/components/application.js @@ -33,6 +33,8 @@ application.prototype = { Cc: Cc, Ci: Ci, Cr: Cr, + profile_dir: Cc["@mozilla.org/file/directory_service;1"] + .getService(Ci.nsIProperties).get("ProfD", Ci.nsIFile).path, /* Note: resource://app currently doesn't result in xpcnativewrappers=yes */ module_uri_prefix: "chrome://conkeror-modules/content/", subscript_loader: Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader), diff --git a/defaults/preferences/default-modules.js b/defaults/preferences/default-modules.js index d4147a4..e7b6d5c 100644 --- a/defaults/preferences/default-modules.js +++ b/defaults/preferences/default-modules.js @@ -44,6 +44,8 @@ pref("conkeror.load.daemon", 1); pref("conkeror.load.favicon", 1); // Enhances tab-bar mode pref("conkeror.load.tab-bar", 0); +pref("conkeror.load.session", 1); + // Extension support modules // These modules will automatically skip loading if the associated extension is not enabled. pref("conkeror.load.extensions/dom-inspector", 1); diff --git a/modules/buffer.js b/modules/buffer.js index 98b1f31..f405730 100644 --- a/modules/buffer.js +++ b/modules/buffer.js @@ -51,6 +51,46 @@ function buffer_creator(type) { } } +/* NOTE this code is horifically duplicated from +create_buffer_in_current_window. The correct way to fix this is to make +window.js be aware of the currently uninitialised windows, which isn't too hard +but I just haven't done it yet. */ +var mbc_queued_buffer_creators = {}; +function mbc_process_queued_buffer_creators(window) { + for (var i = 0; i < mbc_queued_buffer_creators[window.tag].length; i++) { + mbc_queued_buffer_creators[window.tag][i](window, null); + } + mbc_queued_buffer_creators[window.tag] = null; +} + +/** + * A buffer creator to make many buffers at once. Example: + * + * var cr = many_buffers_creator( + * [buffer_creator(content_buffer, $load = "http://google.com"), + * buffer_creator(content_buffer, $load = "http://reddit.com")]); + * make_window(cr); + */ +function multiple_buffers_creator(creators) { + return function (window, element) { + // Conkeror must have at least one buffer, so load the homepage if + // nothing else is specified + if (creators.length == 0) + return new content_buffer(window, element, $load = homepage); + + for (var i = 0; i < creators.length; i++) { + if (typeof mbc_queued_buffer_creators[window.tag] != "undefined") { + mbc_queued_buffer_creators[window.tag].push(creators[i]); + } else { + mbc_queued_buffer_creators[window.tag] = []; + window.buffers.current = creators[i](window, element); + add_hook.call(window, "window_initialize_late_hook", + mbc_process_queued_buffer_creators); + } + } + } +} + define_variable("allow_browser_window_close", true, "If this is set to true, if a content buffer page calls " + "window.close() from JavaScript and is not prevented by the " + diff --git a/modules/json.js b/modules/json.js new file mode 100644 index 0000000..6ddd5f2 --- /dev/null +++ b/modules/json.js @@ -0,0 +1,66 @@ +/** JSON SUPPORT + * Utility class for encoding and decoding JSON. + */ + +function json() { + this.json = Cc["@mozilla.org/dom/json;1"] .createInstance(Ci.nsIJSON); +} + +/** + * Encode obj into JSON, return it. + */ +json.prototype.encode = function(obj) { + return this.json.encode(obj); +} + +/** + * Decode str as a JSON string, and return the resulting object. + */ +json.prototype.decode = function(str) { + return this.json.decode(str); +} + +/** + * Encode obj into JSON, and save it into path. + */ +json.prototype.encodeToFile = function(path, obj) { + // We should theoretically be able to use nsIJSON.encodeToStream to avoid + // doing the UTF encoding ourselves, but I couldn't get it to output + // anything other than an empty string. + var cos = Cc["@mozilla.org/intl/converter-output-stream;1"] + .createInstance(Ci.nsIConverterOutputStream); + var os = Cc["@mozilla.org/network/file-output-stream;1"] + .createInstance(Ci.nsIFileOutputStream); + var file = Cc["@mozilla.org/file/local;1"] + .createInstance(Ci.nsILocalFile); + file.initWithPath(path); + os.init(file, -1, -1, 0); + cos.init(os, "UTF-8", 0, 0); + cos.writeString(this.json.encode(obj)); + cos.close(); +} + +/** + * Read the file at path, decode it, and return the resulting object. + */ +json.prototype.decodeFromFile = function(path) { + var cis = Cc["@mozilla.org/intl/converter-input-stream;1"] + .createInstance(Ci.nsIConverterInputStream); + var is = Cc["@mozilla.org/network/file-input-stream;1"] + .createInstance(Ci.nsIFileInputStream); + const replace = Ci .nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER; + var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); + file.initWithPath(path); + is.init(file, -1, 0, 0); + cis.init(is, "UTF-8", 1024, replace); + + var str = {}; + var input = ""; + while (cis.readString(4096, str) != 0) { + input += str.value; + } + is.close(); + return this.json.decode(input); +} + +conkeror.json = new json(); \ No newline at end of file diff --git a/modules/session.js b/modules/session.js new file mode 100644 index 0000000..af4bbe1 --- /dev/null +++ b/modules/session.js @@ -0,0 +1,81 @@ +/** SESSION MANAGEMENT + * Writes buffers to disc via JSON at shutdown, and restores them on startup. + * If you wish restore the buffers at startup that you had open last time, you + * should just need to add the following line to your rc file: + * + * restore_session(); + */ + +require('json.js'); + +function session_manager(sess_file) { + if (typeof sess_file == "undefined") + sess_file = profile_dir + "/session.json"; + this.path = sess_file; + this.session = json.decodeFromFile(sess_file); +} + +/** + * Fetch an array mapping window tags to lists of buffers + */ +session_manager.prototype.get_session = function () { + var ar = {}; + for_each_window(function (w) { + ar[w.tag] = {buffers : []}; + var bl = w.buffers.buffer_list; + for (var i = 0; i < bl.length; i++) { + if (bl[i].generated) continue; + ar[w.tag].buffers[i] = bl[i].browser.contentDocument.location.href; + } + }); + return ar; +} + +/** + * Encode a session to disk + */ +session_manager.prototype.save = function () { + json.encodeToFile(this.path, this.get_session()); +} + +add_hook("quit_hook", + function () { if (typeof session != "undefined") session.save(); }); + +/** + * Restore from the session + */ +session_manager.prototype.restore = function () { + var creators; + for (var tag in session.session) { + creators = []; + for each (var url in session.session[tag].buffers) { + creators.push(buffer_creator(content_buffer, $load = url)); + } + make_window(multiple_buffers_creator(creators), tag); + } +} + +/** + * The main entry point. Load all the buffers from the session at `sess_file', + * using a default of /session.json. Thus, to use session + * management, adding the following to your rcfile should be all that's + * necessary: + * + * restore_session() + */ +function restore_session(sess_file) { + conkeror.session = new session_manager(sess_file); + session.restore(); +} + +interactive( + "restore-session", + "Prompt on the minibuffer for a session file to load, then open all the " + + "buffers listed in that file. The default path is " + profile_dir + + "/session.json.", + function (I) { + var sess_file = yield I.minibuffer.read_file_path( + $prompt = "Session file:", + $initial_value = profile_dir + "/session.json"); + restore_session(sess_file); + }); diff --git a/modules/window.js b/modules/window.js index 518c78e..c45eb08 100644 --- a/modules/window.js +++ b/modules/window.js @@ -57,22 +57,26 @@ function generate_new_window_tag(tag) } } -function make_chrome_window(chrome_URI, args) -{ - return window_watcher.openWindow(null, chrome_URI, "_blank", +var chrome_uniquify_index = 0 + +function make_chrome_window(chrome_url, args, tag) { + // We append a query guaranteed to be unique to the chrome URL in order to + // work around a bug in XULRunner. See http://conkeror.org/UpstreamBugs + url_with_query = chrome_url + "?i=" + chrome_uniquify_index; + chrome_uniquify_index++; + return window_watcher.openWindow(null, url_with_query, "_blank", "chrome,dialog=no,all,resizable", args); } var conkeror_chrome_URI = "chrome://conkeror/content/conkeror.xul"; -function make_window(initial_buffer_creator, tag) -{ +function make_window(initial_buffer_creator, tag) { var args = { tag: tag, initial_buffer_creator: initial_buffer_creator }; - var result = make_chrome_window(conkeror_chrome_URI, null); - result.args = args; - make_window_hook.run(result); - return result; + var window = make_chrome_window(conkeror_chrome_URI, null, tag); + window.args = args; + make_window_hook.run(window); + return window; } function get_window_by_tag(tag) @@ -163,8 +167,7 @@ function window_initialize(window) // Set tag var tag = null; - if ('tag' in window.args) - tag = window.args.tag; + if ('tag' in window.args) tag = window.args.tag; window.tag = generate_new_window_tag(tag); // Add a getBrowser() function to help certain extensions designed for Firefox work with conkeror -- 1.5.4.3 From vyazovoi at gmail.com Thu Sep 4 08:02:03 2008 From: vyazovoi at gmail.com (Vyazovoi Pavel) Date: Thu, 04 Sep 2008 21:02:03 +0600 Subject: [Conkeror] [PATCH] Session management: restore saved buffers from a JSON file. In-Reply-To: <1220532959-9121-1-git-send-email-dmhouse@gmail.com> Message-ID: <8763pcymxg.wl%vyazovoi@gmail.com> At Thu, 4 Sep 2008 13:55:59 +0100, David House wrote: Good job! Thanks, but... After patching latest git revision - conkeror don't start without any errors. > > This is the first round of session management support. It's not > feature-complete, and it's not bug free, but it's just about useful, so I > thought it was about time to ship some code. To restore the buffers at startup > that were open last time (in the correct windows), add the following line to > your RC file: > > restore_session(); > > You can also use M-x restore-session at any time to load the stored buffers > (this does nothing to your currently-open buffers). At the moment, the following > restrictions are in place: > > 1. You must use conkeror -batch to start conkeror, otherwise you will get an > additional window containing the homepage. > 2. By virtue of the above, opening conkeror via a remoting function (i.e. > clicking on a link in some other application to start conkeror) will open > your saved buffers and the new buffer in different windows. > 3. You must quit conkeror using C-x C-c, rather than through your window > manager, if you want the session to be saved. > > Work to be done: > > 1. Refactor the new modules/json.js to use modules/io.js. > 2. Get rid of the code duplication in modules/buffers.js by making > modules/window.js aware of which windows aren't fully initialised. > 3. Resolve the above restrictions > 4. Add additional features: at a minimum I think we should also save buffer > history (so that `go-back' will work on restored buffers) and minibuffer > history. > --- > components/application.js | 2 + > defaults/preferences/default-modules.js | 2 + > modules/buffer.js | 40 +++++++++++++++ > modules/json.js | 66 +++++++++++++++++++++++++ > modules/session.js | 81 +++++++++++++++++++++++++++++++ > modules/window.js | 25 +++++---- > 6 files changed, 205 insertions(+), 11 deletions(-) > create mode 100644 modules/json.js > create mode 100644 modules/session.js > > diff --git a/components/application.js b/components/application.js > ... From dmhouse at gmail.com Thu Sep 4 08:56:15 2008 From: dmhouse at gmail.com (David House) Date: Thu, 4 Sep 2008 16:56:15 +0100 Subject: [Conkeror] [PATCH] Session management: get rid of modules/json.js, since io.js makes things so In-Reply-To: <> References: <> Message-ID: <1220543775-18707-1-git-send-email-dmhouse@gmail.com> --- modules/json.js | 66 ---------------------------------------------------- modules/session.js | 9 ++++--- 2 files changed, 5 insertions(+), 70 deletions(-) delete mode 100644 modules/json.js diff --git a/modules/json.js b/modules/json.js deleted file mode 100644 index 6ddd5f2..0000000 --- a/modules/json.js +++ /dev/null @@ -1,66 +0,0 @@ -/** JSON SUPPORT - * Utility class for encoding and decoding JSON. - */ - -function json() { - this.json = Cc["@mozilla.org/dom/json;1"] .createInstance(Ci.nsIJSON); -} - -/** - * Encode obj into JSON, return it. - */ -json.prototype.encode = function(obj) { - return this.json.encode(obj); -} - -/** - * Decode str as a JSON string, and return the resulting object. - */ -json.prototype.decode = function(str) { - return this.json.decode(str); -} - -/** - * Encode obj into JSON, and save it into path. - */ -json.prototype.encodeToFile = function(path, obj) { - // We should theoretically be able to use nsIJSON.encodeToStream to avoid - // doing the UTF encoding ourselves, but I couldn't get it to output - // anything other than an empty string. - var cos = Cc["@mozilla.org/intl/converter-output-stream;1"] - .createInstance(Ci.nsIConverterOutputStream); - var os = Cc["@mozilla.org/network/file-output-stream;1"] - .createInstance(Ci.nsIFileOutputStream); - var file = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); - file.initWithPath(path); - os.init(file, -1, -1, 0); - cos.init(os, "UTF-8", 0, 0); - cos.writeString(this.json.encode(obj)); - cos.close(); -} - -/** - * Read the file at path, decode it, and return the resulting object. - */ -json.prototype.decodeFromFile = function(path) { - var cis = Cc["@mozilla.org/intl/converter-input-stream;1"] - .createInstance(Ci.nsIConverterInputStream); - var is = Cc["@mozilla.org/network/file-input-stream;1"] - .createInstance(Ci.nsIFileInputStream); - const replace = Ci .nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER; - var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); - file.initWithPath(path); - is.init(file, -1, 0, 0); - cis.init(is, "UTF-8", 1024, replace); - - var str = {}; - var input = ""; - while (cis.readString(4096, str) != 0) { - input += str.value; - } - is.close(); - return this.json.decode(input); -} - -conkeror.json = new json(); \ No newline at end of file diff --git a/modules/session.js b/modules/session.js index af4bbe1..4efc690 100644 --- a/modules/session.js +++ b/modules/session.js @@ -6,13 +6,12 @@ * restore_session(); */ -require('json.js'); - function session_manager(sess_file) { if (typeof sess_file == "undefined") sess_file = profile_dir + "/session.json"; this.path = sess_file; - this.session = json.decodeFromFile(sess_file); + this.session = Cc["@mozilla.org/dom/json;1"] .createInstance(Ci.nsIJSON) + .decode(read_text_file(get_file(sess_file))); } /** @@ -35,7 +34,9 @@ session_manager.prototype.get_session = function () { * Encode a session to disk */ session_manager.prototype.save = function () { - json.encodeToFile(this.path, this.get_session()); + var data = Cc["@mozilla.org/dom/json;1"] .createInstance(Ci.nsIJSON) + .encode(this.get_session()) + write_text_file(get_file(this.path), data); } add_hook("quit_hook", -- 1.5.4.3 From eichin at gmail.com Fri Sep 5 13:32:19 2008 From: eichin at gmail.com (Mark Eichin) Date: Fri, 5 Sep 2008 16:32:19 -0400 Subject: [Conkeror] [PATCH] Session management: restore saved buffers from a JSON file. In-Reply-To: <8763pcymxg.wl%vyazovoi@gmail.com> References: <1220532959-9121-1-git-send-email-dmhouse@gmail.com> <8763pcymxg.wl%vyazovoi@gmail.com> Message-ID: >> 3. You must quit conkeror using C-x C-c, rather than through your window >> manager, if you want the session to be saved. I suggest supporting C-x C-s for "save right now" to work with our existing save-early-save-often emacs reflexes (and this is what my xmlhttprequest-based session-saving does too :-) Should be just a direct binding to session.save()... From dmhouse at gmail.com Fri Sep 5 14:53:33 2008 From: dmhouse at gmail.com (David House) Date: Fri, 5 Sep 2008 22:53:33 +0100 Subject: [Conkeror] [PATCH] Session management: restore saved buffers from a JSON file. In-Reply-To: References: <1220532959-9121-1-git-send-email-dmhouse@gmail.com> <8763pcymxg.wl%vyazovoi@gmail.com> Message-ID: 2008/9/5 Mark Eichin : > I suggest supporting C-x C-s for "save right now" to work with our > existing save-early-save-often emacs reflexes (and this is what my > xmlhttprequest-based session-saving does too :-) Should be just a > direct binding to session.save()... Sounds good. Care to add an interactive definition to modules/session.js and a binding to modules/bindings/default/global.js, and submit it as a patch? :) -- -David From dmhouse at gmail.com Fri Sep 5 17:09:48 2008 From: dmhouse at gmail.com (David House) Date: Sat, 6 Sep 2008 01:09:48 +0100 Subject: [Conkeror] [PATCH] Make window.js aware of which windows are uninitialized. Use this to make In-Reply-To: <> References: <> Message-ID: <1220659788-22931-1-git-send-email-dmhouse@gmail.com> --- modules/buffer.js | 65 +++++++++++++++------------------------------------- modules/window.js | 64 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 62 insertions(+), 67 deletions(-) diff --git a/modules/buffer.js b/modules/buffer.js index f405730..c0085fc 100644 --- a/modules/buffer.js +++ b/modules/buffer.js @@ -51,18 +51,6 @@ function buffer_creator(type) { } } -/* NOTE this code is horifically duplicated from -create_buffer_in_current_window. The correct way to fix this is to make -window.js be aware of the currently uninitialised windows, which isn't too hard -but I just haven't done it yet. */ -var mbc_queued_buffer_creators = {}; -function mbc_process_queued_buffer_creators(window) { - for (var i = 0; i < mbc_queued_buffer_creators[window.tag].length; i++) { - mbc_queued_buffer_creators[window.tag][i](window, null); - } - mbc_queued_buffer_creators[window.tag] = null; -} - /** * A buffer creator to make many buffers at once. Example: * @@ -77,17 +65,11 @@ function multiple_buffers_creator(creators) { // nothing else is specified if (creators.length == 0) return new content_buffer(window, element, $load = homepage); - - for (var i = 0; i < creators.length; i++) { - if (typeof mbc_queued_buffer_creators[window.tag] != "undefined") { - mbc_queued_buffer_creators[window.tag].push(creators[i]); - } else { - mbc_queued_buffer_creators[window.tag] = []; - window.buffers.current = creators[i](window, element); - add_hook.call(window, "window_initialize_late_hook", - mbc_process_queued_buffer_creators); - } - } + + creators.shift()(window, element); // Create the first directly + creators.forEach(function (cr) { + create_buffer(window, cr, OPEN_NEW_BUFFER_BACKGROUND); + }); } } @@ -553,13 +535,20 @@ interactive_context.prototype.browse_target = function (action) { return targets[index]; }; +/** + * Open a buffer on `window'. If that window isn't fully initialized, queue the + * buffer for creation on `window_initialize_late_hook'. + */ function create_buffer(window, creator, target) { switch (target) { case OPEN_NEW_BUFFER: - window.buffers.current = creator(window, null); - break; case OPEN_NEW_BUFFER_BACKGROUND: - creator(window, null); + var mk_buffer = function (w) { + var buf = creator(w, null); + if (target == OPEN_NEW_BUFFER) window.buffers.current = buf; + } + if (window.initialized) mk_buffer(window); + else add_hook.call(window, "window_initialize_late_hook", mk_buffer); break; case OPEN_NEW_WINDOW: make_window(creator); @@ -569,29 +558,13 @@ function create_buffer(window, creator, target) { } } -var queued_buffer_creators = null; -function _process_queued_buffer_creators(window) { - for (var i = 0; i < queued_buffer_creators.length; ++i) { - var x = queued_buffer_creators[i]; - create_buffer(window, x[0], x[1]); - } - queued_buffer_creators = null; -} function create_buffer_in_current_window(creator, target, focus_existing) { if (target == OPEN_NEW_WINDOW) throw new Error("invalid target"); - var window = get_recent_conkeror_window(); - if (window) { - if (focus_existing) - window.focus(); - create_buffer(window, creator, target); - } else if (queued_buffer_creators != null) { - queued_buffer_creators.push([creator,target]); - } else { - queued_buffer_creators = []; - window = make_window(creator); - add_hook.call(window, "window_initialize_late_hook", _process_queued_buffer_creators); - } + var window = get_recent_conkeror_window(true); + if (!window) return make_window(creator); + if (window && focus_existing) window.focus(); + create_buffer(window, creator, target); } minibuffer_auto_complete_preferences["buffer"] = true; diff --git a/modules/window.js b/modules/window.js index c45eb08..2933fe2 100644 --- a/modules/window.js +++ b/modules/window.js @@ -10,13 +10,11 @@ require("mode.js"); var define_window_local_hook = simple_local_hook_definer(); - define_hook("make_window_hook"); var window_watcher = Cc["@mozilla.org/embedcomp/window-watcher;1"].getService(Ci.nsIWindowWatcher); -function generate_new_window_tag(tag) -{ +function generate_new_window_tag(tag) { var existing = []; var exact_match = false; var en = window_watcher.getWindowEnumerator (); @@ -27,17 +25,20 @@ function generate_new_window_tag(tag) } else { re = new RegExp ("^(\\d+)$"); } + var tags = []; while (en.hasMoreElements ()) { var w = en.getNext().QueryInterface (Ci.nsIDOMWindow); - if ('tag' in w) { - if (tag && w.tag == tag) { - exact_match = true; - continue; - } - var re_result = re.exec (w.tag); - if (re_result) - existing.push (re_result[1]); + if ("tag" in w) tags.push(w.tag); + } + tags = tags.concat([w.tag for (w in uninitialized_windows)]); + for (var i = 0; i < tags.length; i++) { + if (tag && tags[i] == tag) { + exact_match = true; + continue; } + var re_result = re.exec (tags[i]); + if (re_result) + existing.push (re_result[1]); } if (tag && ! exact_match) return tag; @@ -70,16 +71,26 @@ function make_chrome_window(chrome_url, args, tag) { var conkeror_chrome_URI = "chrome://conkeror/content/conkeror.xul"; +var uninitialized_windows = []; + function make_window(initial_buffer_creator, tag) { - var args = { tag: tag, + var uniq_tag = generate_new_window_tag(tag); + var args = { tag: uniq_tag, initial_buffer_creator: initial_buffer_creator }; - var window = make_chrome_window(conkeror_chrome_URI, null, tag); + var window = make_chrome_window(conkeror_chrome_URI, null, uniq_tag); + window.tag = uniq_tag; window.args = args; + window.initialized = false; + uninitialized_windows.push(window); make_window_hook.run(window); return window; } -function get_window_by_tag(tag) +/** + * Fetch a window object by its unique tag. Only search the initialized windows, + * unless `uninitialized' is true. + */ +function get_window_by_tag(tag, uninitialized) { var en = window_watcher.getWindowEnumerator (); while (en.hasMoreElements ()) { @@ -87,6 +98,10 @@ function get_window_by_tag(tag) if ('tag' in w && w.tag == tag) return w; } + if (typeof uninitialized != "undefined" && uninitialized) { + var matching = uninitialized_windows.filter(function (w) w.tag == tag); + if (matching.length > 0) return matching[0]; + } return null; } @@ -101,7 +116,7 @@ function for_each_window(func) } } -function get_recent_conkeror_window() +function get_recent_conkeror_window(uninitialized) { var window = window_watcher.activeWindow; if (window && ("conkeror" in window)) @@ -112,6 +127,13 @@ function get_recent_conkeror_window() if ('conkeror' in window) return window; } + if (typeof uninitialized != "undefined" && uninitialized && + uninitialized_windows.length > 0) + { + // None of these can be active yet, so just return the first we tried to + // create + return uninitialized_windows[0]; + } return null; } @@ -165,11 +187,6 @@ function window_initialize(window) window_setup_args(window); - // Set tag - var tag = null; - if ('tag' in window.args) tag = window.args.tag; - window.tag = generate_new_window_tag(tag); - // Add a getBrowser() function to help certain extensions designed for Firefox work with conkeror window.getBrowser = window_get_this_browser; @@ -186,8 +203,13 @@ function window_initialize(window) },0); window.addEventListener("close", window_close_maybe, true /* capture */, false); -} + // Mark this window as initialized + uninitialized_windows = + uninitialized_windows.filter(function (w) w.tag != window.tag); + window.initialized = true; +} + define_window_local_hook("window_before_close_hook", RUN_HOOK_UNTIL_FAILURE); define_window_local_hook("window_close_hook", RUN_HOOK); function window_close_maybe(event) { -- 1.5.4.3 From jeremy at jeremyms.com Fri Sep 5 18:59:07 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Fri, 05 Sep 2008 18:59:07 -0700 Subject: [Conkeror] [PATCH] Make window.js aware of which windows are uninitialized. Use this to make In-Reply-To: <1220659788-22931-1-git-send-email-dmhouse@gmail.com> (David House's message of "Sat, 6 Sep 2008 01:09:48 +0100") References: <1220659788-22931-1-git-send-email-dmhouse@gmail.com> Message-ID: <87prniqbkk.fsf@jeremyms.com> David House writes: See below for my comments. Other than the issues I pointed out, this seems good to go in. > --- > modules/buffer.js | 65 +++++++++++++++------------------------------------- > modules/window.js | 64 +++++++++++++++++++++++++++++++++++----------------- > 2 files changed, 62 insertions(+), 67 deletions(-) > diff --git a/modules/buffer.js b/modules/buffer.js > index f405730..c0085fc 100644 > --- a/modules/buffer.js > +++ b/modules/buffer.js > @@ -51,18 +51,6 @@ function buffer_creator(type) { > } > } > -/* NOTE this code is horifically duplicated from > -create_buffer_in_current_window. The correct way to fix this is to make > -window.js be aware of the currently uninitialised windows, which isn't too hard > -but I just haven't done it yet. */ > -var mbc_queued_buffer_creators = {}; > -function mbc_process_queued_buffer_creators(window) { > - for (var i = 0; i < mbc_queued_buffer_creators[window.tag].length; i++) { > - mbc_queued_buffer_creators[window.tag][i](window, null); > - } > - mbc_queued_buffer_creators[window.tag] = null; > -} > - It would help if you made this patch against the Conkeror upstream master, rather than against your previous patch. > /** > * A buffer creator to make many buffers at once. Example: > * > @@ -77,17 +65,11 @@ function multiple_buffers_creator(creators) { > // nothing else is specified > if (creators.length == 0) > return new content_buffer(window, element, $load = homepage); > - > - for (var i = 0; i < creators.length; i++) { > - if (typeof mbc_queued_buffer_creators[window.tag] != "undefined") { > - mbc_queued_buffer_creators[window.tag].push(creators[i]); > - } else { > - mbc_queued_buffer_creators[window.tag] = []; > - window.buffers.current = creators[i](window, element); > - add_hook.call(window, "window_initialize_late_hook", > - mbc_process_queued_buffer_creators); > - } > - } > + > + creators.shift()(window, element); // Create the first directly > + creators.forEach(function (cr) { > + create_buffer(window, cr, OPEN_NEW_BUFFER_BACKGROUND); > + }); > } > } It seems like this stuff doesn't really belong in this patch. > @@ -553,13 +535,20 @@ interactive_context.prototype.browse_target = function > (action) { > return targets[index]; > }; > +/** > + * Open a buffer on `window'. If that window isn't fully initialized, queue the > + * buffer for creation on `window_initialize_late_hook'. > + */ > function create_buffer(window, creator, target) { > switch (target) { > case OPEN_NEW_BUFFER: > - window.buffers.current = creator(window, null); > - break; > case OPEN_NEW_BUFFER_BACKGROUND: > - creator(window, null); > + var mk_buffer = function (w) { > + var buf = creator(w, null); > + if (target == OPEN_NEW_BUFFER) window.buffers.current = buf; > + } > + if (window.initialized) mk_buffer(window); > + else add_hook.call(window, "window_initialize_late_hook", mk_buffer); > break; > case OPEN_NEW_WINDOW: > make_window(creator); > @@ -569,29 +558,13 @@ function create_buffer(window, creator, target) { > } > } > -var queued_buffer_creators = null; > -function _process_queued_buffer_creators(window) { > - for (var i = 0; i < queued_buffer_creators.length; ++i) { > - var x = queued_buffer_creators[i]; > - create_buffer(window, x[0], x[1]); > - } > - queued_buffer_creators = null; > -} > function create_buffer_in_current_window(creator, target, focus_existing) { > if (target == OPEN_NEW_WINDOW) > throw new Error("invalid target"); > - var window = get_recent_conkeror_window(); > - if (window) { > - if (focus_existing) > - window.focus(); > - create_buffer(window, creator, target); > - } else if (queued_buffer_creators != null) { > - queued_buffer_creators.push([creator,target]); > - } else { > - queued_buffer_creators = []; > - window = make_window(creator); > - add_hook.call(window, "window_initialize_late_hook", > _process_queued_buffer_creators); > - } > + var window = get_recent_conkeror_window(true); > + if (!window) return make_window(creator); > + if (window && focus_existing) window.focus(); > + create_buffer(window, creator, target); > } > minibuffer_auto_complete_preferences["buffer"] = true; > diff --git a/modules/window.js b/modules/window.js > index c45eb08..2933fe2 100644 > --- a/modules/window.js > +++ b/modules/window.js > @@ -10,13 +10,11 @@ require("mode.js"); > var define_window_local_hook = simple_local_hook_definer(); > - > define_hook("make_window_hook"); > var window_watcher = > Cc["@mozilla.org/embedcomp/window-watcher;1"].getService(Ci.nsIWindowWatcher); > -function generate_new_window_tag(tag) > -{ > +function generate_new_window_tag(tag) { > var existing = []; > var exact_match = false; > var en = window_watcher.getWindowEnumerator (); > @@ -27,17 +25,20 @@ function generate_new_window_tag(tag) > } else { > re = new RegExp ("^(\\d+)$"); > } > + var tags = []; > while (en.hasMoreElements ()) { > var w = en.getNext().QueryInterface (Ci.nsIDOMWindow); > - if ('tag' in w) { > - if (tag && w.tag == tag) { > - exact_match = true; > - continue; > - } > - var re_result = re.exec (w.tag); > - if (re_result) > - existing.push (re_result[1]); > + if ("tag" in w) tags.push(w.tag); > + } > + tags = tags.concat([w.tag for (w in uninitialized_windows)]); > + for (var i = 0; i < tags.length; i++) { > + if (tag && tags[i] == tag) { > + exact_match = true; > + continue; > } > + var re_result = re.exec (tags[i]); > + if (re_result) > + existing.push (re_result[1]); > } > if (tag && ! exact_match) > return tag; > @@ -70,16 +71,26 @@ function make_chrome_window(chrome_url, args, tag) { > var conkeror_chrome_URI = "chrome://conkeror/content/conkeror.xul"; > +var uninitialized_windows = []; > + > function make_window(initial_buffer_creator, tag) { > - var args = { tag: tag, > + var uniq_tag = generate_new_window_tag(tag); > + var args = { tag: uniq_tag, > initial_buffer_creator: initial_buffer_creator }; > - var window = make_chrome_window(conkeror_chrome_URI, null, tag); > + var window = make_chrome_window(conkeror_chrome_URI, null, uniq_tag); > + window.tag = uniq_tag; The reason that the tag was set in window_initialize rather than here is that in some cases (one example is for when target=_blank is used or content JavaScript calls window.open and we decide to create a new window) Mozilla creates the window for us, rather than make_window being called. So you should also set the tag in window_initialize if it has not already been set. > window.args = args; > + window.initialized = false; > + uninitialized_windows.push(window); > make_window_hook.run(window); > return window; > } > -function get_window_by_tag(tag) > +/** > + * Fetch a window object by its unique tag. Only search the initialized > windows, > + * unless `uninitialized' is true. > + */ > +function get_window_by_tag(tag, uninitialized) > { > var en = window_watcher.getWindowEnumerator (); > while (en.hasMoreElements ()) { > @@ -87,6 +98,10 @@ function get_window_by_tag(tag) > if ('tag' in w && w.tag == tag) > return w; > } > + if (typeof uninitialized != "undefined" && uninitialized) { > + var matching = uninitialized_windows.filter(function (w) w.tag == tag); > + if (matching.length > 0) return matching[0]; > + } It doesn't matter too much, but note that using the filter function adds a bit of overhead since you have a bunch of function calls and construct an array, whereas if you just use: for (let x = 0; x < uninitialized_windows.length; ++x) { if (x.tag == tag) return x; } it will be slightly more efficient. > return null; > } > @@ -101,7 +116,7 @@ function for_each_window(func) > } > } > -function get_recent_conkeror_window() > +function get_recent_conkeror_window(uninitialized) > { > var window = window_watcher.activeWindow; > if (window && ("conkeror" in window)) > @@ -112,6 +127,13 @@ function get_recent_conkeror_window() > if ('conkeror' in window) > return window; > } > + if (typeof uninitialized != "undefined" && uninitialized && > + uninitialized_windows.length > 0) I suppose all of the typeof checking is to quiet warnings about accessing undefined variables? > + { > + // None of these can be active yet, so just return the first we tried to > + // create > + return uninitialized_windows[0]; > + } > return null; > } > @@ -165,11 +187,6 @@ function window_initialize(window) > window_setup_args(window); > - // Set tag > - var tag = null; > - if ('tag' in window.args) tag = window.args.tag; > - window.tag = generate_new_window_tag(tag); > - As I described above, you'll still need something here. > // Add a getBrowser() function to help certain extensions designed for > Firefox work with conkeror > window.getBrowser = window_get_this_browser; > @@ -186,8 +203,13 @@ function window_initialize(window) > },0); > window.addEventListener("close", window_close_maybe, true /* capture */, > false); > -} > + // Mark this window as initialized > + uninitialized_windows = > + uninitialized_windows.filter(function (w) w.tag != window.tag); > + window.initialized = true; > +} > + I think this should instead be done just after running the window_initialize_late_hook. > define_window_local_hook("window_before_close_hook", RUN_HOOK_UNTIL_FAILURE); > define_window_local_hook("window_close_hook", RUN_HOOK); > function window_close_maybe(event) { -- Jeremy Maitin-Shepard From dmhouse at gmail.com Sat Sep 6 04:50:26 2008 From: dmhouse at gmail.com (David House) Date: Sat, 6 Sep 2008 12:50:26 +0100 Subject: [Conkeror] [PATCH] Make window.js aware of which windows are uninitialized. Use this to make In-Reply-To: <87prniqbkk.fsf@jeremyms.com> References: <1220659788-22931-1-git-send-email-dmhouse@gmail.com> <87prniqbkk.fsf@jeremyms.com> Message-ID: 2008/9/6 Jeremy Maitin-Shepard : > It would help if you made this patch against the Conkeror upstream > master, rather than against your previous patch. > ... > It seems like this stuff doesn't really belong in this patch. I've split the commit into two commits, one that puts all the infrastructure in place and makes create_buffer smart, and a second which changes `multiple_buffers_creator' (introduced with my session management patch) to use this infrastructure. Attached are the outputs for git format-patch for those two. I couldn't quite find a way to create a patch which would contain these changes, without conflicting with my session management. I got fairly close, though, it should be that the only bit of the diff that won't apply against conkeror currently (i.e., before the session management patch) is the bit that changes `make_chrome_window'. (It should work if you apply the session management patch first.) For reference, this is what that function should look: function make_chrome_window(chrome_url, args, tag) { // We append a query guaranteed to be unique to the chrome URL in order to // work around a bug in XULRunner. See http://conkeror.org/UpstreamBugs url_with_query = chrome_url + "?t=" + tag; chrome_uniquify_index++; return window_watcher.openWindow(null, url_with_query, "_blank", "chrome,dialog=no,all,resizable", args); } > The reason that the tag was set in window_initialize rather than here is > that in some cases (one example is for when target=_blank is used or > content JavaScript calls window.open and we decide to create a new > window) Mozilla creates the window for us, rather than make_window being > called. So you should also set the tag in window_initialize if it has > not already been set. Done. > It doesn't matter too much, but note that using the filter function adds > a bit of overhead since you have a bunch of function calls and construct > an array, whereas if you just use: > > for (let x = 0; x < uninitialized_windows.length; ++x) { > if (x.tag == tag) > return x; > } > > it will be slightly more efficient. I thought I'd done this, but I must have forgotten to stage. Done. > I suppose all of the typeof checking is to quiet warnings about > accessing undefined variables? That was the intention, e.g.: (function (s) repl.print(typeof s))() --> "undefined" But I did some experiments and it turns out they're not necessary, so they're gone. > I think this should instead be done just after running the > window_initialize_late_hook. Done. -- -David -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Make-window.js-aware-of-uninitialized-windows-enabl.patch Type: text/x-diff Size: 8392 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Refactor-multiple_buffers_creator-to-take-advantag.patch Type: text/x-diff Size: 2221 bytes Desc: not available URL: From dmhouse at gmail.com Sat Sep 6 05:12:31 2008 From: dmhouse at gmail.com (David House) Date: Sat, 6 Sep 2008 13:12:31 +0100 Subject: [Conkeror] [PATCH] Session management: restore saved buffers from a JSON file. In-Reply-To: <8763pcymxg.wl%vyazovoi@gmail.com> References: <1220532959-9121-1-git-send-email-dmhouse@gmail.com> <8763pcymxg.wl%vyazovoi@gmail.com> Message-ID: 2008/9/4 Vyazovoi Pavel : > After patching latest git revision - conkeror don't start without any errors. If you're trying "conkeror -batch", and you have an empty session (i.e. you haven't used session management yet!), it will attempt to load that. The solution is just to start conkeror normally, then use M-x restore-session. Nothing will be loaded, but your session will be saved on close, so you will be able to start with "conkeror -batch" successfully. I probably should have mentioned that, sorry. -- -David From conkeror_at_mozdev.org at sumou.com Sat Sep 6 08:35:48 2008 From: conkeror_at_mozdev.org at sumou.com (=?UTF-8?Q?=E7=99=BD=E3=81=84=E7=86=8A?=) Date: Sat, 6 Sep 2008 17:35:48 +0200 Subject: [Conkeror] Rikaichan and conkeror, other firefox plugins Message-ID: <20080906153334.M49944@ShiroiKuma.org> I'm wondering whether one can install firefox plugins into conkeror. I've done the googling, reviewed the archives, and seems there are some hints at using plugins with Conkeror, but am not sure. Concretely, I'd like to install Rikaichan... If it's possible, can someone provide me with a step-by-step of what's necessary to install this (or other for that matter) plugin and use it under Conkeror. Thanks a lot. ShiroiKuma From jeremy at jeremyms.com Sat Sep 6 08:56:36 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Sat, 06 Sep 2008 08:56:36 -0700 Subject: [Conkeror] Rikaichan and conkeror, other firefox plugins In-Reply-To: <20080906153334.M49944@ShiroiKuma.org> (=?utf-8?B?IueZvQ==?= =?utf-8?B?44GE54aKIidz?= message of "Sat, 6 Sep 2008 17:35:48 +0200") References: <20080906153334.M49944@ShiroiKuma.org> Message-ID: <87ljy5qnd7.fsf@jeremyms.com> "???" writes: > I'm wondering whether one can install firefox plugins into conkeror. I've done > the googling, reviewed the archives, and > seems there are some hints at using plugins with Conkeror, but am not sure. > Concretely, I'd like to install Rikaichan... If it's possible, can someone > provide me with a step-by-step of what's > necessary to install this (or other for that matter) plugin and use it under > Conkeror. Well, there is a distinction between plugins, like the adobe acrobat reader plugin, and the flash plugin, and Firefox extensions like rikaichan. Firefox extensions that depend on integrating with the UI of Firefox do not tend to work with Conkeror, because they know specifically how to stick themselves in the Firefox UI, which doesn't exist in Conkeror. It is often possible, though, to look at the source code of the extension and write some "glue" code to make it work with Conkeror. -- Jeremy Maitin-Shepard From dmhouse at gmail.com Sat Sep 6 10:04:27 2008 From: dmhouse at gmail.com (David House) Date: Sat, 6 Sep 2008 18:04:27 +0100 Subject: [Conkeror] [PATCH] Session management: restore saved buffers from a JSON file. In-Reply-To: <87zlml8b9a.wl%vyazovoi@gmail.com> References: <1220532959-9121-1-git-send-email-dmhouse@gmail.com> <8763pcymxg.wl%vyazovoi@gmail.com> <87zlml8b9a.wl%vyazovoi@gmail.com> Message-ID: 2008/9/6 Vyazovoi Pavel : > Strange... > I tried patches with latest conkeror from git, with empty rc-file. So this definitely happens if you use conkeror -q? What happens if you comment out everything in modules/session.js? Are you sure the patch applied cleanly, and didn't leave any artefacts in, e.g. components/application.js? What happens if you use conkeror -q -jsconsole? -- -David From jjfoerch at earthlink.net Tue Sep 9 08:03:37 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Tue, 09 Sep 2008 11:03:37 -0400 Subject: [Conkeror] Rikaichan and conkeror, other firefox plugins References: <20080906153334.M49944@ShiroiKuma.org> <87ljy5qnd7.fsf@jeremyms.com> Message-ID: <87abeh1hva.fsf@earthlink.net> "???" writes: > > I'm wondering whether one can install firefox plugins into conkeror. I've done > the googling, reviewed the archives, and > seems there are some hints at using plugins with Conkeror, but am not sure. > > Concretely, I'd like to install Rikaichan... If it's possible, can someone > provide me with a step-by-step of what's > necessary to install this (or other for that matter) plugin and use it under > Conkeror. Just to follow up on what Jeremy said, there is a preference that will need to be set in your rc in order to install non-compatible extensions. user_pref("extensions.checkCompatibility", false); As conkeror gains fame for the awesome browser that it is, more extension authors will make provisions for their extensions to be compatible with conkeror. As people in the conkeror community figure out the steps needed to install particular non-compatible extensions, installation instructions and usage notes can be added to: http://conkeror.org/Extensions -- John Foerch From jjfoerch at earthlink.net Tue Sep 9 08:21:25 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Tue, 09 Sep 2008 11:21:25 -0400 Subject: [Conkeror] Another isearch bug References: Message-ID: <874p4p1h1m.fsf@earthlink.net> Nick writes: > This bug appears when using the tab-bar and/or clicks-in-new-buffer modes. > > 1. Load a page. > 2. isearch for something. > 3. Middle click to load a new page and switch to that page by clicking its tab or click the X on the tab > to close the buffer. In either case, do not close the isearch. > 4. Continue isearching in box from previous page. > 5. Observe failure which of course varies depending on whether you opened a new buffer or closed the old > buffer. In the latter case it is sometimes difficult get the isearch to close at all. This is not an isearch bug in particular but a general bug that affects all minibuffer interactions. I think that the solution to this is to hook onto navigation events, so that any ongoing interactive command be cancelled when the buffer is navigated to a different page. Are there any circumstances when it would be desirable to continue a command interaction independent of navigation? -- John Foerch From jjfoerch at earthlink.net Wed Sep 10 10:37:03 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Wed, 10 Sep 2008 13:37:03 -0400 Subject: [Conkeror] rc Message-ID: <87sks7c37k.fsf@earthlink.net> Hello, I just pushed a change to the repo so now ~/.conkerorrc is the default rc. (Where ~ means $HOME on most platforms, and either %USERPROFILE% or %HOMEDRIVE%+%HOMEPATH% on Windows.) This means that if you use that file for your rc, you no longer have to set the pref yourself. Updates to the wiki and help-page are forthcoming. If you don't want conkeror to try to load an rc, do the following: M-: user_pref("conkeror.rcfile", ""); or from the command line: conkeror -q -batch -e 'user_pref("conkeror.rcfile", "");' -- John Foerch From jjfoerch at earthlink.net Thu Sep 11 09:56:19 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Thu, 11 Sep 2008 12:56:19 -0400 Subject: [Conkeror] change to `interactive' Message-ID: <87myiebozw.fsf@earthlink.net> Hello, I pushed a change to the `interactive' function that will affect anyone who has command definitions in their rc. There are two changes. The first one is the main one. The second one may not affect anyone. * The second arg to interactive, `doc' is now a required positional argument. It may be null. * interactive no longer accepts the keyword $prefix. Instead, it takes as its fourth parameter an `options' object that may contain a key called `prefix'. For examples on its use, see the universal-argument commands. This change was done in preparation for, and as a first step of, the need to remove the keyword-arguments system from conkeror. Those of you who have tried the newest xulrunner nightly snapshot will have noticed that it won't run conkeror anymore. This is because keyword-arguments depends on a non-standard behavior of earlier versions of the javascript engine, which has now been fixed in the recent nightlies. Thus we lose the cool $keyword syntax in function calls, but we can replace it with a method that may be easier to understand in the long run. Instead of keywords, keyword functions will just use a simple positional argument called `options'. See `interactive' for an example. While making `doc' a required positional arg was not a strictly necessary change, it seemed like a prudent change in the interest of simplicity---interactive no longer needs to typecheck its arguments to mimick emacs-style optional docstrings, making it easier to add new functionality to interactive in the future. I would also like to put out the idea that interactive's `doc' argument could be given in the `options' object instead of as a positional parameter. It makes some sense to put it there because it is in fact "optional". If there is general consensus on that change, I would be willing to implement it, but I don't have much opinion one way or the other. -- John Foerch From nicktastic at gmail.com Thu Sep 11 21:03:56 2008 From: nicktastic at gmail.com (Nick) Date: Fri, 12 Sep 2008 00:03:56 -0400 Subject: [Conkeror] API for manipulating external MIME type handlers Message-ID: Three new functions have been checked in to allow the list of external MIME type handlers to be easily manipulated (i.e., changing the default PDF reader, video player, etc.). See http://conkeror.org/MimeTypeHandlers for more information. - Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: From tassilo at member.fsf.org Fri Sep 12 07:41:59 2008 From: tassilo at member.fsf.org (Tassilo Horn) Date: Fri, 12 Sep 2008 16:41:59 +0200 Subject: [Conkeror] Cannot follow link number 13 on a site Message-ID: <878wtxqvd4.fsf@thinkpad.tsdh.de> Hi all, On http://pi.informatik.uni-siegen.de/Projekte/sidiff/index.php I cannot follow the link no 13 or better, I can't even enter it. I enter 1 and the minibuffer shows Follow(select link): #1_ where _ is "point". When I hit 3 then, I get Follow(select link): #3_ Somehow my 1 is gone... The links 12 and 14 work, though. Is it because 13 means disaster? Does conkeror try to save me? ;-) Bye, Tassilo From nicktastic at gmail.com Fri Sep 12 10:49:07 2008 From: nicktastic at gmail.com (Nick) Date: Fri, 12 Sep 2008 13:49:07 -0400 Subject: [Conkeror] Bug tracking Message-ID: When reporting bugs, please mail a report to this list to let people know about it, and then file the report at http://conkeror.org/ConkerorBugs so it is not forgotten. - Nick -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicktastic at gmail.com Fri Sep 12 11:33:19 2008 From: nicktastic at gmail.com (Nick) Date: Fri, 12 Sep 2008 14:33:19 -0400 Subject: [Conkeror] Bug: User variable default value reported incorrectly Message-ID: Reported by: John J. Foerch Date: September 12, 2008 Status: Open Description: The default value of variables defined with define_variable is remembered for use by the help system; however if the variable is changed the default value is incorrectly reported. This may only apply to certain types of variables. 1. Change one of the default MIME type external handlers: define_mime_type_external_handler("application/pdf", "xpdf"); 2. C-h v mime_type_external_handlers 3. Notice that the default listed for /^application\/pdf$/ is xpdf when it should be evince. Discussion: < retroj`> I shouldn't spend more time on conkeror today :) :( From jjfoerch at earthlink.net Fri Sep 12 17:07:40 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Fri, 12 Sep 2008 20:07:40 -0400 Subject: [Conkeror] change to `interactive' References: <87myiebozw.fsf@earthlink.net> Message-ID: <87iqt0c3hv.fsf@earthlink.net> John J Foerch writes: > * interactive no longer accepts the keyword $prefix. Instead, it takes > as its fourth parameter an `options' object that may contain a key > called `prefix'. For examples on its use, see the universal-argument > commands. > > This change was done in preparation for, and as a first step of, the > need to remove the keyword-arguments system from conkeror. Those of you > who have tried the newest xulrunner nightly snapshot will have noticed > that it won't run conkeror anymore. This is because keyword-arguments > depends on a non-standard behavior of earlier versions of the javascript > engine, which has now been fixed in the recent nightlies. Thus we lose > the cool $keyword syntax in function calls, but we can replace it with a > method that may be easier to understand in the long run. > > Instead of keywords, keyword functions will just use a simple > positional argument called `options'. See `interactive' for an example. Hello, What I wrote about the need to replace the keywords system can be disregarded. jbms figured out another way to implement them in compliance with the language standard. I have rolled back the changes I made in this regard. -- John Foerch From mashdot at toshine.net Sat Sep 13 09:51:07 2008 From: mashdot at toshine.net ('Mash) Date: Sat, 13 Sep 2008 17:51:07 +0100 Subject: [Conkeror] Tiddlywiki with Conkeror Message-ID: <20080913165107.GA8974@grace.toshine.net> Hi, I am wanting to use Tiddlywiki with Conkeror but it does not appear to allow me to edit the text fields. A bit odd, as I can see [input:TEXT] when selecting a field but I am unable to edit, delete or input any characters. Though C-x h does highlight but I can't cut or yank. The reason for the question is that I currently symlink "/usr/share/conkeror/content/help.html" (default start page) to a local "home.html" file which I edit with frequently used bookmarks and works a treat. I now wanted to try using the tiddlywiki system instead. Anyone have any ideas, I am guessing it may be a javascript issue? 'Mash From jjfoerch at earthlink.net Sun Sep 14 16:14:15 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Sun, 14 Sep 2008 19:14:15 -0400 Subject: [Conkeror] Cannot follow link number 13 on a site References: <878wtxqvd4.fsf@thinkpad.tsdh.de> Message-ID: <87iqsy2ud4.fsf@earthlink.net> Tassilo Horn writes: > Hi all, > > On http://pi.informatik.uni-siegen.de/Projekte/sidiff/index.php I cannot > follow the link no 13 or better, I can't even enter it. I enter 1 and > the minibuffer shows > > Follow(select link): #1_ > > where _ is "point". When I hit 3 then, I get > > Follow(select link): #3_ > > Somehow my 1 is gone... > > The links 12 and 14 work, though. Is it because 13 means disaster? > Does conkeror try to save me? ;-) > > Bye, > Tassilo Link 13 worked for me. To be sure, that was the "Downloads" link in the side menu bar. Can you isolate the behavior any further? -- John Foerch From jjfoerch at earthlink.net Sun Sep 14 16:23:09 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Sun, 14 Sep 2008 19:23:09 -0400 Subject: [Conkeror] Bug: User variable default value reported incorrectly References: Message-ID: <87d4j62tya.fsf@earthlink.net> Nick writes: > Reported by: John J. Foerch > Date: September 12, 2008 > Status: Open > > Description: > > The default value of variables defined with define_variable is > remembered for use by the help system; however if the variable is > changed the default value is incorrectly reported. This may only apply > to certain types of variables. > > 1. Change one of the default MIME type external handlers: > define_mime_type_external_handler("application/pdf", "xpdf"); > 2. C-h v mime_type_external_handlers > 3. Notice that the default listed for /^application\/pdf$/ is xpdf > when it should be evince. > > Discussion: > > < retroj`> I shouldn't spend more time on conkeror today :) :( Hey thank you for making sure my apathy is known far and wide. :) I will just follow up with the *real* discussion that did take place about this bug. The problem concerns user variables that are objects (or arrays, etc) instead of scalars. When the object is modified, rather than wholy replaced by a different object, the stored default value still points to the original, modified object. Here are our options: 1) Don't store default values for object user variables. 2) Serialize the default values and store them as strings. I am more in favor of option 1, but then again, I don't see the point in even storing default values for anything in the first place. Votes? -- John Foerch From jjfoerch at earthlink.net Sun Sep 14 16:31:33 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Sun, 14 Sep 2008 19:31:33 -0400 Subject: [Conkeror] Tiddlywiki with Conkeror References: <20080913165107.GA8974@grace.toshine.net> Message-ID: <878wtu2tka.fsf@earthlink.net> 'Mash writes: > Hi, > > I am wanting to use Tiddlywiki with Conkeror but it does not appear to allow me to edit the text fields. > > A bit odd, as I can see [input:TEXT] when selecting a field but I am unable to edit, delete or input any characters. > Though C-x h does highlight but I can't cut or yank. > > The reason for the question is that I currently symlink "/usr/share/conkeror/content/help.html" (default start page) to a local "home.html" file which I edit with frequently used bookmarks and works a treat. I now wanted to try using the tiddlywiki system instead. > > Anyone have any ideas, I am guessing it may be a javascript issue? > > 'Mash Hi Mash, I haven't looked at tiddlywiki yet, but my guess is that this site has some javascript UI code of its own that conflicts with conkeror. With many sites like that, (e.g. gmail), the site js can be disabled. So that is option 1. Option 2 is to write a page-mode for tiddlywiki. There are several good examples of page-modes in the conkeror source, modules/page-modes. I also want to mention that your method of altering your home page is rather strange. Just make a plain html document with your bookmarks, and in your conkeror rc, put the following expression: homepage = "file:/path/to/bookmarks.html"; -- John Foerch From marting at gmx.ch Mon Sep 15 02:32:11 2008 From: marting at gmx.ch (marting at gmx.ch) Date: Mon, 15 Sep 2008 11:32:11 +0200 Subject: [Conkeror] Bug: minibuffer history behaves strangely Message-ID: <87iqsxrbz8.fsf@gmx.ch> I've just reported the following bug on conkeror.org: (A): 1. In conkeror, type in 'M-x conkeror-version' ((almost) any other interactive command will do as well) and hit ENTER. 2. Type in 'M-x' followed by some characters, say 'qwert'. 3. Type in 'M-p' (minibuffer-history-previous) to access the previous command, i.e. 'conkeror-version'. 4. Type in 'M-n' (minibuffer-history-next) and notice that the text in the minibuffer still reads 'conkeror-version', i.e. the input 'qwert' is irretrievably lost. (B): 1. In conkeror, type in 'M-x conkeror-version' ((almost) any other interactive command will do as well) and hit ENTER. 2. Type in 'M-x'. 3. Type in 'M-n' (minibuffer-history-next) and notice that the text in the minibuffer now reads 'conkeror-version'. Notice that both (A) and (B) can be reproduced in a different minibuffer state too, e.g. by typing 'g' instead of 'M-x'. I'm not sure everyone agrees but I think conkeror should behave differently in the two situations above. Namely, after (A).4. I would expect the minibuffer to contain the text 'qwert', while after (B).3. it should still be empty (since 'conkeror-version' is the previous, not the next history entry). That said, I can very well live with (B) but find (A) quite irritating since (in Emacs) I'm accustomed to look something up in the minibuffer history while typing in a command. Additionally I sometimes experience empty entries in the minibuffer history; this has happened at least with the 'reload' as well as with the 'backward-line' command. However, I am at the moment not able to reproduce this behaviour. Has anyone else ever experienced it? -- Martin From marting at gmx.ch Mon Sep 15 05:42:44 2008 From: marting at gmx.ch (marting at gmx.ch) Date: Mon, 15 Sep 2008 14:42:44 +0200 Subject: [Conkeror] Bug: minibuffer history and completion Message-ID: <87ej3lr35n.fsf@gmx.ch> Hi all, I've just reported the following bug on conkeror.org: 1. In conkeror, type 'M-x conkeror-version' ((almost) any other interactive command will do as well) and hit ENTER. 2. Type 'M-x' and then hit TAB (minibuffer-complete) to see possible completions. 3. Type 'M-p' (minibuffer-history-previous) to access the previous command 'conkeror-version'. At this point it seems like the completion tree "has precedence over the minibuffer"; to see what I mean do any of the following: * Hit ENTER and notice the "No match" error. * Hit TAB to see possible completions. Notice that the completion tree hasn't shrunk at all (as if the minibuffer was empty). * Hit ENTER on one of the possible completions and notice that the completion is executed, not 'conkeror-version'. Notice also that the value of 'minibuffer_auto_complete_default' doesn't significantly influence conkeror's behaviour in the above situation. I would expect the completion tree to be automatically recomputed after 3. if 'minibuffer_auto_complete_default' is true. Finally, conkeror's behaviour in other minibuffer states is also contrary to what I would expect but different from the above; e.g. do the analogous steps with 'M-x' replaced by 'g'. -- Martin From nicktastic at gmail.com Mon Sep 15 06:51:49 2008 From: nicktastic at gmail.com (Nicholas A. Zigarovich) Date: Mon, 15 Sep 2008 09:51:49 -0400 Subject: [Conkeror] Bug: User variable default value reported incorrectly In-Reply-To: <87d4j62tya.fsf@earthlink.net> References: <87d4j62tya.fsf@earthlink.net> Message-ID: Apathy nothing. You worked hard on conkeror all day long on Friday and deserved a break (and then you worked some more). You and jbms convinced me; I vote 1. - Nick On Sun, Sep 14, 2008 at 7:23 PM, John J Foerch wrote: > Nick writes: >> Reported by: John J. Foerch >> Date: September 12, 2008 >> Status: Open >> >> Description: >> >> The default value of variables defined with define_variable is >> remembered for use by the help system; however if the variable is >> changed the default value is incorrectly reported. This may only apply >> to certain types of variables. >> >> 1. Change one of the default MIME type external handlers: >> define_mime_type_external_handler("application/pdf", "xpdf"); >> 2. C-h v mime_type_external_handlers >> 3. Notice that the default listed for /^application\/pdf$/ is xpdf >> when it should be evince. >> >> Discussion: >> >> < retroj`> I shouldn't spend more time on conkeror today :) :( > > Hey thank you for making sure my apathy is known far and wide. :) > > I will just follow up with the *real* discussion that did take place > about this bug. > > The problem concerns user variables that are objects (or arrays, etc) > instead of scalars. When the object is modified, rather than wholy > replaced by a different object, the stored default value still points to > the original, modified object. > > Here are our options: > > 1) Don't store default values for object user variables. > > 2) Serialize the default values and store them as strings. > > I am more in favor of option 1, but then again, I don't see the point > in even storing default values for anything in the first place. > > Votes? > > -- > John Foerch > > > _______________________________________________ > Conkeror mailing list > Conkeror at mozdev.org > https://www.mozdev.org/mailman/listinfo/conkeror > From jeremy at jeremyms.com Mon Sep 15 09:17:32 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Mon, 15 Sep 2008 09:17:32 -0700 Subject: [Conkeror] Bug: minibuffer history and completion In-Reply-To: <87ej3lr35n.fsf@gmx.ch> (marting@gmx.ch's message of "Mon, 15 Sep 2008 14:42:44 +0200") References: <87ej3lr35n.fsf@gmx.ch> Message-ID: <87sks1idsz.fsf@jeremyms.com> marting at gmx.ch writes: > Hi all, > I've just reported the following bug on conkeror.org: > 1. In conkeror, type 'M-x conkeror-version' ((almost) any other > interactive command will do as well) and hit ENTER. > 2. Type 'M-x' and then hit TAB (minibuffer-complete) to see possible > completions. > 3. Type 'M-p' (minibuffer-history-previous) to access the previous > command 'conkeror-version'. > At this point it seems like the completion tree "has precedence over > the minibuffer"; to see what I mean do any of the following: > * Hit ENTER and notice the "No match" error. > * Hit TAB to see possible completions. Notice that the completion tree > hasn't shrunk at all (as if the minibuffer was empty). > * Hit ENTER on one of the possible completions and notice that the > completion is executed, not 'conkeror-version'. I agree the behavior in these cases could improve. Would you care to send a patch? (I don't think it would be very difficult to fix.) > Notice also that the value of 'minibuffer_auto_complete_default' > doesn't significantly influence conkeror's behaviour in the above > situation. I would expect the completion tree to be automatically > recomputed after 3. if 'minibuffer_auto_complete_default' is true. The minibuffer_auto_complete_default variable specifies whether to auto-complete only if minibuffer_auto_complete_preferences does not override it for a particular setting of the $auto_complete argument to minibuffer.read. > Finally, conkeror's behaviour in other minibuffer states is also > contrary to what I would expect but different from the above; e.g. do > the analogous steps with 'M-x' replaced by 'g'. -- Jeremy Maitin-Shepard From marting at gmx.ch Mon Sep 15 10:41:14 2008 From: marting at gmx.ch (marting at gmx.ch) Date: Mon, 15 Sep 2008 19:41:14 +0200 Subject: [Conkeror] Bug: minibuffer history and completion In-Reply-To: <87sks1idsz.fsf@jeremyms.com> (Jeremy Maitin-Shepard's message of "Mon\, 15 Sep 2008 09\:17\:32 -0700") References: <87ej3lr35n.fsf@gmx.ch> <87sks1idsz.fsf@jeremyms.com> Message-ID: <87abe9qpc5.fsf@gmx.ch> Jeremy Maitin-Shepard writes: > I agree the behavior in these cases could improve. Would you care to > send a patch? (I don't think it would be very difficult to fix.) The following modification seems to improve the behaviour: diff --git a/modules/minibuffer-read.js b/modules/minibuffer-read.js index 5c9efb1..079558f 100644 --- a/modules/minibuffer-read.js +++ b/modules/minibuffer-read.js @@ -454,6 +454,7 @@ function minibuffer_history_next (window, count) s.history_index = index; m._input_text = s.history[index]; m._set_selection(); + s.handle_input(); } interactive("minibuffer-history-next", null, function (I) {minibuffer_history_next(I.window, I.p);}); interactive("minibuffer-history-previous", null, function (I) {minibuffer_history_next(I.window, -I.p);}); However, it may break something else or not be the right way to approach the problem. I really don't know (and that's the reason why I reported the bug in the first place; I'm not very proficient in these matters). -- Martin From tassilo at member.fsf.org Tue Sep 16 02:36:38 2008 From: tassilo at member.fsf.org (Tassilo Horn) Date: Tue, 16 Sep 2008 11:36:38 +0200 Subject: [Conkeror] Cannot follow link number 13 on a site References: <878wtxqvd4.fsf@thinkpad.tsdh.de> <87iqsy2ud4.fsf@earthlink.net> Message-ID: <87y71s1lg9.fsf@thinkpad.tsdh.de> John J Foerch writes: Hi John, > Link 13 worked for me. To be sure, that was the "Downloads" link in > the side menu bar. Right. > Can you isolate the behavior any further? Yes, I found out that it seems to be a keyboard related issue and there's nothing wrong with the page. I cannot enter 13 with the number row (at any site), but using the numpad it works. Unfortunately, on my notebook there's no numpad, so I need an external keyboard. I did M-x keyboard-setup, cleared the map, pressed all keys first unshifted and then shifted and saved the result in the preferences. But after a restart I still can't follow links with number 13. Is it ok that I pressed "a b c... A B C..." or do I have to press "a A b B..." when doing keyboard-setup? Bye, Tassilo From jeremy at jeremyms.com Tue Sep 16 08:39:18 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Tue, 16 Sep 2008 08:39:18 -0700 Subject: [Conkeror] Cannot follow link number 13 on a site In-Reply-To: <87y71s1lg9.fsf@thinkpad.tsdh.de> (Tassilo Horn's message of "Tue, 16 Sep 2008 11:36:38 +0200") References: <878wtxqvd4.fsf@thinkpad.tsdh.de> <87iqsy2ud4.fsf@earthlink.net> <87y71s1lg9.fsf@thinkpad.tsdh.de> Message-ID: <873ak0hzh5.fsf@jeremyms.com> Tassilo Horn writes: > John J Foerch writes: > Hi John, >> Link 13 worked for me. To be sure, that was the "Downloads" link in >> the side menu bar. > Right. >> Can you isolate the behavior any further? > Yes, I found out that it seems to be a keyboard related issue and > there's nothing wrong with the page. I cannot enter 13 with the number > row (at any site), but using the numpad it works. Unfortunately, on my > notebook there's no numpad, so I need an external keyboard. So Conkeror isn't recognizing your 3 key, except in text input areas? What does C-h k 3 say? > I did M-x keyboard-setup, cleared the map, pressed all keys first > unshifted and then shifted and saved the result in the preferences. But > after a restart I still can't follow links with number 13. > Is it ok that I pressed "a b c... A B C..." or do I have to press "a A b > B..." when doing keyboard-setup? It doesn't make any difference what order you press them in. Hopefully we can get to the bottom of this. -- Jeremy Maitin-Shepard From tassilo at member.fsf.org Tue Sep 16 12:07:24 2008 From: tassilo at member.fsf.org (Tassilo Horn) Date: Tue, 16 Sep 2008 21:07:24 +0200 Subject: [Conkeror] Cannot follow link number 13 on a site References: <878wtxqvd4.fsf@thinkpad.tsdh.de> <87iqsy2ud4.fsf@earthlink.net> <87y71s1lg9.fsf@thinkpad.tsdh.de> <873ak0hzh5.fsf@jeremyms.com> Message-ID: <87iqsvoqoj.fsf@thinkpad.tsdh.de> Jeremy Maitin-Shepard writes: >>> Can you isolate the behavior any further? > >> Yes, I found out that it seems to be a keyboard related issue and >> there's nothing wrong with the page. I cannot enter 13 with the >> number row (at any site), but using the numpad it works. >> Unfortunately, on my notebook there's no numpad, so I need an >> external keyboard. > > So Conkeror isn't recognizing your 3 key, except in text input areas? It works in text input areas and at the M-x prompt, too. > What does C-h k 3 say? Normally it says "# is undefined", and `f C-h k 3' says: ,---- | # is bound to the command [pass through] \ | in bindings/default/content-buffer/text.js. `---- A related issue is that here I zoom with = and reset the zoom level with +. Looking at bindings/default/content-buffer/zoom.js it should be the other way round. But `C-h k =' says: ,---- | = is bound to the command zoom-in-text in \ | bindings/default/content-buffer/zoom.js. | | zoom-in-text is an interactive command in zoom.js. | | It is bound to =, z i. `---- And the same for `C-h k +': ,---- | + is bound to the command zoom-reset-text in \ | bindings/default/content-buffer/zoom.js. | | zoom-reset-text is an interactive command in zoom.js. | | It is bound to +, z z. `---- >> I did M-x keyboard-setup, cleared the map, pressed all keys first >> unshifted and then shifted and saved the result in the preferences. >> But after a restart I still can't follow links with number 13. >> >> Is it ok that I pressed "a b c... A B C..." or do I have to press "a >> A b B..." when doing keyboard-setup? > > It doesn't make any difference what order you press them in. Ok. > Hopefully we can get to the bottom of this. When I start conkeror on a terminal these messages are printed: --8<---------------cut here---------------start------------->8--- watch:accessibility.:browsewithcaret Warning: Error occurred while binding keys: M-< Invalid key specification: M-< This may be due to an incorrect keyboard setup. You may want to use the -keyboard-setup command-line option to fix your keyboard setup. Warning: Error occurred while binding keys: M-< Invalid key specification: M-< This may be due to an incorrect keyboard setup. You may want to use the -keyboard-setup command-line option to fix your keyboard setup. Warning: Error occurred while binding keys: M-< Invalid key specification: M-< This may be due to an incorrect keyboard setup. You may want to use the -keyboard-setup command-line option to fix your keyboard setup. Warning: Error occurred while binding keys: 3 Invalid key specification: 3 This may be due to an incorrect keyboard setup. You may want to use the -keyboard-setup command-line option to fix your keyboard setup. Warning: Error occurred while binding keys: 3 Invalid key specification: 3 This may be due to an incorrect keyboard setup. You may want to use the -keyboard-setup command-line option to fix your keyboard setup. Warning: Error occurred while binding keys: M-< Invalid key specification: M-< This may be due to an incorrect keyboard setup. You may want to use the -keyboard-setup command-line option to fix your keyboard setup. Warning: Error occurred while binding keys: M-< Invalid key specification: M-< This may be due to an incorrect keyboard setup. You may want to use the -keyboard-setup command-line option to fix your keyboard setup. Warning: Error occurred while binding keys: ] Invalid key specification: ] This may be due to an incorrect keyboard setup. You may want to use the -keyboard-setup command-line option to fix your keyboard setup. Warning: Error occurred while binding keys: [ Invalid key specification: [ This may be due to an incorrect keyboard setup. You may want to use the -keyboard-setup command-line option to fix your keyboard setup. --8<---------------cut here---------------end--------------->8--- I use a rather exotic keyboard layout, German Dvorak Type II [1]. For [ and ] I need AltGr. Do I have to press each key with AltGr in keyboard setup? Bye, Tassilo __________ [1] http://rffr.de/dvorak From jeremy at jeremyms.com Tue Sep 16 15:44:03 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Tue, 16 Sep 2008 15:44:03 -0700 Subject: [Conkeror] Cannot follow link number 13 on a site In-Reply-To: <87iqsvoqoj.fsf@thinkpad.tsdh.de> (Tassilo Horn's message of "Tue, 16 Sep 2008 21:07:24 +0200") References: <878wtxqvd4.fsf@thinkpad.tsdh.de> <87iqsy2ud4.fsf@earthlink.net> <87y71s1lg9.fsf@thinkpad.tsdh.de> <873ak0hzh5.fsf@jeremyms.com> <87iqsvoqoj.fsf@thinkpad.tsdh.de> Message-ID: <87y71rhft8.fsf@jeremyms.com> Tassilo Horn writes: [snip] > I use a rather exotic keyboard layout, German Dvorak Type II [1]. For [ > and ] I need AltGr. Do I have to press each key with AltGr in keyboard > setup? You should try doing that, I think. You should make sure that every character that you want to bind appears in the Character column of the table in the keyboard-setup window. -- Jeremy Maitin-Shepard From jeremy at jeremyms.com Wed Sep 17 00:07:23 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Wed, 17 Sep 2008 00:07:23 -0700 Subject: [Conkeror] Cannot follow link number 13 on a site In-Reply-To: <87fxnzfetv.fsf@thinkpad.tsdh.de> (Tassilo Horn's message of "Wed, 17 Sep 2008 08:48:12 +0200") References: <878wtxqvd4.fsf@thinkpad.tsdh.de> <87iqsy2ud4.fsf@earthlink.net> <87y71s1lg9.fsf@thinkpad.tsdh.de> <873ak0hzh5.fsf@jeremyms.com> <87iqsvoqoj.fsf@thinkpad.tsdh.de> <87y71rhft8.fsf@jeremyms.com> <87fxnzfetv.fsf@thinkpad.tsdh.de> Message-ID: <87tzcfgsic.fsf@jeremyms.com> Tassilo Horn writes: > Jeremy Maitin-Shepard writes: > Hi Jeremy, >>> I use a rather exotic keyboard layout, German Dvorak Type II [1]. >>> For [ and ] I need AltGr. Do I have to press each key with AltGr in >>> keyboard setup? >> >> You should try doing that, I think. > Ok. >> You should make sure that every character that you want to bind >> appears in the Character column of the table in the keyboard-setup >> window. > If I press + I get > 61 equals false 43 + > Here I'd expect the keycode name to be 'add'. The numpad + creates this > line: > 107 add false 43 + > So this seems to be the source of my problem that I have to zoom with = > and reset zoom with +. The problem here is rather minor, actually: the zoom bindings refer to the keycode names equals and subtract, rather than the characters +, -, =. The solution to this issue is to change those key bindings to use the characters instead, and I just pushed this change. > And if I press ^ I get > 54 6 false 94 ^ > When I now press 6 this exact line gets overwritten by > 54 6 false 54 6 > So it seems in my case the order in which I press keys does make a > difference. > And the keys ?, ? and ? share one line, too: > 0 false [252,228,246] [?,?,?] > The problem with "link number 13" seems to be that my 3 (from the number > row) and # share one line, too. It's > 51 3 false 51 3 > for the 3, and as soon as I press # the line will be overwritten with > 51 3 false 35 # In order to bypass some other quirks in Mozilla key handling, Conkeror dispatches based only on the keycode value, and the state of modifiers (including shift). I don't think that Mozilla sees the AltGr state. The only real solution is to use character-based key bindings, and deal with the problems that presents (basically Mozilla ignores shift in constructing the character if alt is pressed and control is not pressed), which means that keys need to be bound in an inconsistent manner. For now, you could work around this by typing 3 in the keyboard setup and not typing #. Then # will not work for bindings (but it will still work in text boxes), but 3 will. Likewise if you want 6 to work then ^ will not work in bindings. -- Jeremy Maitin-Shepard From tassilo at member.fsf.org Wed Sep 17 00:19:50 2008 From: tassilo at member.fsf.org (Tassilo Horn) Date: Wed, 17 Sep 2008 09:19:50 +0200 Subject: [Conkeror] Cannot follow link number 13 on a site References: <878wtxqvd4.fsf@thinkpad.tsdh.de> <87iqsy2ud4.fsf@earthlink.net> <87y71s1lg9.fsf@thinkpad.tsdh.de> <873ak0hzh5.fsf@jeremyms.com> <87iqsvoqoj.fsf@thinkpad.tsdh.de> <87y71rhft8.fsf@jeremyms.com> <87fxnzfetv.fsf@thinkpad.tsdh.de> <87tzcfgsic.fsf@jeremyms.com> Message-ID: <87bpynfdd5.fsf@thinkpad.tsdh.de> Jeremy Maitin-Shepard writes: Hi Jeremy, > For now, you could work around this by typing 3 in the keyboard setup > and not typing #. Then # will not work for bindings (but it will > still work in text boxes), but 3 will. Likewise if you want 6 to work > then ^ will not work in bindings. Yes, that's what I'm doing now. Till now it seems that it all works pretty well if I omit ^, #, ?, ? and ? which are not bound by default anyway. I think it would be a great help if keyboard-setup would alert the user if a key overwrites another key. In that case the user should decide which key "survives". Silently discarding the first one is surely not the best solution. Thanks for your help! Tassilo From mashdot at toshine.net Wed Sep 17 11:54:24 2008 From: mashdot at toshine.net ('Mash) Date: Wed, 17 Sep 2008 19:54:24 +0100 Subject: [Conkeror] Password management in Conkeror (revisited) In-Reply-To: <87iqsxrbz8.fsf@gmx.ch> References: <87iqsxrbz8.fsf@gmx.ch> Message-ID: <20080917185424.GA25542@grace.toshine.net> I know this question has been asked a lot but I am yet to actually find an answer; or more so one which I can understand in terms of what to put in .conkerorrc. How does one turn on password management? I have tried both: session_pref("signon.prefillForms", true); session_pref("signon.rememberSignons",true); session_pref("signon.autofillForms",true); and following... http://developer.mozilla.org/En/XULRunner_tips pref("signon.rememberSignons", true); pref("signon.expireMasterPassword", false); pref("signon.SignonFileName", "signons.txt"); You also need to get an instance of the login manager service, which internally initializes the system: Components.classes["@mozilla.org/login-manager;1"].getService(Components.interfaces.nsILoginManager); BUT, since I am completely unknowing I don't quite understand how one uses the "Components.classes[..." and how I "get an instance or the login manager..." Sorry to ask this again but it really is not clear anywhere that I know. Thanks 'Mash From tassilo at member.fsf.org Wed Sep 17 23:40:12 2008 From: tassilo at member.fsf.org (Tassilo Horn) Date: Thu, 18 Sep 2008 08:40:12 +0200 Subject: [Conkeror] Password management in Conkeror (revisited) References: <87iqsxrbz8.fsf@gmx.ch> <20080917185424.GA25542@grace.toshine.net> Message-ID: <87vdwu0xf7.fsf@thinkpad.tsdh.de> 'Mash writes: Hi! > I know this question has been asked a lot but I am yet to actually > find an answer; or more so one which I can understand in terms of what > to put in .conkerorrc. > > How does one turn on password management? The only lines I have in my ~/.conkerorrc for that are // Enable the password manager Components.classes["@mozilla.org/login-manager;1"].getService( Components.interfaces.nsILoginManager); and the password manager works. Bye, Tassilo -- They had to edit the first ending of 'Lone Wolf McQuade' after Chuck Norris kicked David Carradine's ass, then proceeded to barbecue and eat him. From joe_f at verizon.net Thu Sep 18 07:37:17 2008 From: joe_f at verizon.net (Joe Fineman) Date: Thu, 18 Sep 2008 10:37:17 -0400 Subject: [Conkeror] Difficulty viewing videos Message-ID: In the past few days, I have not been able to view movies using Conkeror. If I go (say) to a YouTube page, it downloads normally as shown by the bar, but the display stalls after about 1 second. Using the mouse, I can set the view to any point in the film, and it once again proceeds for 1 s and then stalls. There is no sound, tho the volume is turned up all the way. Display of videos works properly in Firefox. -- --- Joe Fineman joe_f at verizon.net ||: There are no violet stars. :|| From rohan.nicholls at googlemail.com Fri Sep 19 05:53:21 2008 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Fri, 19 Sep 2008 14:53:21 +0200 Subject: [Conkeror] [PATCH] Session management: restore saved buffers from a JSON file. In-Reply-To: References: <1220532959-9121-1-git-send-email-dmhouse@gmail.com> <8763pcymxg.wl%vyazovoi@gmail.com> <87zlml8b9a.wl%vyazovoi@gmail.com> Message-ID: Fabulous, thanks for this. I was just thinking that not having session handling is the one thing that I really miss in conkeror, that and gmail mode not working in gmail (I will look into it some time). I applied the patch, and the M-x restore-session works very well, but there were a few glitches. When you start normally, and do the restore session it asks you if it should store it in a certain spot (mozilla profile directory) under the name of session.json. I said yes, and received the error that the file did not exist. I touched the file, and tried again. It gave the error that it could not read the file. On a hunch, I put {} At the beginning of the file and saved it. Then restore-session worked. Something that might not be related is that conkeror -batch never comes up. So I just do a normal launch and then invoke restore-session and it works. Thanks again, I am so happy to have this. Now to look into address history. :) Rohan On Sat, Sep 6, 2008 at 7:04 PM, David House wrote: > 2008/9/6 Vyazovoi Pavel : >> Strange... >> I tried patches with latest conkeror from git, with empty rc-file. > > So this definitely happens if you use conkeror -q? What happens if you > comment out everything in modules/session.js? Are you sure the patch > applied cleanly, and didn't leave any artefacts in, e.g. > components/application.js? What happens if you use conkeror -q > -jsconsole? > > -- > -David > _______________________________________________ > Conkeror mailing list > Conkeror at mozdev.org > https://www.mozdev.org/mailman/listinfo/conkeror > From rohan.nicholls at googlemail.com Fri Sep 19 09:24:17 2008 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Fri, 19 Sep 2008 18:24:17 +0200 Subject: [Conkeror] [PATCH] Session management: restore saved buffers from a JSON file. In-Reply-To: References: <1220532959-9121-1-git-send-email-dmhouse@gmail.com> <8763pcymxg.wl%vyazovoi@gmail.com> Message-ID: On Fri, Sep 5, 2008 at 10:32 PM, Mark Eichin wrote: >>> 3. You must quit conkeror using C-x C-c, rather than through your window >>> manager, if you want the session to be saved. > > I suggest supporting C-x C-s for "save right now" to work with our > existing save-early-save-often emacs reflexes (and this is what my > xmlhttprequest-based session-saving does too :-) Should be just a > direct binding to session.save()... > _______________________________________________ > Conkeror mailing list > Conkeror at mozdev.org > https://www.mozdev.org/mailman/listinfo/conkeror > Here is a patch that adds that. It does not bind the keys for you, but it does create the command. I shamelessly ripped off the code from the code that was already there, but so far in my tests it works. Btw. this is the first git format-patch I've done so I hope it is correct. Thanks again to David for implementing sessions, I am loving having that functionality. Rohan Signed-off-by: Rohan --- modules/session.js | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/session.js b/modules/session.js index af4bbe1..91a26dd 100644 --- a/modules/session.js +++ b/modules/session.js @@ -29,7 +29,7 @@ session_manager.prototype.get_session = function () { } }); return ar; -} +}; /** * Encode a session to disk @@ -41,6 +41,15 @@ session_manager.prototype.save = function () { add_hook("quit_hook", function () { if (typeof session != "undefined") session.save(); }); +function save_session(sess_file){ + if (!conkeror.session){ + return false; + //conkeror.session = new session_manager(sess_file); + } + conkeror.session.save(); + return true; +} + /** * Restore from the session */ @@ -53,7 +62,7 @@ session_manager.prototype.restore = function () { } make_window(multiple_buffers_creator(creators), tag); } -} +}; /** * The main entry point. Load all the buffers from the session at `sess_file', @@ -79,3 +88,14 @@ interactive( $initial_value = profile_dir + "/session.json"); restore_session(sess_file); }); + +interactive( + "save-session", + "Prompt on the minibuffer for a session file to use for saving." + + "The default path is " + profile_dir + "/session.json", + function (I) { + var sess_file = yield I.minibuffer.read_file_path( + $prompt = "Session file:", + $initial_value = profile_dir + "/session.json"); + save_session(sess_file); + }); -- 1.5.4.3 From patzy at appart.kicks-ass.net Sat Sep 20 02:18:18 2008 From: patzy at appart.kicks-ass.net (Morgan Veyret) Date: Sat, 20 Sep 2008 11:18:18 +0200 Subject: [Conkeror] [PATCH] download manager automatic open behavior Message-ID: <20080920091818.GA3000@quark.appart.kicks-ass.net> Hello, here is a small patch that changes the download manager automatic buffer opening behavior. It adds a new preference: download_buffer_automatic_open_in_own_window which defaults to false. When true, automatic open with target being OPEN_NEW_BUFFER or OPEN_NEW_BUFFER_BACKGROUND, the download buffer are created in a separate download manager window. So the first time a window is created and subsequent download buffers are opened in the existing window. I'm new to js and xul so feel free to comment this and tell me this is crap :). Here it uses a tag for the download manager window thanks to jbms on #conkeror (thanks for his help). Anyway here is the patch. -- Morgan Veyret (patzy at appart.kicks-ass.net) http://appart.kicks-ass.net/patzy -------------- next part -------------- >From 3688491e78a1e222c7d197db313edf61af298a02 Mon Sep 17 00:00:00 2001 From: Morgan Veyret Date: Sat, 20 Sep 2008 11:12:18 +0200 Subject: [PATCH] Added new download manager window automatic open behavior. When target is set to OPEN_NEW_BUFFER or OPEN_NEW_BUFFER_BACKGROUND the preference variable download_buffer_automatic_open_in_own_window control wether an existing download manager window should be used instead of the current window. --- modules/download-manager.js | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/modules/download-manager.js b/modules/download-manager.js index cdd9ee9..318c26d 100644 --- a/modules/download-manager.js +++ b/modules/download-manager.js @@ -1011,14 +1011,31 @@ define_variable("download_buffer_automatic_open_target", OPEN_NEW_WINDOW, "This variable takes effect only if `open_download_buffer_auotmatically' is in " + "`download_added_hook', as it is by default."); +define_variable("download_buffer_automatic_open_in_own_window", false, + "Target for download buffers created by the `open_download_buffer_automatically' function.\n" + + "This variable takes effect only if `open_download_buffer_auotmatically' is in " + + "`download_added_hook', as it is by default."); + + function open_download_buffer_automatically(info) { var buf = info.source_buffer; var target = download_buffer_automatic_open_target; + var own_window = download_buffer_automatic_open_in_own_window; if (buf == null) - target = OPEN_NEW_WINDOW; + target = OPEN_NEW_WINDOW; if (info.temporary_status == DOWNLOAD_NOT_TEMPORARY || !(download_temporary_file_open_buffer_delay > 0)) - create_buffer(buf, buffer_creator(download_buffer, $info = info), target); + if ( (target == OPEN_NEW_BUFFER || target == OPEN_NEW_BUFFER_BACKGROUND ) + && (own_window == true)) { + var window = get_window_by_tag("download-manager"); + if ( window == null ) { + window = make_window(buffer_creator(download_buffer, $info = info),"download-manager"); + } + create_buffer(window, buffer_creator(download_buffer, $info = info), target); + } + else { + create_buffer(buf, buffer_creator(download_buffer, $info = info), target); + } else { var timer = null; function finish() { -- 1.5.5.1 From patzy at appart.kicks-ass.net Sat Sep 20 02:28:01 2008 From: patzy at appart.kicks-ass.net (Morgan Veyret) Date: Sat, 20 Sep 2008 11:28:01 +0200 Subject: [Conkeror] [PATCH] download manager automatic open behavior In-Reply-To: <20080920091818.GA3000@quark.appart.kicks-ass.net> References: <20080920091818.GA3000@quark.appart.kicks-ass.net> Message-ID: <20080920092801.GB3000@quark.appart.kicks-ass.net> And this additional patch fixes the invalid docstring. On 11:18 Sat 20 Sep , Morgan Veyret wrote: > Hello, > > here is a small patch that changes the download manager automatic buffer > opening behavior. > > It adds a new preference: > > download_buffer_automatic_open_in_own_window > > which defaults to false. > > When true, automatic open with target being OPEN_NEW_BUFFER or > OPEN_NEW_BUFFER_BACKGROUND, the download buffer are created in a > separate download manager window. So the first time a window is created > and subsequent download buffers are opened in the existing window. > > I'm new to js and xul so feel free to comment this and tell me this is > crap :). > > Here it uses a tag for the download manager window thanks to jbms on #conkeror > (thanks for his help). > > Anyway here is the patch. > -- > > Morgan Veyret (patzy at appart.kicks-ass.net) > http://appart.kicks-ass.net/patzy > >From 3688491e78a1e222c7d197db313edf61af298a02 Mon Sep 17 00:00:00 2001 > From: Morgan Veyret > Date: Sat, 20 Sep 2008 11:12:18 +0200 > Subject: [PATCH] Added new download manager window automatic open behavior. > > When target is set to OPEN_NEW_BUFFER or OPEN_NEW_BUFFER_BACKGROUND > the preference variable download_buffer_automatic_open_in_own_window control wether > an existing download manager window should be used instead of the current window. > --- > modules/download-manager.js | 21 +++++++++++++++++++-- > 1 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a/modules/download-manager.js b/modules/download-manager.js > index cdd9ee9..318c26d 100644 > --- a/modules/download-manager.js > +++ b/modules/download-manager.js > @@ -1011,14 +1011,31 @@ define_variable("download_buffer_automatic_open_target", OPEN_NEW_WINDOW, > "This variable takes effect only if `open_download_buffer_auotmatically' is in " + > "`download_added_hook', as it is by default."); > > +define_variable("download_buffer_automatic_open_in_own_window", false, > + "Target for download buffers created by the `open_download_buffer_automatically' function.\n" + > + "This variable takes effect only if `open_download_buffer_auotmatically' is in " + > + "`download_added_hook', as it is by default."); > + > + > function open_download_buffer_automatically(info) { > var buf = info.source_buffer; > var target = download_buffer_automatic_open_target; > + var own_window = download_buffer_automatic_open_in_own_window; > if (buf == null) > - target = OPEN_NEW_WINDOW; > + target = OPEN_NEW_WINDOW; > if (info.temporary_status == DOWNLOAD_NOT_TEMPORARY || > !(download_temporary_file_open_buffer_delay > 0)) > - create_buffer(buf, buffer_creator(download_buffer, $info = info), target); > + if ( (target == OPEN_NEW_BUFFER || target == OPEN_NEW_BUFFER_BACKGROUND ) > + && (own_window == true)) { > + var window = get_window_by_tag("download-manager"); > + if ( window == null ) { > + window = make_window(buffer_creator(download_buffer, $info = info),"download-manager"); > + } > + create_buffer(window, buffer_creator(download_buffer, $info = info), target); > + } > + else { > + create_buffer(buf, buffer_creator(download_buffer, $info = info), target); > + } > else { > var timer = null; > function finish() { > -- > 1.5.5.1 > > _______________________________________________ > Conkeror mailing list > Conkeror at mozdev.org > https://www.mozdev.org/mailman/listinfo/conkeror -- Morgan Veyret (patzy at appart.kicks-ass.net) http://appart.kicks-ass.net/patzy -------------- next part -------------- >From 3fa4efb60af3ac96c9ffae2e3bca9fec7e9a411b Mon Sep 17 00:00:00 2001 From: Morgan Veyret Date: Sat, 20 Sep 2008 11:27:08 +0200 Subject: [PATCH] Fixed docstring for download_buffer_automatic_open_in_own_window variable. --- modules/download-manager.js | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/download-manager.js b/modules/download-manager.js index 318c26d..6c8b157 100644 --- a/modules/download-manager.js +++ b/modules/download-manager.js @@ -1012,9 +1012,8 @@ define_variable("download_buffer_automatic_open_target", OPEN_NEW_WINDOW, "`download_added_hook', as it is by default."); define_variable("download_buffer_automatic_open_in_own_window", false, - "Target for download buffers created by the `open_download_buffer_automatically' function.\n" + - "This variable takes effect only if `open_download_buffer_auotmatically' is in " + - "`download_added_hook', as it is by default."); + "If true OPEN_NEW_BUFFER and OPEN_NEW_BUFFER_BACKGROUND targets for download buffers are "+ + "created in a single separate window.\n Defaults to false.\n") function open_download_buffer_automatically(info) { -- 1.5.5.1 From lchangying at gmail.com Sat Sep 20 09:32:08 2008 From: lchangying at gmail.com (Changying Li) Date: Sun, 21 Sep 2008 00:32:08 +0800 Subject: [Conkeror] my conkeror doesn't work Message-ID: <87ljxmpylz.fsf@gmail.com> hi. my conkeror doesnt work because it seems use proxy that maybe I setted before. now I have removed my ~/.mozilla , and checked my exported variables. I didn't find anything about proxy. but from tcpdump I can see conkeror want to connect '192.168.1.2:8080', which is a proxy I set before. how to find what mislead conkeror? I'm using archlinux, and firefox is ok to me. the attachment is my tcpdump result. -------------- next part -------------- A non-text attachment was scrubbed... Name: a.out Type: application/octet-stream Size: 300 bytes Desc: not available URL: -------------- next part -------------- -- Thanks & Regards Changying Li From bleader at ratonland.org Sat Sep 20 11:44:56 2008 From: bleader at ratonland.org (bleader) Date: Sat, 20 Sep 2008 19:44:56 +0100 Subject: [Conkeror] my conkeror doesn't work In-Reply-To: <87ljxmpylz.fsf@gmail.com> References: <87ljxmpylz.fsf@gmail.com> Message-ID: <20080920184456.GA20950@ratonland.org> Hi, Conkeror is using ~/.conkeror.mozdev.org if I'm not mistaken, so removing ~/.mozilla may not fix it. Also instead of removing your ~/.mozilla, you should try to open about:config and filter on proxy, I personnally have a proxy that I disable by switching proxy.type from 1 to 0, and the other way around to enable it. Hope that may help you. On Sun, Sep 21, 2008 at 12:32:08AM +0800, Changying Li wrote: > hi. my conkeror doesnt work because it seems use proxy that maybe I > setted before. now I have removed my ~/.mozilla , and checked my > exported variables. I didn't find anything about proxy. but from tcpdump > I can see conkeror want to connect '192.168.1.2:8080', which is a proxy > I set before. > > how to find what mislead conkeror? I'm using archlinux, and firefox is > ok to me. > > the attachment is my tcpdump result. > > > -- > > Thanks & Regards > > Changying Li > _______________________________________________ > Conkeror mailing list > Conkeror at mozdev.org > https://www.mozdev.org/mailman/listinfo/conkeror From schulte.eric at gmail.com Sat Sep 20 11:51:51 2008 From: schulte.eric at gmail.com (Eric Schulte) Date: Sat, 20 Sep 2008 11:51:51 -0700 Subject: [Conkeror] bookmarks and webjumps -- is there a better way? Message-ID: <87ljxmfy60.fsf@gmail.com> Hi, Since there is no way that I know of to save a bookmark in conkeror and access it (either through a directory hierarchy like firefox bookmark management, or through a single keyword), I have found myself defining many many webjumps to fill in for the missing bookmarks. Is there a better way for me to use something like bookmarks in conkeror? Am I missing something obvious? This is really the only place where I miss firefox, but since conkeror has spoiled me with keyboard navigation there is no going back (picture me using firefox hitting C-n 5 times to scroll down a page, and covering my desktop with new firefox windows...). Thanks -- Eric From jjfoerch at earthlink.net Sat Sep 20 16:31:45 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Sat, 20 Sep 2008 19:31:45 -0400 Subject: [Conkeror] [PATCH] download manager automatic open behavior References: <20080920091818.GA3000@quark.appart.kicks-ass.net> <20080920092801.GB3000@quark.appart.kicks-ass.net> Message-ID: <87bpyibdi6.fsf@earthlink.net> Morgan Veyret writes: > And this additional patch fixes the invalid docstring. > > On 11:18 Sat 20 Sep , Morgan Veyret wrote: >> Hello, >> >> here is a small patch that changes the download manager automatic buffer >> opening behavior. >> >> It adds a new preference: >> >> download_buffer_automatic_open_in_own_window >> >> which defaults to false. >> >> When true, automatic open with target being OPEN_NEW_BUFFER or >> OPEN_NEW_BUFFER_BACKGROUND, the download buffer are created in a >> separate download manager window. So the first time a window is created >> and subsequent download buffers are opened in the existing window. >> >> I'm new to js and xul so feel free to comment this and tell me this is >> crap :). >> >> Here it uses a tag for the download manager window thanks to jbms on #conkeror >> (thanks for his help). >> >> Anyway here is the patch. Hi Morgan, Thank you for this. This is definitely a welcome feature! I would prefer a slightly different implementation, though, as described below. Rather than adding a new user variable, the handling of the existing variable `download_buffer_automatic_open_target' could be changed to accept as a value not only the constants like OPEN_NEW_WINDOW, but also string tag names. To duplicate the behavior added by the patch you sent, the user would put this in the rc: download_buffer_automatic_open_target = "download-manager"; The one pitfall to watch out for is that the constants like OPEN_NEW_WINDOW are numbers, so: ("3" == OPEN_NEW_WINDOW) => true but ("3" === OPEN_NEW_WINDOW) => false Thoughts? Will you make this change? -- John Foerch From lchangying at gmail.com Sat Sep 20 18:29:32 2008 From: lchangying at gmail.com (Changying Li) Date: Sun, 21 Sep 2008 09:29:32 +0800 Subject: [Conkeror] my conkeror doesn't work References: <87ljxmpylz.fsf@gmail.com> <20080920184456.GA20950@ratonland.org> Message-ID: <87skru8ewz.fsf@gmail.com> btw, I'm using firefox plugin FoxyProxy... maybe it is caused by that ? bleader writes: > Hi, > > Conkeror is using ~/.conkeror.mozdev.org if I'm not mistaken, so > removing ~/.mozilla may not fix it. Also instead of removing your > ~/.mozilla, you should try to open about:config and filter on proxy, I > personnally have a proxy that I disable by switching proxy.type from 1 > to 0, and the other way around to enable it. > > Hope that may help you. > > On Sun, Sep 21, 2008 at 12:32:08AM +0800, Changying Li wrote: >> hi. my conkeror doesnt work because it seems use proxy that maybe I >> setted before. now I have removed my ~/.mozilla , and checked my >> exported variables. I didn't find anything about proxy. but from tcpdump >> I can see conkeror want to connect '192.168.1.2:8080', which is a proxy >> I set before. >> >> how to find what mislead conkeror? I'm using archlinux, and firefox is >> ok to me. >> >> the attachment is my tcpdump result. >> > > >> >> -- >> >> Thanks & Regards >> >> Changying Li > >> _______________________________________________ >> Conkeror mailing list >> Conkeror at mozdev.org >> https://www.mozdev.org/mailman/listinfo/conkeror -- Thanks & Regards Changying Li From lchangying at gmail.com Sat Sep 20 18:26:54 2008 From: lchangying at gmail.com (Changying Li) Date: Sun, 21 Sep 2008 09:26:54 +0800 Subject: [Conkeror] my conkeror doesn't work References: <87ljxmpylz.fsf@gmail.com> <20080920184456.GA20950@ratonland.org> Message-ID: <87wsh68f1d.fsf@gmail.com> thanks!!. I switched proxy.type from 5 to 0, and now it is ok. but I don't know why the proxy.type is 5 ? what's the meaning of it? I has deleted .conkeror* so it is not set by some configure files. where does it come from ? bleader writes: > Hi, > > Conkeror is using ~/.conkeror.mozdev.org if I'm not mistaken, so > removing ~/.mozilla may not fix it. Also instead of removing your > ~/.mozilla, you should try to open about:config and filter on proxy, I > personnally have a proxy that I disable by switching proxy.type from 1 > to 0, and the other way around to enable it. > > Hope that may help you. > > On Sun, Sep 21, 2008 at 12:32:08AM +0800, Changying Li wrote: >> hi. my conkeror doesnt work because it seems use proxy that maybe I >> setted before. now I have removed my ~/.mozilla , and checked my >> exported variables. I didn't find anything about proxy. but from tcpdump >> I can see conkeror want to connect '192.168.1.2:8080', which is a proxy >> I set before. >> >> how to find what mislead conkeror? I'm using archlinux, and firefox is >> ok to me. >> >> the attachment is my tcpdump result. >> > > >> >> -- >> >> Thanks & Regards >> >> Changying Li > >> _______________________________________________ >> Conkeror mailing list >> Conkeror at mozdev.org >> https://www.mozdev.org/mailman/listinfo/conkeror -- Thanks & Regards Changying Li From jjfoerch at earthlink.net Sat Sep 20 21:24:14 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Sun, 21 Sep 2008 00:24:14 -0400 Subject: [Conkeror] completing on bookmarks user-titles Message-ID: <873ajudt3l.fsf@earthlink.net> Hello, I just pushed a partial fix to the long-standing problem of not being able to use user-set bookmark titles in the read-url completion. There is however a small catch. You can only complete on either history or bookmarks, but not both at the same time. Therefore, put into your rc one of the following: url_completion_use_bookmarks = false; url_completion_use_history = true; *or* url_completion_use_bookmarks = true; url_completion_use_history = false; We hope that this limitation will be short-lived, because the Mozilla source includes a note about the need for a particular flag called QUERY_TYPE_UNIFIED to be implemented. This is the flag that conkeror depends upon in order to do completion on history and bookmarks at the same time. Here is a toggle command and binding you can put in your rc: function url_completion_toggle (I) { if (url_completion_use_bookmarks) { url_completion_use_bookmarks = false; url_completion_use_history = true; } else { url_completion_use_bookmarks = true; url_completion_use_history = false; } } interactive("url-completion-toggle", "toggle between bookmark and history completion", url_completion_toggle); define_key(content_buffer_normal_keymap, "C-c t", "url-completion-toggle"); -- John Foerch From jjfoerch at earthlink.net Sun Sep 21 07:52:41 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Sun, 21 Sep 2008 10:52:41 -0400 Subject: [Conkeror] [PATCH] download manager automatic open behavior References: <20080920091818.GA3000@quark.appart.kicks-ass.net> <20080920092801.GB3000@quark.appart.kicks-ass.net> <87bpyibdi6.fsf@earthlink.net> Message-ID: <87wsh5d006.fsf@earthlink.net> John J Foerch writes: > > Rather than adding a new user variable, the handling of the existing > variable `download_buffer_automatic_open_target' could be changed to > accept as a value not only the constants like OPEN_NEW_WINDOW, but also > string tag names. To duplicate the behavior added by the patch you > sent, the user would put this in the rc: Scrap that. Better yet, this functionality could be done at a lower level in the targets system itself. Then, theoretically, anythings that creates buffers could take advantage of tag targets. Currently the target constants are ints, but there is to my knowledge no reason why we could not expand the system to alllow targets to be objects, or functions, or even interactives. -- John Foerch From juhpetersen at gmail.com Sun Sep 21 10:00:07 2008 From: juhpetersen at gmail.com (Jens Petersen) Date: Mon, 22 Sep 2008 03:00:07 +1000 Subject: [Conkeror] [draft] modeline display of previous/next session history size Message-ID: <9436bffe0809211000n39f9821dt17a1e036e363517d@mail.gmail.com> Hi, Here is a initial draft patch that just makes conkeror should the number of previous and next pages in the session history of the current buffer. I would really like to implement a function to display the history as a completion popup, but at least this gives some indication of the session. Also making the modeline display configurable would be nice. Thanks for conkeror, Jens -------------- next part -------------- A non-text attachment was scrubbed... Name: 001-modeline-session-display.patch Type: application/octet-stream Size: 2086 bytes Desc: not available URL: From dybber at dybber.dk Mon Sep 22 13:31:45 2008 From: dybber at dybber.dk (Martin Dybdal) Date: Mon, 22 Sep 2008 22:31:45 +0200 Subject: [Conkeror] GMail mode and labels suggestions Message-ID: <6ae416730809221331u62757faek235dcb547ce5cb17@mail.gmail.com> Hi Attached is a patch that improves the gmail-go-label function, with completion support. Currently it can't just grab the label-names from the site. Although it should be possible. To use it you will need to set a variable (gmail_labels_list) in your .conkerorrc Example: var gmail_labels_list = ["Conkeror"]; If anyone wants to try creating the mechanism for grabbing the labels automaticly, this could probably be useful: http://code.google.com/p/gmail-greasemonkey/wiki/GmailGreasemonkey10API But it only provides a method that gives you the DOM node of the labels navigation box. -- Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Added-simple-suggestion-support-to-gmail-label-go.patch Type: text/x-diff Size: 1932 bytes Desc: not available URL: From David.Kettler at dsto.defence.gov.au Mon Sep 22 18:21:24 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 23 Sep 2008 10:51:24 +0930 Subject: [Conkeror] [PATCH] Support *either* bookmark user titles *or* combined completion Message-ID: Commit bd0d4c9b80 (Support *either* history *or* bookmarks in read_url completions) added support for completion on bookmark user titles, but disallows completion on both bookmarks and history. With this commit the user can choose which kind of brokenness they prefer by setting use_broken_bookmark_completion. It is expected that this variable will be ignored and deprecated once QUERY_TYPE_UNIFIED works. --- Thank you very much for conkeror; it has made web browsing much less irritating for me. regards, David modules/history.js | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/history.js b/modules/history.js index 639f536..f10377b 100644 --- a/modules/history.js +++ b/modules/history.js @@ -9,6 +9,13 @@ const nav_history_service = Cc["@mozilla.org/browser/nav-history-service;1"] .getService(Ci.nsINavHistoryService); +define_variable("use_broken_bookmark_completion", true, + "If this is set to true, you can complete against bookmark " + + "user titles. However if both history and bookmark " + + "completion are selected, neither will work. If this is " + + "set to false the you may complete against both history " + + "and bookmarks, but not bookmark user titles."); + define_keywords("$use_webjumps", "$use_history", "$use_bookmarks"); function history_completer() { keywords(arguments); @@ -23,12 +30,14 @@ function history_completer() { query.onlyBookmarked = true; var options = nav_history_service.getNewQueryOptions(); options.sortingMode = options.SORT_BY_VISITCOUNT_DESCENDING; - if (use_bookmarks && !use_history) - options.queryType = options.QUERY_TYPE_BOOKMARKS; - else if (use_history && !use_bookmarks) - options.queryType = options.QUERY_TYPE_HISTORY; - else - options.queryType = options.QUERY_TYPE_UNIFIED; //WTF: not implemented yet? + if (use_broken_bookmark_completion) { + if (use_bookmarks && !use_history) + options.queryType = options.QUERY_TYPE_BOOKMARKS; + else if (use_history && !use_bookmarks) + options.queryType = options.QUERY_TYPE_HISTORY; + else + options.queryType = options.QUERY_TYPE_UNIFIED; //WTF: not implemented yet? + } var root = nav_history_service.executeQuery(query, options).root; root.containerOpen = true; var history_count = root.childCount; @@ -37,7 +46,7 @@ function history_completer() { get_description: function (i) root.getChild(i).title, get_input_state: function (i) [root.getChild(i).uri], destroy: function () { root.containerOpen = false; } - }; + }; } } -- 1.6.0.2.296.gfe33b.dirty -- IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From David.Kettler at dsto.defence.gov.au Mon Sep 22 20:42:41 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 23 Sep 2008 13:12:41 +0930 Subject: [Conkeror] changing URL completion choices Message-ID: Below is some code that defines keystrokes to (somewhat) conveniently choose which of webjumps, bookmarks and history will be completed in the URL prompt. It's okay, but only affects future prompts; if you use the keystrokes while in the minibuffer, the current completions are not affected. I don't know how to achieve that and I'm interested in suggestions. This seems to be related to the issue discussed at http://bugs.conkeror.org/conkeror/issue23. regards, David. /* Very clunky completion changer */ function set_completion_all(val) { url_completion_use_webjumps = val; url_completion_use_bookmarks = val; url_completion_use_history = val; } function set_completion(type) { set_completion_all(false); switch (type) { case "w" : url_completion_use_webjumps = true; break; case "b": url_completion_use_bookmarks = true; break; case "h": url_completion_use_history = true; break; case "a": set_completion_all(true); break; case "d": url_completion_use_webjumps = true; url_completion_use_bookmarks = true; url_completion_use_history = false; break; } } function show_completion(minibuffer) { var ids = ["Completion:"]; url_completion_use_webjumps && ids.push("webjumps"); url_completion_use_bookmarks && ids.push("bookmarks"); url_completion_use_history && ids.push("history"); minibuffer.show(ids.join(" ")); } /* Set completion type according to the last keystroke in the key sequence. */ interactive("set-completion", null, function (I) { set_completion(I.key_sequence.pop()); show_completion(I.minibuffer); }); define_keymap("set_completion_keymap"); define_key(default_base_keymap, "C-l", set_completion_keymap); define_key(set_completion_keymap, "w", "set-completion"); define_key(set_completion_keymap, "b", "set-completion"); define_key(set_completion_keymap, "h", "set-completion"); define_key(set_completion_keymap, "a", "set-completion"); define_key(set_completion_keymap, "d", "set-completion"); -- IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From jjfoerch at earthlink.net Wed Sep 24 16:50:27 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Wed, 24 Sep 2008 19:50:27 -0400 Subject: [Conkeror] [PATCH] Support *either* bookmark user titles *or* combined completion References: Message-ID: <87iqsldry4.fsf@earthlink.net> David Kettler writes: > Commit bd0d4c9b80 (Support *either* history *or* bookmarks in read_url > completions) added support for completion on bookmark user titles, but > disallows completion on both bookmarks and history. > > With this commit the user can choose which kind of brokenness they > prefer by setting use_broken_bookmark_completion. It is expected that > this variable will be ignored and deprecated once QUERY_TYPE_UNIFIED > works. Hi David, Can you explain what feature you would like Conkeror to have, in positive terms independent of the bug in the completion code? I think that adding a user variable to optionally regress to a known bug is the wrong way to go about solving this problem. Naming a feature "broken bookmark completion" doesn't really say what that feature is. Also the default query type is QUERY_TYPE_HISTORY, so perhaps conkeror can already do what you want it to do, as follows: url_completion_use_history = true; url_completion_use_bookmarks = false; -- John Foerch From jjfoerch at earthlink.net Wed Sep 24 18:42:11 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Wed, 24 Sep 2008 21:42:11 -0400 Subject: [Conkeror] [PATCH] download manager automatic open behavior References: <20080920091818.GA3000@quark.appart.kicks-ass.net> <20080920092801.GB3000@quark.appart.kicks-ass.net> <87bpyibdi6.fsf@earthlink.net> <87wsh5d006.fsf@earthlink.net> Message-ID: <87d4itdmrw.fsf@earthlink.net> John J Foerch writes: > Better yet, this functionality could be done at a lower level in the > targets system itself. Then, theoretically, anythings that creates > buffers could take advantage of tag targets. Posted an issue in the new bug tracker about this. There was also some discussion in the irc channel on this subject, so I have more notes to add later. http://bugs.conkeror.org/issue38 -- John Foerch From jjfoerch at earthlink.net Wed Sep 24 18:48:49 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Wed, 24 Sep 2008 21:48:49 -0400 Subject: [Conkeror] [PATCH] download manager automatic open behavior References: <20080920091818.GA3000@quark.appart.kicks-ass.net> <20080920092801.GB3000@quark.appart.kicks-ass.net> <87bpyibdi6.fsf@earthlink.net> <87wsh5d006.fsf@earthlink.net> <87d4itdmrw.fsf@earthlink.net> Message-ID: <878wthdmgu.fsf@earthlink.net> John J Foerch writes: > http://bugs.conkeror.org/issue38 Wrong link, sorry. The correct link is: http://bugs.conkeror.org/issue48 -- John Foerch From David.Kettler at dsto.defence.gov.au Wed Sep 24 20:43:12 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 25 Sep 2008 13:13:12 +0930 Subject: [Conkeror] [PATCH] Support *either* bookmark user titles *or* combined completion In-Reply-To: <87iqsldry4.fsf@earthlink.net> References: <87iqsldry4.fsf@earthlink.net> Message-ID: G'day John, I misunderstood how completion was previously working. The patch I provided was useless. I'll need to wait for QUERY_TYPE_UNIFIED to get what I want. Thanks for prompting me to an understanding. > I think > that adding a user variable to optionally regress to a known bug is the > wrong way to go about solving this problem. Naming a feature "broken > bookmark completion" doesn't really say what that feature is. Yes. It was intended as a temporary kludge, but was based on a false premise. I apologise if you found the name to be denigrating; it was only intended to indicate that the variable was a kludge. > Also the default query type is QUERY_TYPE_HISTORY, so perhaps > conkeror can already do what you want it to do, as follows: > > url_completion_use_history = true; > url_completion_use_bookmarks = false; Until now I have had all three of webjump, bookmark and history completion enabled. I thought that was working, but I now find that it was not searching bookmarks. It so happened that (as I've only been using conkeror a short time) all my bookmarked sites were also in the history, so I never noticed that. So I will use your suggestion for now. Once QUERY_TYPE_UNIFIED works I'll re-enable all three. Thanks again, David. IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From David.Kettler at dsto.defence.gov.au Wed Sep 24 20:55:51 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 25 Sep 2008 13:25:51 +0930 Subject: [Conkeror] [PATCH] Provide the buffer number and number of buffers in the modeline. Message-ID: This provides a count like [2/5] in the mode-line. It's probably not useful when using the tab bar; that provides more visual feedback. Enable using the following in your rc: add_hook("mode_line_hook", mode_line_adder(buffer_count_widget), true); --- I don't use anything like this in emacs. I think in a web browser I tend to have a lot more temporary buffers and this helps me keep track of what I still need to look at. modules/mode-line.js | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/modules/mode-line.js b/modules/mode-line.js index 1917159..e2614e1 100644 --- a/modules/mode-line.js +++ b/modules/mode-line.js @@ -193,6 +193,19 @@ clock_widget.prototype.destroy = function () { this.window.clearTimeout(this.timer_ID); }; +function buffer_count_widget(window) { + this.name = "buffer-count-widget"; + text_widget.call(this, window); + this.add_hook("select_buffer_hook"); + this.add_hook("create_buffer_hook"); + this.add_hook("kill_buffer_hook"); +} +buffer_count_widget.prototype.__proto__ = text_widget.prototype; +buffer_count_widget.prototype.update = function () { + this.view.text = ("[" + (this.window.buffers.selected_index+1) + "/" + + this.window.buffers.count + "]"); +}; + function mode_line_adder(widget_constructor) { return function (window) { window.mode_line.add_text_widget(new widget_constructor(window)); } } -- 1.6.0.2.304.gc76d.dirty -- IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From David.Kettler at dsto.defence.gov.au Wed Sep 24 21:08:08 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 25 Sep 2008 13:38:08 +0930 Subject: [Conkeror] Add a pattern to adblockplus based on a target Message-ID: I intend, if desired, to submit the following code as a patch, but I was hoping for some advice on some points first. The "todo" comments mark those points. The main point is that it seems that prefix commands do not get applied to functions called via M-x. I had not intended to bind this command to a key (I don't need it often), but it's better if prefix commands work with it. regards, David --8<-- snip, snip /* Add a pattern to adblockplus based on a target. Allows you to select a target and then edit it. Defaults to images, as they are most frequently what I want to block. */ default_browser_object_classes.adblock = "images"; interactive("adblockplus-add", "Add a pattern to Adblock Plus.", function (I) { var element = yield I.read_browser_object("adblock", "Adblock"); var spec = element_get_load_spec(element); if (spec == null) throw interactive_error("Element has no associated URI"); var pattern = yield I.minibuffer.read_url( $prompt = "Adblock:", $initial_value = load_spec_uri_string(spec), $history = "url"); // todo: should it be a separate history? // todo: maybe adblockplus_service.normalizeFilter() adblockplus_service.addPatterns([pattern]); I.buffer.web_navigation.reload(Ci.nsIWebNavigation.LOAD_FLAGS_NONE); }); // todo: prefix commands only work with keystrokes, not M-x define_key(content_buffer_normal_keymap, "C-c a", "adblockplus-add", $category = "Browser object"); -- IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From rohan.nicholls at googlemail.com Thu Sep 25 02:43:49 2008 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Thu, 25 Sep 2008 11:43:49 +0200 Subject: [Conkeror] conkeror not starting Message-ID: Hi everyone, I am using the git version of conkeror, and have just updated it. On hardy heron (ubuntu) the xulrunner-1.9.0.2 is installed. If I use the new method (run-conkeror) script or the old method of copying over xulrunner-stub the result is the same. call conkeror, and it gives no errors but exits immediately. I removed my .conkeror.mozilla... directory, and it just gave this output and then exited: Registering '@mozilla.org/module-loader/python;1' (libpyloader.so) Registering '@mozilla.org/network/protocol/about;1?what=python' (pyabout.py) Registering '@mozilla.org/module-loader/python;1' (libpyloader.so) Registering '@mozilla.org/network/protocol/about;1?what=python' (pyabout.py) I have moved my conkerorrc directory so it is not being loaded. And now I am out of ideas. Running the conkeror --debug yields no information except to say everything is running smoothly, and then exitting. Am I the only one with this problem? Thanks, Rohan P.S. I am starting to suffer from withdrawal symptoms..... :( From jjfoerch at earthlink.net Thu Sep 25 07:22:07 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Thu, 25 Sep 2008 10:22:07 -0400 Subject: [Conkeror] [PATCH] Support *either* bookmark user titles *or* combined completion References: <87iqsldry4.fsf@earthlink.net> Message-ID: <874p44e25s.fsf@earthlink.net> David Kettler writes: > I apologise if you found the name to be denigrating; not at all.. -- John Foerch From jjfoerch at earthlink.net Thu Sep 25 07:23:49 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Thu, 25 Sep 2008 10:23:49 -0400 Subject: [Conkeror] changing URL completion choices References: Message-ID: <87zllwcnii.fsf@earthlink.net> David Kettler writes: > Below is some code that defines keystrokes to (somewhat) > conveniently choose which of webjumps, bookmarks and history will be > completed in the URL prompt. It's okay, but only affects future > prompts; if you use the keystrokes while in the minibuffer, the > current completions are not affected. I don't know how to achieve > that and I'm interested in suggestions. This seems to be related to > the issue discussed at http://bugs.conkeror.org/conkeror/issue23. > > regards, David. > > > /* Very clunky completion changer */ > > function set_completion_all(val) { > url_completion_use_webjumps = val; > url_completion_use_bookmarks = val; > url_completion_use_history = val; > } > > function set_completion(type) { > set_completion_all(false); > switch (type) { > case "w" : > url_completion_use_webjumps = true; > break; > case "b": > url_completion_use_bookmarks = true; > break; > case "h": > url_completion_use_history = true; > break; > case "a": > set_completion_all(true); > break; > case "d": > url_completion_use_webjumps = true; > url_completion_use_bookmarks = true; > url_completion_use_history = false; > break; > } > } > > function show_completion(minibuffer) { > var ids = ["Completion:"]; > url_completion_use_webjumps && ids.push("webjumps"); > url_completion_use_bookmarks && ids.push("bookmarks"); > url_completion_use_history && ids.push("history"); > minibuffer.show(ids.join(" ")); > } > > /* Set completion type according to the last keystroke in the key sequence. */ > interactive("set-completion", null, function (I) { > set_completion(I.key_sequence.pop()); > show_completion(I.minibuffer); > }); > > define_keymap("set_completion_keymap"); > define_key(default_base_keymap, "C-l", set_completion_keymap); > define_key(set_completion_keymap, "w", "set-completion"); > define_key(set_completion_keymap, "b", "set-completion"); > define_key(set_completion_keymap, "h", "set-completion"); > define_key(set_completion_keymap, "a", "set-completion"); > define_key(set_completion_keymap, "d", "set-completion"); You might post this code as a comment at so people can easily find it. -- John Foerch From jjfoerch at earthlink.net Thu Sep 25 07:48:12 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Thu, 25 Sep 2008 10:48:12 -0400 Subject: [Conkeror] universal-negate Message-ID: <87vdwkcmdv.fsf@earthlink.net> I want to put the following question out there: Is there any real need for the existence of the universal-negate command? Discuss. :) Here are a few points to consider: * For every command that accepts a negative numeric prefix, there is already a corresponding "opposite" command. * If we wanted to bind the number keys to numeric-prefix in content_buffer_normal_keymap, the "-" key could not be bound because it would conflict with zoom. * In emacs, there are a few commands that give special meaning to negative prefix arg, apart from its value as a simple integer. Conkeror does not need this kind of hack because it has a richer system for prefix commands. * It would be one less thing to document, and one less `if' statement in all the commands that accept a numeric prefix. I don't care deeply about this issue, but I think it may be a worthwhile simplification, in that we would not really lose anything of value by declaring that numeric prefixes are whole numbers instead of integers. -- John Foerch From jjfoerch at earthlink.net Thu Sep 25 07:49:31 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Thu, 25 Sep 2008 10:49:31 -0400 Subject: [Conkeror] Add a pattern to adblockplus based on a target References: Message-ID: <87r678cmbo.fsf@earthlink.net> David Kettler writes: > The main point is that it seems that prefix commands do not get > applied to functions called via M-x. I had not intended to bind this > command to a key (I don't need it often), but it's better if prefix > commands work with it. That would be a bug. I'll look into it. -- John Foerch From jjfoerch at earthlink.net Thu Sep 25 08:20:12 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Thu, 25 Sep 2008 11:20:12 -0400 Subject: [Conkeror] Add a pattern to adblockplus based on a target References: <87r678cmbo.fsf@earthlink.net> Message-ID: <87myhwckwj.fsf@earthlink.net> John J Foerch writes: > David Kettler writes: >> The main point is that it seems that prefix commands do not get >> applied to functions called via M-x. I had not intended to bind this >> command to a key (I don't need it often), but it's better if prefix >> commands work with it. > > That would be a bug. I'll look into it. Fixed. Noticed another bug along the way, so it's onward and upward. :) -- John Foerch From jjfoerch at earthlink.net Thu Sep 25 16:00:57 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Thu, 25 Sep 2008 19:00:57 -0400 Subject: [Conkeror] [PATCH] Provide the buffer number and number of buffers in the modeline. References: Message-ID: <87iqsjde52.fsf@earthlink.net> David Kettler writes: > This provides a count like [2/5] in the mode-line. It's probably not > useful when using the tab bar; that provides more visual feedback. > > Enable using the following in your rc: > > add_hook("mode_line_hook", mode_line_adder(buffer_count_widget), true); Thank you very much. Very useful feature. Applied. -- John Foerch From David.Kettler at dsto.defence.gov.au Thu Sep 25 19:55:02 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 26 Sep 2008 12:25:02 +0930 Subject: [Conkeror] [PATCH] Provide an interactive function to add a pattern to Adblock Plus. In-Reply-To: <87myhwckwj.fsf@earthlink.net> References: <87r678cmbo.fsf@earthlink.net> <87myhwckwj.fsf@earthlink.net> Message-ID: Add a pattern to Adblock Plus based on a target. The target can be selected and then edited. The default target type is "images", as they are the most common obnoxious content. --- > Fixed. Noticed another bug along the way, so it's onward and upward. :) Thanks very much for that. Some possibly questionable decisions in this patch: - I made the whole thing an interactive definition, rather than defining a separate function; I think this is correct because the whole point of this function is to provide a UI. - I put the default_browser_object_classes change in the extension support file, rather than in element.js. - I used the "url" history list. Possibly it should be separate. - adblockplus_service.normalizeFilter() doesn't seem to be necessary, but i don't really know what it's for. regards, David modules/extensions/adblockplus.js | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-) diff --git a/modules/extensions/adblockplus.js b/modules/extensions/adblockplus.js index de60997..a917e88 100644 --- a/modules/extensions/adblockplus.js +++ b/modules/extensions/adblockplus.js @@ -22,3 +22,23 @@ function adblockplus_settings(buffer, uri_string) { } interactive("adblockplus-settings", "Show the Adblock Plus settings dialog.", function (I) { adblockplus_settings(I.buffer); }); + +default_browser_object_classes.adblock = "images"; + +interactive("adblockplus-add", "Add a pattern to Adblock Plus.", + function (I) { + var element = yield I.read_browser_object("adblock", "Adblock"); + + var spec = element_get_load_spec(element); + if (spec == null) + throw interactive_error("Element has no associated URI"); + + var pattern = yield I.minibuffer.read_url( + $prompt = "Adblock:", + $initial_value = load_spec_uri_string(spec), + $history = "url"); + + adblockplus_service.addPatterns([pattern]); + + I.buffer.web_navigation.reload(Ci.nsIWebNavigation.LOAD_FLAGS_NONE); +}); -- 1.6.0.2.304.gc76d.dirty -- IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From jeremy at jeremyms.com Thu Sep 25 20:06:53 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Thu, 25 Sep 2008 20:06:53 -0700 Subject: [Conkeror] [PATCH] Provide an interactive function to add a pattern to Adblock Plus. In-Reply-To: (David Kettler's message of "26 Sep 2008 12:25:02 +0930") References: <87r678cmbo.fsf@earthlink.net> <87myhwckwj.fsf@earthlink.net> Message-ID: <87tzc3obaq.fsf@jeremyms.com> I applied your patch. Thanks. -- Jeremy Maitin-Shepard From David.Kettler at dsto.defence.gov.au Thu Sep 25 20:13:46 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 26 Sep 2008 12:43:46 +0930 Subject: [Conkeror] changing URL completion choices In-Reply-To: <87zllwcnii.fsf@earthlink.net> References: <87zllwcnii.fsf@earthlink.net> Message-ID: > You might post this code as a comment at > so people can easily find it. I posted a slightly less clunky and more configurable version. I'd like to get it to respond immediately when used in the minibuffer: > > It's okay, but only affects future > > prompts; if you use the keystrokes while in the minibuffer, the > > current completions are not affected. I don't know how to achieve > > that and I'm interested in suggestions. This seems to be related to > > the issue discussed at http://bugs.conkeror.org/conkeror/issue23. Comments welcome. regards, David IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From jjfoerch at earthlink.net Thu Sep 25 20:58:10 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Thu, 25 Sep 2008 23:58:10 -0400 Subject: [Conkeror] changing URL completion choices References: <87zllwcnii.fsf@earthlink.net> Message-ID: <87ej37d0dp.fsf@earthlink.net> David Kettler writes: >> You might post this code as a comment at >> so people can easily find it. > > I posted a slightly less clunky and more configurable version. > > I'd like to get it to respond immediately when used in the minibuffer: In order to make that happen we need a more flexable system that allows completion-sets to be invoked as modules. Such a system should be generalized enough that any completions source can be switched-to. Consider the following use case for quite a different kind of completion: You are browsing a webpage that has some non-hyperlinked URLs in the text. You hit `g' and then some other key that invokes a completer that scrapes the non-hyperlinked URLs from the text, and uses them as a completions list. It is easy to think of many other situations where novel sources would be used to obtain a completions list. -- John Foerch From David.Kettler at dsto.defence.gov.au Thu Sep 25 21:31:39 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 26 Sep 2008 14:01:39 +0930 Subject: [Conkeror] changing URL completion choices In-Reply-To: <87ej37d0dp.fsf@earthlink.net> References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> Message-ID: John J Foerch writes: > In order to make that happen we need a more flexable system that allows > completion-sets to be invoked as modules. Another suggestion which may help scope the problem. In emacs I use the following code, from iswitchb.el: ;; Kin Cho also suggested the following defun. Once you have a subset of ;; matching buffers matching your current prompt, you can then press ;; e.g. C-o to restrict matching to those buffers and clearing the prompt: ;; (defun iswitchb-exclude-nonmatching() ;; "Make iswitchb work on only the currently matching names." I think a similar feature in conkeror would be very helpful for narrowing down a large history completion list. That also requires changing the completion list on the fly, but in this case it depends on the current completion list. regards, David. IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From jeremy at jeremyms.com Thu Sep 25 22:17:29 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Thu, 25 Sep 2008 22:17:29 -0700 Subject: [Conkeror] changing URL completion choices In-Reply-To: <87ej37d0dp.fsf@earthlink.net> (John J. Foerch's message of "Thu, 25 Sep 2008 23:58:10 -0400") References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> Message-ID: <87prmro592.fsf@jeremyms.com> John J Foerch writes: > David Kettler writes: >>> You might post this code as a comment at >>> so people can easily find it. >> >> I posted a slightly less clunky and more configurable version. >> >> I'd like to get it to respond immediately when used in the >> minibuffer: Potentially this could be implemented if there were some notification system for indicating that the completions list is out of date and needs to be refreshed. > In order to make that happen we need a more flexable system that allows > completion-sets to be invoked as modules. Such a system should be > generalized enough that any completions source can be switched-to. > Consider the following use case for quite a different kind of > completion: > You are browsing a webpage that has some non-hyperlinked URLs in the > text. You hit `g' and then some other key that invokes a completer > that scrapes the non-hyperlinked URLs from the text, and uses them as > a completions list. For this particular application, I think a browser object class may be appropriate. > It is easy to think of many other situations where novel sources would > be used to obtain a completions list. I wonder if many of these situations can likewise be solved using a browser object class. -- Jeremy Maitin-Shepard From jjfoerch at earthlink.net Fri Sep 26 02:33:54 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Fri, 26 Sep 2008 05:33:54 -0400 Subject: [Conkeror] changing URL completion choices References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> <87prmro592.fsf@jeremyms.com> Message-ID: <87abdvcku5.fsf@earthlink.net> Jeremy Maitin-Shepard writes: > >> You are browsing a webpage that has some non-hyperlinked URLs in the >> text. You hit `g' and then some other key that invokes a completer >> that scrapes the non-hyperlinked URLs from the text, and uses them as >> a completions list. > > For this particular application, I think a browser object class may be > appropriate. > >> It is easy to think of many other situations where novel sources would >> be used to obtain a completions list. > > I wonder if many of these situations can likewise be solved using a > browser object class. Yes, there is some overlap between the things for which browser objects are best vs. completions. In the case of non-hyperlinked URLs, I have the impression, correct me if I'm wrong, that positioning the hint elements is not quite possible, making completions the logical choice. -- John Foerch From jjfoerch at earthlink.net Fri Sep 26 02:37:08 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Fri, 26 Sep 2008 05:37:08 -0400 Subject: [Conkeror] changing URL completion choices References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> Message-ID: <8763ojckor.fsf@earthlink.net> David Kettler writes: > ;; (defun iswitchb-exclude-nonmatching() > ;; "Make iswitchb work on only the currently matching names." > > I think a similar feature in conkeror would be very helpful for > narrowing down a large history completion list. That would be great. -- John Foerch From jjfoerch at earthlink.net Fri Sep 26 03:08:53 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Fri, 26 Sep 2008 06:08:53 -0400 Subject: [Conkeror] changing URL completion choices References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> <87prmro592.fsf@jeremyms.com> <87abdvcku5.fsf@earthlink.net> Message-ID: <871vz7cj7u.fsf@earthlink.net> John J Foerch writes: > Yes, there is some overlap between the things for which browser > objects are best vs. completions. In the case of non-hyperlinked URLs, > I have the impression, correct me if I'm wrong, that positioning the > hint elements is not quite possible, making completions the logical > choice. ...Or perhaps the idea of switching completion-sets during completion is redundant of browser objects, and we should not go that way. Though I do like the idea of "narrowing completions" very much. -- John Foerch From rohan.nicholls at googlemail.com Fri Sep 26 03:44:15 2008 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Fri, 26 Sep 2008 12:44:15 +0200 Subject: [Conkeror] conkeror not starting In-Reply-To: References: Message-ID: Some more messing around and I finally discovered the -jsconsole setting, which finally gave me something meaningful. The first errror which lead to the others is this: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIProperties.get]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: file:///home/rohan/src/conkeror/components/application.js :: :: line 37" data: no] Any help would be wonderful, as at this point the code in this area of the app is completely beyond me, and my time limits for figuring it out. Thanks, Rohan On Thu, Sep 25, 2008 at 11:43 AM, Rohan Nicholls wrote: > Hi everyone, > > I am using the git version of conkeror, and have just updated it. > > On hardy heron (ubuntu) the xulrunner-1.9.0.2 is installed. > > If I use the new method (run-conkeror) script or the old method > of copying over xulrunner-stub the result is the same. > > call conkeror, and it gives no errors but exits immediately. > I removed my .conkeror.mozilla... directory, and it just > gave this output and then exited: > > Registering '@mozilla.org/module-loader/python;1' (libpyloader.so) > Registering '@mozilla.org/network/protocol/about;1?what=python' (pyabout.py) > Registering '@mozilla.org/module-loader/python;1' (libpyloader.so) > Registering '@mozilla.org/network/protocol/about;1?what=python' (pyabout.py) > > > I have moved my conkerorrc directory so it is not being loaded. > > And now I am out of ideas. Running the conkeror --debug yields no information > except to say everything is running smoothly, and then exitting. > > Am I the only one with this problem? > > Thanks, > > Rohan > > P.S. I am starting to suffer from withdrawal symptoms..... :( > From rohan.nicholls at googlemail.com Fri Sep 26 03:47:13 2008 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Fri, 26 Sep 2008 12:47:13 +0200 Subject: [Conkeror] conkeror not starting In-Reply-To: References: Message-ID: Sorry I forgot to mention: xulrunner: 1.9 from the mozilla site, Mozilla XULRunner 1.9 - 2008061013 conkeror: from git, updated this morning. OS: Ubuntu Hardy Heron Linux On Fri, Sep 26, 2008 at 12:44 PM, Rohan Nicholls wrote: > Some more messing around and I finally discovered > the -jsconsole setting, which finally gave me something > meaningful. > > The first errror which lead to the others is this: > Error: uncaught exception: [Exception... "Component returned failure > code: 0x80004005 (NS_ERROR_FAILURE) [nsIProperties.get]" nsresult: > "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: > file:///home/rohan/src/conkeror/components/application.js :: > :: line 37" data: no] > > Any help would be wonderful, as at this point the code in > this area of the app is completely beyond me, and my > time limits for figuring it out. > > Thanks, > > Rohan > > On Thu, Sep 25, 2008 at 11:43 AM, Rohan Nicholls > wrote: >> Hi everyone, >> >> I am using the git version of conkeror, and have just updated it. >> >> On hardy heron (ubuntu) the xulrunner-1.9.0.2 is installed. >> >> If I use the new method (run-conkeror) script or the old method >> of copying over xulrunner-stub the result is the same. >> >> call conkeror, and it gives no errors but exits immediately. >> I removed my .conkeror.mozilla... directory, and it just >> gave this output and then exited: >> >> Registering '@mozilla.org/module-loader/python;1' (libpyloader.so) >> Registering '@mozilla.org/network/protocol/about;1?what=python' (pyabout.py) >> Registering '@mozilla.org/module-loader/python;1' (libpyloader.so) >> Registering '@mozilla.org/network/protocol/about;1?what=python' (pyabout.py) >> >> >> I have moved my conkerorrc directory so it is not being loaded. >> >> And now I am out of ideas. Running the conkeror --debug yields no information >> except to say everything is running smoothly, and then exitting. >> >> Am I the only one with this problem? >> >> Thanks, >> >> Rohan >> >> P.S. I am starting to suffer from withdrawal symptoms..... :( >> > From rohan.nicholls at googlemail.com Fri Sep 26 03:49:04 2008 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Fri, 26 Sep 2008 12:49:04 +0200 Subject: [Conkeror] conkeror not starting In-Reply-To: References: Message-ID: The code responsible according to the bug: application.prototype = { Cc: Cc, Ci: Ci, Cr: Cr, profile_dir: Cc["@mozilla.org/file/directory_service;1"] .getService(Ci.nsIProperties).get("ProfD", Ci.nsIFile).path, /* Note: resource://app currently doesn't result in xpcnativewrappers=yes */ module_uri_prefix: "chrome://conkeror-modules/content/", subscript_loader: Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader), preferences: Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService), The profile_dir: Cc[.... is the offending line On Fri, Sep 26, 2008 at 12:47 PM, Rohan Nicholls wrote: > Sorry I forgot to mention: > > xulrunner: 1.9 from the mozilla site, Mozilla XULRunner 1.9 - 2008061013 > conkeror: from git, updated this morning. > OS: Ubuntu Hardy Heron Linux > > > On Fri, Sep 26, 2008 at 12:44 PM, Rohan Nicholls > wrote: >> Some more messing around and I finally discovered >> the -jsconsole setting, which finally gave me something >> meaningful. >> >> The first errror which lead to the others is this: >> Error: uncaught exception: [Exception... "Component returned failure >> code: 0x80004005 (NS_ERROR_FAILURE) [nsIProperties.get]" nsresult: >> "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: >> file:///home/rohan/src/conkeror/components/application.js :: >> :: line 37" data: no] >> >> Any help would be wonderful, as at this point the code in >> this area of the app is completely beyond me, and my >> time limits for figuring it out. >> >> Thanks, >> >> Rohan >> >> On Thu, Sep 25, 2008 at 11:43 AM, Rohan Nicholls >> wrote: >>> Hi everyone, >>> >>> I am using the git version of conkeror, and have just updated it. >>> >>> On hardy heron (ubuntu) the xulrunner-1.9.0.2 is installed. >>> >>> If I use the new method (run-conkeror) script or the old method >>> of copying over xulrunner-stub the result is the same. >>> >>> call conkeror, and it gives no errors but exits immediately. >>> I removed my .conkeror.mozilla... directory, and it just >>> gave this output and then exited: >>> >>> Registering '@mozilla.org/module-loader/python;1' (libpyloader.so) >>> Registering '@mozilla.org/network/protocol/about;1?what=python' (pyabout.py) >>> Registering '@mozilla.org/module-loader/python;1' (libpyloader.so) >>> Registering '@mozilla.org/network/protocol/about;1?what=python' (pyabout.py) >>> >>> >>> I have moved my conkerorrc directory so it is not being loaded. >>> >>> And now I am out of ideas. Running the conkeror --debug yields no information >>> except to say everything is running smoothly, and then exitting. >>> >>> Am I the only one with this problem? >>> >>> Thanks, >>> >>> Rohan >>> >>> P.S. I am starting to suffer from withdrawal symptoms..... :( >>> >> > From jjfoerch at earthlink.net Fri Sep 26 08:37:21 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Fri, 26 Sep 2008 11:37:21 -0400 Subject: [Conkeror] conkeror not starting References: Message-ID: <87wsgyc40e.fsf@earthlink.net> "Rohan Nicholls" writes: > The code responsible according to the bug: > > application.prototype = { > Cc: Cc, > Ci: Ci, > Cr: Cr, > profile_dir: Cc["@mozilla.org/file/directory_service;1"] > .getService(Ci.nsIProperties).get("ProfD", Ci.nsIFile).path, > /* Note: resource://app currently doesn't result in xpcnativewrappers=yes */ > module_uri_prefix: "chrome://conkeror-modules/content/", > subscript_loader: > Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader), > preferences: > Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService), > > The profile_dir: Cc[.... is the offending line This gives us a place to start, at least. Come by the irc channel some time so we can more easily communicate about diagnosing the problem. -- John Foerch From jjfoerch at earthlink.net Fri Sep 26 08:52:45 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Fri, 26 Sep 2008 11:52:45 -0400 Subject: [Conkeror] changing URL completion choices References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> <87prmro592.fsf@jeremyms.com> <87abdvcku5.fsf@earthlink.net> <871vz7cj7u.fsf@earthlink.net> Message-ID: <87skrmc3aq.fsf@earthlink.net> John J Foerch writes: > John J Foerch writes: >> Yes, there is some overlap between the things for which browser >> objects are best vs. completions. In the case of non-hyperlinked URLs, >> I have the impression, correct me if I'm wrong, that positioning the >> hint elements is not quite possible, making completions the logical >> choice. > > ...Or perhaps the idea of switching completion-sets during completion is > redundant of browser objects, and we should not go that way. Though I > do like the idea of "narrowing completions" very much. Sorry I keep following up on my own posts here, but I have been thinking about this problem throughout the morning. Let us make new browser-object-classes for history, bookmarks, and webjumps, and change find-url to be a browser-object command for which the default browser-object-class would be some kind of composition of bookmarks plus webjumps. We will need to brainstorm about how this "browser-object-class composition" would work, but I think we can come up with something. This brings the completions system into the browser-object system, and if we further find a means to switch browser-object-classes during an ongoing interaction, that will cleanly solve the issue that David raised, plus switching between any of the existing browser-object-classes. For my part, I'm not convinced of the need for this browser-object-class switching, because the browser-object system is built on a semantics of prefix commands. However, I'm willing to suspend judgement and see where this line of development leads. -- John Foerch From jeremy at jeremyms.com Fri Sep 26 11:07:35 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Fri, 26 Sep 2008 11:07:35 -0700 Subject: [Conkeror] changing URL completion choices In-Reply-To: <87abdvcku5.fsf@earthlink.net> (John J. Foerch's message of "Fri, 26 Sep 2008 05:33:54 -0400") References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> <87prmro592.fsf@jeremyms.com> <87abdvcku5.fsf@earthlink.net> Message-ID: <87ej36ok60.fsf@jeremyms.com> John J Foerch writes: > Jeremy Maitin-Shepard writes: >> >>> You are browsing a webpage that has some non-hyperlinked URLs in the >>> text. You hit `g' and then some other key that invokes a completer >>> that scrapes the non-hyperlinked URLs from the text, and uses them as >>> a completions list. >> >> For this particular application, I think a browser object class may be >> appropriate. >> >>> It is easy to think of many other situations where novel sources would >>> be used to obtain a completions list. >> >> I wonder if many of these situations can likewise be solved using a >> browser object class. > Yes, there is some overlap between the things for which browser > objects are best vs. completions. In the case of non-hyperlinked URLs, > I have the impression, correct me if I'm wrong, that positioning the > hint elements is not quite possible, making completions the logical > choice. A browser object class is not necessarily related to the hints system. The media browser object class uses completion to select among alternatives, for instance. Although potentially using the hints system might be nice, as you say it might be difficult and I was just thinking of using minibuffer completion. -- Jeremy Maitin-Shepard From jjfoerch at earthlink.net Fri Sep 26 12:10:18 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Fri, 26 Sep 2008 15:10:18 -0400 Subject: [Conkeror] changing URL completion choices References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> <87prmro592.fsf@jeremyms.com> <87abdvcku5.fsf@earthlink.net> <87ej36ok60.fsf@jeremyms.com> Message-ID: <87od2abu5h.fsf@earthlink.net> Jeremy Maitin-Shepard writes: > A browser object class is not necessarily related to the hints system. > The media browser object class uses completion to select among > alternatives, for instance. Although potentially using the hints system > might be nice, as you say it might be difficult and I was just thinking > of using minibuffer completion. Right. All of the existing browser-objects, I believe, happen to be DOM elements, but the concept is not limited to that at all. In the case of a "history" browser-object-class, the selection UI would be the completions system (not the hints system), and the browser object that gets returned would be an nsIURI. The UI of find-url would appear to work exactly as it does now. However, by wrapping history-completion up as a browser-object-class, it would be more directly possible to use history-completion with all of the other browser-object commands. The "copy" command is always one that comes to mind that would be particularly convenient to be able to use with webjumps, bookmarks, and history. -- John Foerch From jeremy at jeremyms.com Fri Sep 26 12:27:25 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Fri, 26 Sep 2008 12:27:25 -0700 Subject: [Conkeror] conkeror not starting In-Reply-To: (Rohan Nicholls's message of "Fri, 26 Sep 2008 12:49:04 +0200") References: Message-ID: <87abduoggy.fsf@jeremyms.com> "Rohan Nicholls" writes: > The code responsible according to the bug: > application.prototype = { > Cc: Cc, > Ci: Ci, > Cr: Cr, > profile_dir: Cc["@mozilla.org/file/directory_service;1"] > .getService(Ci.nsIProperties).get("ProfD", Ci.nsIFile).path, > /* Note: resource://app currently doesn't result in xpcnativewrappers=yes */ > module_uri_prefix: "chrome://conkeror-modules/content/", > subscript_loader: > Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader), > preferences: > Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService), > The profile_dir: Cc[.... is the offending line I don't see this line in any revision of the master branch of the official repository. I'm curious where you obtained this version. -- Jeremy Maitin-Shepard From jjfoerch at earthlink.net Fri Sep 26 12:31:47 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Fri, 26 Sep 2008 15:31:47 -0400 Subject: [Conkeror] conkeror not starting References: Message-ID: <87k5cybt5o.fsf@earthlink.net> "Rohan Nicholls" writes: > The code responsible according to the bug: > > application.prototype = { > Cc: Cc, > Ci: Ci, > Cr: Cr, > profile_dir: Cc["@mozilla.org/file/directory_service;1"] > .getService(Ci.nsIProperties).get("ProfD", Ci.nsIFile).path, > /* Note: resource://app currently doesn't result in xpcnativewrappers=yes */ > module_uri_prefix: "chrome://conkeror-modules/content/", > subscript_loader: > Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader), > preferences: > Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService), > > The profile_dir: Cc[.... is the offending line Hi Rohan, Please do a fresh clone of the conkeror git repository. I'm not sure where that profile_dir line came from, because it's not part of conkeror. I can't recall when conkeror ever had such a variable... is this a local modification, or did you get your copy of conkeror from a repository other than the one at repo.or.cz? -- John Foerch From levy at msri.org Sat Sep 27 09:16:18 2008 From: levy at msri.org (Silvio Levy) Date: Sat, 27 Sep 2008 09:16:18 -0700 Subject: [Conkeror] Problem: dead tabs Message-ID: <20080927161618.7D653DFC2@xi.msri.org> Dear Conkeror community I'm running "conkeror.mozdev.org conkeror 0.9" (per conkeror -v) on Ubuntu. Often after I've been working for a while, tabs will stop closing. That is, the pane goes away fine, but the tab at the top remains, and when I click on it, I get the message "call interactively: TypeError: t.selected_buffer.tab is undefined." Because the dead tabs are confusing, the only solution I've found is to restart conkeror, which often sets me back several minutes. Any ideas what I might be doing wrong? Silvio From levy at msri.org Sat Sep 27 09:23:51 2008 From: levy at msri.org (Silvio Levy) Date: Sat, 27 Sep 2008 09:23:51 -0700 Subject: [Conkeror] Question: how to paste url without focusing on minibuffer Message-ID: <20080927162351.BD97FDFC2@xi.msri.org> Suppose I want to copy-and-paste a URL onto conkeror. I do "find-alternate-url" (which I have bound to control-L) and then do it again so the old url is erased. Then, to paste the new URL using the middle mouse, I have to MOVE the cursor to the minibuffer area! If I try to paste the URL while the cursor is on the main conkeror window, I get a weird behavior (a little disk with up and down arrows appears and the page starts to scroll when I move the mouse). It would be more useful if I could paste my url anywhere, of if the mouse focus after "find-alternate-url" shifted to the minibuffer area. Is there an option I should set that would accomplish this? Thank you, Silvio From eichin at gmail.com Sat Sep 27 12:46:54 2008 From: eichin at gmail.com (Mark Eichin) Date: Sat, 27 Sep 2008 15:46:54 -0400 Subject: [Conkeror] Question: how to paste url without focusing on minibuffer In-Reply-To: <20080927162351.BD97FDFC2@xi.msri.org> References: <20080927162351.BD97FDFC2@xi.msri.org> Message-ID: Um, why use the mouse at all? c-x c-f shift-insert works for me... On Sat, Sep 27, 2008 at 12:23 PM, Silvio Levy wrote: > Suppose I want to copy-and-paste a URL onto conkeror. I do > "find-alternate-url" (which I have bound to control-L) and then do it > again so the old url is erased. Then, to paste the new URL using the > middle mouse, I have to MOVE the cursor to the minibuffer area! If I > try to paste the URL while the cursor is on the main conkeror window, > I get a weird behavior (a little disk with up and down arrows appears > and the page starts to scroll when I move the mouse). > > It would be more useful if I could paste my url anywhere, of if the > mouse focus after "find-alternate-url" shifted to the minibuffer area. > Is there an option I should set that would accomplish this? > > Thank you, > > Silvio > > _______________________________________________ > Conkeror mailing list > Conkeror at mozdev.org > https://www.mozdev.org/mailman/listinfo/conkeror > -- _Mark_ From rohan.nicholls at googlemail.com Sat Sep 27 14:14:42 2008 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Sat, 27 Sep 2008 23:14:42 +0200 Subject: [Conkeror] conkeror not starting In-Reply-To: <87k5cybt5o.fsf@earthlink.net> References: <87k5cybt5o.fsf@earthlink.net> Message-ID: Hi John, I just removed the line, and tried to restart, and failed but this time with useful errors. The profile_dir line comes from the session management patches I applied. I guess because the session.json file is sitting in that directory. If that is what is breaking things, then I will need to remove it and the session management stuff at work. Still can't figure out why it would work here and not there, unless some change between 1.9.0.1 and 1.9.0.2 broke that piece of code. Again, on Tuesday I will do a clean checkout and see if that works. Thanks again for the help, and enjoy the rest of your weekend. Rohan On Fri, Sep 26, 2008 at 9:31 PM, John J Foerch wrote: > "Rohan Nicholls" writes: >> The code responsible according to the bug: >> >> application.prototype = { >> Cc: Cc, >> Ci: Ci, >> Cr: Cr, >> profile_dir: Cc["@mozilla.org/file/directory_service;1"] >> .getService(Ci.nsIProperties).get("ProfD", Ci.nsIFile).path, >> /* Note: resource://app currently doesn't result in xpcnativewrappers=yes */ >> module_uri_prefix: "chrome://conkeror-modules/content/", >> subscript_loader: >> Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader), >> preferences: >> Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefService), >> >> The profile_dir: Cc[.... is the offending line > > Hi Rohan, > > Please do a fresh clone of the conkeror git repository. I'm not sure > where that profile_dir line came from, because it's not part of > conkeror. I can't recall when conkeror ever had such a variable... is > this a local modification, or did you get your copy of conkeror from a > repository other than the one at repo.or.cz? > > -- > John Foerch > > > _______________________________________________ > Conkeror mailing list > Conkeror at mozdev.org > https://www.mozdev.org/mailman/listinfo/conkeror > From jjfoerch at earthlink.net Sat Sep 27 22:01:40 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Sun, 28 Sep 2008 01:01:40 -0400 Subject: [Conkeror] conkeror not starting References: <87k5cybt5o.fsf@earthlink.net> Message-ID: <87fxnkc18r.fsf@earthlink.net> "Rohan Nicholls" writes: > Hi John, > > I just removed the line, and tried to restart, and failed but this time with > useful errors. The profile_dir line comes from the session management > patches I applied. I guess because the session.json file is sitting in that > directory. If that is what is breaking things, then I will need to remove it > and the session management stuff at work. Still can't figure out why > it would work here and not there, unless some change between > 1.9.0.1 and 1.9.0.2 broke that piece of code. > > Again, on Tuesday I will do a clean checkout and see if that works. Thanks > again for the help, and enjoy the rest of your weekend. > > Rohan Oh, it came from the sessions patch.. that explains it all. Well, that is obviusly a problem that will have to be dealt with before conkeror can have sessions. -- John Foerch From juhpetersen at gmail.com Sun Sep 28 07:47:15 2008 From: juhpetersen at gmail.com (Jens Petersen) Date: Mon, 29 Sep 2008 00:47:15 +1000 Subject: [Conkeror] [patch] modeline buffer session history widget Message-ID: <9436bffe0809280747l53bfb4afyc7989e360a37a4fc@mail.gmail.com> > 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.) Jens -------------- next part -------------- A non-text attachment was scrubbed... Name: conkeror-modeline-session-widget.patch Type: application/octet-stream Size: 1923 bytes Desc: not available URL: From juhpetersen at gmail.com Sun Sep 28 08:00:52 2008 From: juhpetersen at gmail.com (Jens Petersen) Date: Mon, 29 Sep 2008 01:00:52 +1000 Subject: [Conkeror] [patch] some trivial fixes Message-ID: <9436bffe0809280800vefe5ad6xaa570dcec72a507f@mail.gmail.com> Hi, I am still learning javascript, but here is a small patch with a few things I and js2.el noticed. Should I include changelog entries with my patches? I don't know how useful it is but I downloaded jsl (Javascript Lint, now in python;) today and ran it over conkeror's .js files. -Jens $ find -type f -name *.js | xargs jsl | grep : | wc -l 1140 $ find -type f -name *.js | xargs jsl | grep : | grep undeclared_identifier | wc -l 1104 $ find -type f -name *.js | xargs jsl | grep : | grep -v undeclared_identifier components/application.js(138): curly_before_body components/download_helper.js(72): trailing_comma components/download_helper.js(47): unreferenced_identifier components/download_helper.js(71): unreferenced_identifier components/download_helper.js(74): unreferenced_identifier components/download_helper.js(74): unreferenced_identifier components/download_manager_ui.js(72): trailing_comma components/download_manager_ui.js(47): unreferenced_identifier components/download_manager_ui.js(71): unreferenced_identifier components/download_manager_ui.js(74): unreferenced_identifier components/download_manager_ui.js(74): unreferenced_identifier components/commandline.js(31): curly_before_body content/keyboard-setup.js(87): bad_for_each_loop defaults/preferences/prefs.js(36): nested_comment modules/bindings/default/hints.js(13): semi_after_for_init modules/mode.js(21): comparison_type_conv modules/coroutine.js(16): curly_before_body modules/minibuffer-read-option.js(19): semi_before_stmnt modules/save.js(217): semi_before_stmnt modules/find.js(49): semi_before_stmnt modules/command-line.js(43): equal_as_assign modules/command-line.js(109): semi_before_stmnt modules/load-spec.js(135): semi_before_stmnt modules/webjump.js(21): semi_before_stmnt modules/timer.js(24): unreferenced_identifier modules/timer.js(30): unreferenced_identifier modules/universal-argument.js(31): comparison_type_conv modules/mime.js(29): semi_after_for_init modules/extensions/dom-inspector.js(31): unreferenced_identifier modules/extensions/adblockplus.js(30): semi_before_stmnt modules/daemon.js(26): empty_statement modules/download-manager.js(32): semi_before_stmnt modules/page-modes/youtube.js(11): semi_before_stmnt modules/page-modes/google-maps.js(6): semi_before_stmnt Traceback (most recent call last): UnicodeEncodeError: 'ascii' codec can't encode character u'\xc6' in position 26: ordinal not in range(128) -------------- next part -------------- A non-text attachment was scrubbed... Name: conkeror-trivial.patches Type: application/octet-stream Size: 1925 bytes Desc: not available URL: From jeremy at jeremyms.com Sun Sep 28 12:37:34 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Sun, 28 Sep 2008 12:37:34 -0700 Subject: [Conkeror] [patch] modeline buffer session history widget In-Reply-To: <9436bffe0809280747l53bfb4afyc7989e360a37a4fc@mail.gmail.com> (Jens Petersen's message of "Mon, 29 Sep 2008 00:47:15 +1000") References: <9436bffe0809280747l53bfb4afyc7989e360a37a4fc@mail.gmail.com> Message-ID: <87od28m58h.fsf@jeremyms.com> "Jens Petersen" 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 From jeremy at jeremyms.com Sun Sep 28 12:53:30 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Sun, 28 Sep 2008 12:53:30 -0700 Subject: [Conkeror] [patch] some trivial fixes In-Reply-To: <9436bffe0809280800vefe5ad6xaa570dcec72a507f@mail.gmail.com> (Jens Petersen's message of "Mon, 29 Sep 2008 01:00:52 +1000") References: <9436bffe0809280800vefe5ad6xaa570dcec72a507f@mail.gmail.com> Message-ID: <87k5cwm4hx.fsf@jeremyms.com> "Jens Petersen" writes: > Hi, > I am still learning javascript, but here is a small patch with a few > things I and js2.el noticed. > Should I include changelog entries with my patches? In the future, yes, and also if you format them using git format-patch, that is helpful. It is fine if you attach the result of git format-patch to an e-mail, rather than sending it as an e-mail itself. As far as the javascript lint results, I think they are mostly or entirely bogus, because javascript lint first of all doesn't know what global variables are available, and second it doesn't understand Mozilla JavaScript 1.8, so it is confused by keywords like yield. I applied the attached patch, though. Thanks for your contribution. -- Jeremy Maitin-Shepard From juhpetersen at gmail.com Mon Sep 29 07:38:51 2008 From: juhpetersen at gmail.com (Jens Petersen) Date: Tue, 30 Sep 2008 00:38:51 +1000 Subject: [Conkeror] [patch] modeline buffer session history widget In-Reply-To: <87od28m58h.fsf@jeremyms.com> References: <9436bffe0809280747l53bfb4afyc7989e360a37a4fc@mail.gmail.com> <87od28m58h.fsf@jeremyms.com> Message-ID: <9436bffe0809290738k3de0f9f3wdae7a01dad72651e@mail.gmail.com> > I pushed a fix, though, so that now you can indeed call: : [remove_hook] > To remove all of the default mode line widgets. Thanks! I will try to play with it later. :) Jens -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Display-number-of-previous-and-next-pages-in-current.patch Type: application/octet-stream Size: 1881 bytes Desc: not available URL: From jjfoerch at earthlink.net Mon Sep 29 09:23:17 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Mon, 29 Sep 2008 12:23:17 -0400 Subject: [Conkeror] universal-negate References: <87vdwkcmdv.fsf@earthlink.net> Message-ID: <87bpy6c45m.fsf@earthlink.net> John J Foerch writes: > Is there any real need for the existence of the universal-negate > command? From discussions I have had, I haven't found anybody who actually uses universal-negate, so let me advance the issue this way. Does anybody object to the following changes in conkeror? - Remove the facilities to have negative numeric prefix arguments. - Bind the number keys in unmodified bindings, Control bindings, and Meta bindings to be numeric prefix keys in normal and special buffers. Within text fields, only the Control and Meta forms of the bindings will exist, with the unmodified numbers obviously being fallthrough keys. -- John Foerch From brian at microcomaustralia.com.au Mon Sep 29 18:06:54 2008 From: brian at microcomaustralia.com.au (Brian May) Date: Tue, 30 Sep 2008 11:06:54 +1000 Subject: [Conkeror] my conkeror doesn't work In-Reply-To: <87wsh68f1d.fsf@gmail.com> References: <87ljxmpylz.fsf@gmail.com> <20080920184456.GA20950@ratonland.org> <87wsh68f1d.fsf@gmail.com> Message-ID: <48E17BAE.3090805@microcomaustralia.com.au> Changying Li wrote: > thanks!!. > > I switched proxy.type from 5 to 0, and now it is ok. but I don't know > why the proxy.type is 5 ? what's the meaning of it? > From : "5. Use system proxy settings (Default in Linux)." I assume this means Gnome or KDE settings depending which one xulrunner is compiled against. Brian May From David.Kettler at dsto.defence.gov.au Mon Sep 29 19:25:34 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 30 Sep 2008 11:55:34 +0930 Subject: [Conkeror] changing URL completion choices In-Reply-To: <87skrmc3aq.fsf@earthlink.net> References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> <87prmro592.fsf@jeremyms.com> <87abdvcku5.fsf@earthlink.net> <871vz7cj7u.fsf@earthlink.net> <87skrmc3aq.fsf@earthlink.net> Message-ID: > This brings the completions system into the browser-object system, and > if we further find a means to switch browser-object-classes during an > ongoing interaction, that will cleanly solve the issue that David > raised, plus switching between any of the existing > browser-object-classes. For my part, I'm not convinced of the need for > this browser-object-class switching, because the browser-object system > is built on a semantics of prefix commands. However, I'm willing to > suspend judgement and see where this line of development leads. I like the idea of integrating the completion and browser object systems; I think it will be both more flexible and simpler to understand. Also, as browser object classes are selected by prefix commands it will be natural to think of completion types in the same way, so I may not miss changing them on the fly. On the other hand I sometimes find when I've typed a command that I want to then change the object class. I currently quit the command, change the class and redo the command. So maybe changing object classes after having typed the command is a worthwhile addition. For the particular case of "narrowing" I have an alternative suggestion. If the list is long enough to require this, then perhaps a little pop up list isn't the best presentation. There could be a key to "promote" the completion list to become a new fully-fledged buffer containing the list. This can be navigated like a conventional buffer, but there could also be special commands to limit the items seen. This has an analogue in the Gnus "limit" (/) facility. regards, David. IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From David.Kettler at dsto.defence.gov.au Mon Sep 29 19:29:41 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 30 Sep 2008 11:59:41 +0930 Subject: [Conkeror] [PATCH] Provide an interactive function to add a pattern to Adblock Plus. In-Reply-To: References: <87r678cmbo.fsf@earthlink.net> <87myhwckwj.fsf@earthlink.net> Message-ID: David Kettler writes: > Add a pattern to Adblock Plus based on a target. The target can be > selected and then edited. The default target type is "images", as they > are the most common obnoxious content. BTW, I apologize for the incorrect terminology here. I think I meant "browser object"; "target" is certainly wrong. The error is in the commit message only, not the code. IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From David.Kettler at dsto.defence.gov.au Mon Sep 29 19:40:27 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 30 Sep 2008 12:10:27 +0930 Subject: [Conkeror] Toggle style sheets In-Reply-To: <87k5cwm4hx.fsf@jeremyms.com> Message-ID: Some web sites have useful content but unreadably awful formatting. The following code can help. It seems to do the right thing, but I don't really know what I'm doing. interactive("toggle-stylesheets", "Toggle whether conkeror uses style sheets (CSS) for the " + "current buffer. It is sometimes useful to turn off style " + "sheets when the web site makes obnoxious choices.", function(I) { var s = I.buffer.document.styleSheets; for (var i = 0; i < s.length; i++) s[i].disabled = !s[i].disabled; }); regards, David. IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From David.Kettler at dsto.defence.gov.au Mon Sep 29 20:19:58 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 30 Sep 2008 12:49:58 +0930 Subject: [Conkeror] [RFC] Show object class for prefix key. Message-ID: This provides a bit more feedback for the inexperienced when prefix keys are used. However, it weakens the existing feedback that emphasises the key sequence. Probably it should have a config variable. modules/element.js | 4 +++- modules/keyboard.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/element.js b/modules/element.js index 992e4b5..7d23d21 100644 --- a/modules/element.js +++ b/modules/element.js @@ -54,7 +54,9 @@ function define_browser_object_class(name) { "browser-object-class-"+name, "A prefix command to specify that the following command operate "+ "on objects of type: "+name+".", - function (ctx) { ctx._browser_object_class = name; }, + function (ctx) { + ctx._browser_object_class = name; + ctx.minibuffer.message("(object class: " + name + ")...");}, $prefix = true); } diff --git a/modules/keyboard.js b/modules/keyboard.js index 89ea360..843d805 100644 --- a/modules/keyboard.js +++ b/modules/keyboard.js @@ -636,7 +636,7 @@ function key_press_handler(true_event) call_interactively(ctx, binding.command); if (interactive_commands.get(binding.command).prefix) { state.active_keymap = null; - show_partial_key_sequence(window, state, ctx); + // show_partial_key_sequence(window, state, ctx); done = false; } } -- IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From sness at sness.net Mon Sep 29 20:23:35 2008 From: sness at sness.net (sness) Date: Mon, 29 Sep 2008 20:23:35 -0700 Subject: [Conkeror] anything.el Message-ID: <7f7f86440809292023k87d740ue42bcc764e4786de@mail.gmail.com> Hi, Is there anything like anything.el in Emacs for Conkeror? "C-x b" is fine for switching buffers, but I miss the power of anything-mode. yours, Steven. From lists at reinwarth.com Tue Sep 30 02:38:25 2008 From: lists at reinwarth.com (Alexander Reinwarth) Date: Tue, 30 Sep 2008 09:38:25 +0000 (UTC) Subject: [Conkeror] Proxy Settings Message-ID: Hi, as I use conkeror regularly in different networks and as conkeror has no builtin functions for twiddling with the respective mozilla preferences, I wrote some code for changing the proxy settings. Definitely nothing special and of course the code of a java script beginner, I just thought I share the code, in case anyone has a need for it. Regards, Alexander /* * (C) Copyright 2008 Alexander Reinwarth * * Some simple functions for handling conkeror's connection through a * proxy. For simplification it is assumed that http, https, ftp and * gopher use the same proxy and port. * * "Works for me" */ /* Standard proxy host and port for proxy-host and proxy-port. */ define_variable("proxy_host","localhost", "Hostname which will be offered as a standard value by proxy-host"); define_variable("proxy_port","8080", "Port which will be offered as a standard value by proxy-host"); /* toggle proxy on/off */ interactive("proxy-toggle", "Toggle wether to use a proxy or not.", function(I) { user_pref("network.proxy.type", get_pref("network.proxy.type") == 1 ? 0 : 1); proxy_display_settings(I); // update the widget select_buffer_hook.run(I.buffer); }); /* set the proxy host */ function proxy_set_host(host){ user_pref("network.proxy.http", host); user_pref("network.proxy.ssl", host); user_pref("network.proxy.ftp", host); user_pref("network.proxy.gopher", host); } interactive("proxy-host", "Change the proxy host.", function (I) { proxy_set_host((yield I.minibuffer.read($prompt = "Host:", $initial_value=proxy_host))); proxy_display_settings(I); // update the widget select_buffer_hook.run(I.buffer); }); /* set the proxy port */ function proxy_set_port(port){ user_pref("network.proxy.http_port", parseFloat(port)); user_pref("network.proxy.ssl_port", parseFloat(port)); user_pref("network.proxy.ftp_port", parseFloat(port)); user_pref("network.proxy.gopher_port", parseFloat(port)); } interactive("proxy-port", "Change the proxy port.", function (I){ proxy_set_port((yield I.minibuffer.read($prompt = "Port:", $initial_value=proxy_port))) ; proxy_display_settings(I); // update the widget select_buffer_hook.run(I.buffer); }); /* display current proxy settings */ function proxy_display_settings (I){ I.window.minibuffer.message ((get_pref("network.proxy.http"))+ ":" + (get_pref("network.proxy.http_port"))+ ":" + (get_pref("network.proxy.type") == 1 ? "on" : "off") ); } interactive ("proxy-display-settings", "Display the current proxy settings", function (I){proxy_display_settings(I);} ); /* key bindings */ define_key(default_global_keymap, "C-c p t", "proxy-toggle"); define_key(default_global_keymap, "C-c p h", "proxy-host"); define_key(default_global_keymap, "C-c p p", "proxy-port"); define_key(default_global_keymap, "C-c p d", "proxy-display-settings"); /* * A simple modeline-widget displaying the proxy settings */ function proxy_widget(window){ this.name = "proxy-widget"; text_widget.call(this, window); // update the widget when select_buffer_hook is run this.add_hook("select_buffer_hook"); } proxy_widget.prototype.__proto__ = text_widget.prototype; proxy_widget.prototype.update = function () { this.view.text = get_pref("network.proxy.http")+":" +get_pref("network.proxy.http_port")+":" +(get_pref("network.proxy.type") == 1 ? "on" : "off"); }; /* * Add the widget to the modeline */ add_hook("mode_line_hook", mode_line_adder(proxy_widget)); From rohan.nicholls at googlemail.com Tue Sep 30 02:54:13 2008 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Tue, 30 Sep 2008 11:54:13 +0200 Subject: [Conkeror] conkeror not starting In-Reply-To: <87fxnkc18r.fsf@earthlink.net> References: <87k5cybt5o.fsf@earthlink.net> <87fxnkc18r.fsf@earthlink.net> Message-ID: On Sun, Sep 28, 2008 at 7:01 AM, John J Foerch wrote: > "Rohan Nicholls" writes: >> Hi John, >> >> I just removed the line, and tried to restart, and failed but this time with >> useful errors. The profile_dir line comes from the session management >> patches I applied. I guess because the session.json file is sitting in that >> directory. If that is what is breaking things, then I will need to remove it >> and the session management stuff at work. Still can't figure out why >> it would work here and not there, unless some change between >> 1.9.0.1 and 1.9.0.2 broke that piece of code. >> >> Again, on Tuesday I will do a clean checkout and see if that works. Thanks >> again for the help, and enjoy the rest of your weekend. >> >> Rohan > > Oh, it came from the sessions patch.. that explains it all. Well, that > is obviusly a problem that will have to be dealt with before conkeror > can have sessions. Yes, this is indeed the case. I have done a new clone checked that it was definitely without the session code, and it works. Thanks for all the help, it is disappointing that I will not be able to have sessions on this machine, but I am too happy to have conkeror back to worry about it that much. What I can't figure out is why the profile_dir thingy breaks it so badly. It seems to be just setting a variable, actually it just seems to be trying to getting the profile directory, but there must be a more robust way to do that. Other than that, sessions was working a treat. Well, maybe I will hack on it, and figure out what is going on, after the other 300 things I have to do. ;) Rohan From rohan.nicholls at googlemail.com Tue Sep 30 03:01:59 2008 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Tue, 30 Sep 2008 12:01:59 +0200 Subject: [Conkeror] conkeror not starting In-Reply-To: References: <87k5cybt5o.fsf@earthlink.net> <87fxnkc18r.fsf@earthlink.net> Message-ID: On Tue, Sep 30, 2008 at 11:54 AM, Rohan Nicholls wrote: > On Sun, Sep 28, 2008 at 7:01 AM, John J Foerch wrote: >> "Rohan Nicholls" writes: >> >> Oh, it came from the sessions patch.. that explains it all. Well, that >> is obviusly a problem that will have to be dealt with before conkeror >> can have sessions. > > Yes, this is indeed the case. I have done a new clone checked that it > was definitely without the session code, and it works. > > What I can't figure out is why the profile_dir thingy breaks it so > badly. It seems to be just setting a variable, actually it just seems > to be trying to getting the profile directory, but there must be a > more robust way to do that. Other than that, sessions was working a > treat. Actually if I eval the offending line, I get a directory path back (a valid one), so even that does not really make sense. Cc["@mozilla.org/file/directory_service;1"] .getService(Ci.nsIProperties).get("ProfD", Ci.nsIFile).path But for whatever reasons, during startup it was killing the app. Just thought I should add that. Rohan From jjfoerch at earthlink.net Tue Sep 30 03:08:39 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Tue, 30 Sep 2008 06:08:39 -0400 Subject: [Conkeror] changing URL completion choices References: <87zllwcnii.fsf@earthlink.net> <87ej37d0dp.fsf@earthlink.net> <87prmro592.fsf@jeremyms.com> <87abdvcku5.fsf@earthlink.net> <871vz7cj7u.fsf@earthlink.net> <87skrmc3aq.fsf@earthlink.net> Message-ID: <878wta9c9k.fsf@earthlink.net> David Kettler writes: > I like the idea of integrating the completion and browser object > systems; I think it will be both more flexible and simpler to > understand. Also, as browser object classes are selected by prefix > commands it will be natural to think of completion types in the same > way, so I may not miss changing them on the fly. > > On the other hand I sometimes find when I've typed a command that I > want to then change the object class. I currently quit the command, > change the class and redo the command. So maybe changing object classes > after having typed the command is a worthwhile addition. > > For the particular case of "narrowing" I have an alternative > suggestion. If the list is long enough to require this, then perhaps > a little pop up list isn't the best presentation. There could be a > key to "promote" the completion list to become a new fully-fledged > buffer containing the list. This can be navigated like a conventional > buffer, but there could also be special commands to limit the items > seen. This has an analogue in the Gnus "limit" (/) facility. These are good ideas. Not necessarily simple to implement, but definitely a direction we can move toward as we improve the browser objects system. -- John Foerch From jjfoerch at earthlink.net Tue Sep 30 03:13:47 2008 From: jjfoerch at earthlink.net (John J Foerch) Date: Tue, 30 Sep 2008 06:13:47 -0400 Subject: [Conkeror] [RFC] Show object class for prefix key. References: Message-ID: <873aji9c10.fsf@earthlink.net> David Kettler writes: > This provides a bit more feedback for the inexperienced when prefix > keys are used. However, it weakens the existing feedback that > emphasises the key sequence. Probably it should have a config > variable. Perhaps there is a "best of both worlds" solution here: when the interactive system displays the current key sequence, prefix keys could be followed in parentheses by a name identifying them. So if you hit * M, the minibuffer message would look like: * M (MathML) -- John Foerch From David.Kettler at dsto.defence.gov.au Tue Sep 30 19:46:10 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 01 Oct 2008 12:16:10 +0930 Subject: [Conkeror] [PATCH] Show object class for prefix key. In-Reply-To: <873aji9c10.fsf@earthlink.net> References: <873aji9c10.fsf@earthlink.net> Message-ID: --- > Perhaps there is a "best of both worlds" solution here: when the > interactive system displays the current key sequence, prefix keys could > be followed in parentheses by a name identifying them. So if you hit > * M, the minibuffer message would look like: > > * M (MathML) Like this? It might need some refactoring; keyboard.js now depends on some internal details of the browser object system. modules/keyboard.js | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/keyboard.js b/modules/keyboard.js index 89ea360..fe59ea8 100644 --- a/modules/keyboard.js +++ b/modules/keyboard.js @@ -548,16 +548,22 @@ define_window_local_hook("key_press_hook", RUN_HOOK_UNTIL_SUCCESS); function key_press_handler(true_event) { function show_partial_key_sequence (window, state, ctx) { + let show = ctx.key_sequence.join(" ") ; + let name = ctx._browser_object_class; + if (name != undefined) { + name = browser_object_classes[name].label || name; + show += " (" + name + ")"; + } if (!state.help_displayed) { state.help_timer_ID = window.setTimeout(function () { - window.minibuffer.show(ctx.key_sequence.join(" ")); + window.minibuffer.show(show); state.help_displayed = true; state.help_timer_ID = null; }, keyboard_key_sequence_help_timeout); } else - window.minibuffer.show(ctx.key_sequence.join(" ")); + window.minibuffer.show(show); } try{ var window = this; -- IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From jeremy at jeremyms.com Tue Sep 30 22:40:39 2008 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Tue, 30 Sep 2008 22:40:39 -0700 Subject: [Conkeror] [PATCH] Show object class for prefix key. In-Reply-To: (David Kettler's message of "01 Oct 2008 12:16:10 +0930") References: <873aji9c10.fsf@earthlink.net> Message-ID: <874p3wj2js.fsf@jeremyms.com> David Kettler writes: > --- >> Perhaps there is a "best of both worlds" solution here: when the >> interactive system displays the current key sequence, prefix keys could >> be followed in parentheses by a name identifying them. So if you hit >> * M, the minibuffer message would look like: >> >> * M (MathML) > Like this? It might need some refactoring; keyboard.js now depends on > some internal details of the browser object system. The feature seems potentially reasonable in theory, but I don't think this is a good way to do it. Potentially it could be done nicely as part of a general system for associating help text with key prefix bindings. -- Jeremy Maitin-Shepard From David.Kettler at dsto.defence.gov.au Tue Sep 30 23:21:54 2008 From: David.Kettler at dsto.defence.gov.au (David Kettler) Date: 01 Oct 2008 15:51:54 +0930 Subject: [Conkeror] [RFC] Show more links on mouse over. Message-ID: Previously only simple links were shown in the echo area when the mouse was hovered over the link. Now image links and links containing formatting will also be shown. --- An example where this makes a difference is at the conkeror webgit http://repo.or.cz/w/conkeror.git. The git image in the top right corner is clickable but without this patch it doesn't show the link on mouseover. This patch copies the parent chasing code from element_get_load_spec(). That's more expensive than the previous code, but I don't notice any performance degradation on my box. My main concern with the approach though, is that I want a guarantee that the link I see when I hover is what I'll get when I click. But the current code has seperate implementations for these two cases, so the result may differ. I considered calling element_get_load_spec() from the event handler, but it seems rather heavy weight. I wonder if it's possible to hook in while the DOM is being constructed and attach the href from an anchor element to its bottom level child. And do some of the other cases handled by element_get_load_spec() at that time too. Then the simplified element_get_load_spec() and the mouseover event handler need only check the element for a href; they will get the same result. modules/content-buffer.js | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/content-buffer.js b/modules/content-buffer.js index 1cd28a4..a80ef13 100644 --- a/modules/content-buffer.js +++ b/modules/content-buffer.js @@ -51,8 +51,11 @@ function content_buffer(window, element) }, true /* capture */, false /* ignore untrusted events */); this.browser.addEventListener("mouseover", function (event) { - if (event.target instanceof Ci.nsIDOMHTMLAnchorElement) { - content_buffer_overlink_change_hook.run(buffer, event.target.href); + var node = event.target; + while (node && !(node instanceof Ci.nsIDOMHTMLAnchorElement)) + node = node.parentNode; + if (node) { + content_buffer_overlink_change_hook.run(buffer, node.href); buffer.current_overlink = event.target; } }, true, false); -- David Kettler IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email.