From gzeusmants at gmail.com Sun Nov 1 12:42:36 2009 From: gzeusmants at gmail.com (gzeus) Date: Sun, 01 Nov 2009 14:42:36 -0600 Subject: [Conkeror] hints_auto_exit_delay default In-Reply-To: References: Message-ID: <87tyxekmdf.wl%gzeus@siduxthink> I think this would be a very sensible default. I'd prefer it this way, but that's beside the point. If someone doesn't want to press enter for an unambiguous match, they can turn on that feature, but if there's not a match, it won't follow, which is inconsistant. I always turn on ido in emacs, but I certainly wouldn't want it to be the default. It makes behaviours in one place different from another, creating UI inconsistencies. The current default is also very typo-sensetive. if I'm filling out a form, I don't like following the wrong link and have to start over because the webmaster did it wrong. I'd end up using the mouse alot. very frustrating. From timo.lindfors at iki.fi Tue Nov 3 04:02:58 2009 From: timo.lindfors at iki.fi (Timo Juhani Lindfors) Date: Tue, 03 Nov 2009 14:02:58 +0200 Subject: [Conkeror] openstreetmap-mode Message-ID: <84my33olxp.fsf@sauna.l.org> Hi, inspired by the googlemap-mode I wrote a mode for browsing the free maps of http://www.openstreetmap.org http://iki.fi/lindi/conkeror/openstreetmap.js 1) Later I modified it to work with any openlayers map, for example http://youloc.net/ -- should the mode now be called openlayers-mode? 2) Would it make sense to combine googlemap-mode and openlayers-mode to some common slippymap-mode? At least if somebody wants to use custom keybindings for navigating in a map he probably does not want to modify all *-map modes. 3) googlemap-mode did not have any copyright information, who should I credit for offering me such a wonderful template to improve? best regards, Timo Lindfors From jjfoerch at earthlink.net Tue Nov 3 08:42:27 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 3 Nov 2009 11:42:27 -0500 Subject: [Conkeror] breaking changes for november 3, 2009 Message-ID: <20091103164227.GA7763@hecubus> Hi all, I just merged the branch dynamic-keymaps into master. It's mainly a refactoring of runtime keymap handling. There are a couple of changes for which you may need to update your rc: * browser_prevent_automatic_form_focus_mode has been renamed and put in its own file. To use this mode, simply do this: require("block-content-focus-change.js"); * The variable browser_automatic_form_focus_window_duration was renamed to block_content_focus_change_duration. * The commands follow-current, follow-current-new-buffer, follow-current-new-buffer-background, and follow-current-new-window have been removed. Instead of binding to these commands, you can just do this: define_key(content_buffer_anchor_keymap, "d", "follow", $browser_object = browser_object_focused_element); -- John J. Foerch From jjfoerch at earthlink.net Fri Nov 6 09:06:16 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Fri, 6 Nov 2009 12:06:16 -0500 Subject: [Conkeror] hints_auto_exit_delay default In-Reply-To: <20091029181249.GA26585@hecubus> References: <20091029181249.GA26585@hecubus> Message-ID: <20091106170616.GA21841@hecubus> Hi all, I made this change today, so the new default value of hints_auto_exit_delay is now 0. To get back the old behavior, put the following in your rc: (and adjust the number to your preference) hints_auto_exit_delay = 500; You might also like to try setting an auto-exit when there is more than one possible match in the hints interaction: hints_ambiguous_auto_exit_delay = 500; Since this is a very popular feature, I think it's important to make sure that it is documented prominently so that new users know of its availability. The first thing I've done to that end is to put an example config of the most common simple settings in contrib/config/common.js, with a link on the wiki at . If anybody has any creative ideas for other ways to advertise this and other of Conkeror's cool features, let me know. -- John Foerch From jjfoerch at earthlink.net Wed Nov 11 16:09:41 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Wed, 11 Nov 2009 19:09:41 -0500 Subject: [Conkeror] casual-spelling Message-ID: <20091112000941.GA16526@hecubus> Hi all, I just committed a new module called casual-spelling in response to issue143 (http://bugs.conkeror.org/issue143). It's a pattern matcher for the hints minibuffer which lets you match unicode characters like accented letters and ligatures with normal ascii. To try it out, put the following in your rc: require("casual-spelling.js"); There's a lot of interesting potential to this kind of feature, and as a learner of Chinese, I'm formulating plans to implement a table for this mode for more efficient surfing on Chinese sites. It is also obvious that the other part of Conkeror where this would be useful is in isearch, so hopefully we can expand it to work with that some time. I expect that to require a "non-trivial" reworking of isearch, so it's not in my immediate plans to work on it. If anybody has any ideas, feedback, or problems with the new module, feel free to ask questions. -- John Foerch From kettler at internode.on.net Tue Nov 17 03:44:20 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:20 +1030 Subject: [Conkeror] [PATCH] Fix editing source from help buffer. In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-2-git-send-email-kettler@internode.on.net> This was probably broken by commit 6c90a66 (load-spec refactoring, 2009-02-03). --- modules/utils.js | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/modules/utils.js b/modules/utils.js index ff2ddd4..e2dd6d3 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -378,7 +378,8 @@ source_code_reference.prototype = { }, open_in_editor : function() { - yield open_with_external_editor(this.best_uri, $line = this.line_number); + yield open_with_external_editor(load_spec(this.best_uri), + $line = this.line_number); } }; -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:23 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:23 +1030 Subject: [Conkeror] [RFC] Let composable browser objects work with the default browser object. In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-5-git-send-email-kettler@internode.on.net> The composable browser object introduced in b1c194a (browser-object-text: new composable browser object, bound to T, 2009-11-16) failed when no explicit browser object was given. For example the keys "T c" resulted in an error. Determining the default browser object is now performed when the object is read, which allows composition with the default, so that those keys now work. --- Moving the default handling from call_interactively (as is done here) is the most straightforward fix, but perhaps doesn't respect the abstraction boundaries. The existing default handling was a little obscure; I think the order in which to choose a default goes: - I.binding_browser_object; - I.command.browser_object, only if it's a literal, not a class - I.buffer.default_browser_object_classes - I.command.browser_object The text of this patch depends on [[PATCH] Give a useful error message when no browser object type is specified], but could easily be made independent. --- modules/element.js | 11 ++++++++++- modules/interactive.js | 24 ------------------------ 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/modules/element.js b/modules/element.js index 6d24126..91a0bea 100644 --- a/modules/element.js +++ b/modules/element.js @@ -270,8 +270,17 @@ interactive("browser-object-text", }, $prefix); +function default_browser_object (I) { + return I.binding_browser_object || + (!(I.command.browser_object instanceof browser_object_class) && + I.command.browser_object) || + (I.buffer && + I.buffer.default_browser_object_classes[I.command.name]) || + I.command.browser_object; +} + function read_browser_object (I, nullok) { - var browser_object = I.browser_object; + var browser_object = I.browser_object || default_browser_object(I); var result; if (browser_object == null) { if (nullok) diff --git a/modules/interactive.js b/modules/interactive.js index f5c3dd9..52e6377 100644 --- a/modules/interactive.js +++ b/modules/interactive.js @@ -101,30 +101,6 @@ function call_interactively (I, command) { } I.command = cmd; - - - // if there was no interactive browser-object, - // binding_browser_object becomes the default. - if (I.browser_object == null) { - I.browser_object = I.binding_browser_object; - } - // if the command's default browser object is a non-null literal, - // it overrides an interactive browser-object, but not a binding - // browser object. - if (cmd.browser_object != null && - (! (cmd.browser_object instanceof browser_object_class)) && - (I.binding_browser_object == null)) - { - I.browser_object = cmd.browser_object; - } - // if we still have no browser-object, look for a page-mode - // default, or finally the command default. - if (I.browser_object == null) { - I.browser_object = - (I.buffer && I.buffer.default_browser_object_classes[command]) || - cmd.browser_object; - } - handler = cmd.handler; try { -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:19 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:19 +1030 Subject: [Conkeror] Sundry patches Message-ID: <1258458270-6371-1-git-send-email-kettler@internode.on.net> G'day all, Following is a bunch of various patches. I can push them myself, but I'm hoping for some comments (or just an okay) first). Those that I've sent before (marked with + below) are updated to run with current conkeror and have other minor updates to the patch and commentary. + Fix editing source from help buffer. * Fix command line +u * Give a useful error message when no browser object type is specified. * [RFC] Let composable browser objects work with the default browser object. + Enable URL completion for both bookmarks and history (workaround). * clock_widget: adjust display change to minute rollover + Show errors from completers, etc. + Let completion functions set the match_required state. + index-webjump: New module to define webjumps for index pages. + [RFC] index-webjump: test suite + Provide buttons on the mode-line for basic browser control. regards, David. From kettler at internode.on.net Tue Nov 17 03:44:21 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:21 +1030 Subject: [Conkeror] [PATCH] Fix command line +u In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-3-git-send-email-kettler@internode.on.net> Broken in c0c519a (new input system, 2009-10-08). --- modules/command-line.js | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/modules/command-line.js b/modules/command-line.js index 4be25b4..29cef6c 100644 --- a/modules/command-line.js +++ b/modules/command-line.js @@ -107,7 +107,7 @@ command_line_handler("u", false, function (ctx) { ctx.window = get_recent_conkeror_window(); ctx.buffer = ctx.window.buffers.current; } - call_interactively(ctx, "universal-argument"); + co_call(call_interactively(ctx, "universal-argument")); }); function handle_command_line (cmdline) { -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:24 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:24 +1030 Subject: [Conkeror] [PATCH] Enable URL completion for both bookmarks and history (workaround). In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-6-git-send-email-kettler@internode.on.net> Previously, enabling url_completion_use_bookmarks when url_completion_use_history was enabled did not provide bookmarks in the completion list. The underlying issue is that QUERY_TYPE_UNIFIED is not implemented in xulrunner. This commit works around the problem by issuing two separate queries. That will lead to duplicates if the URL appears in both bookmarks and history, but I don't think that's an important issue. --- modules/history.js | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/history.js b/modules/history.js index d7a6ace..2aa243d 100644 --- a/modules/history.js +++ b/modules/history.js @@ -51,10 +51,12 @@ function url_completer() { if(use_webjumps) { completers.push(webjump_completer()); } - if(use_history || use_bookmarks) { - completers.push(history_completer($use_history = use_history, - $use_bookmarks = use_bookmarks)); - } + /* Do queries separately (which can lead to duplicates). The + * queries can be combined when QUERY_TYPE_UNIFIED is implemented. */ + if (use_bookmarks) + completers.push(history_completer($use_bookmarks = true)); + if (use_history) + completers.push(history_completer($use_history = true)); return merge_completers(completers); } -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:22 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:22 +1030 Subject: [Conkeror] [PATCH] Give a useful error message when no browser object type is specified. In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-4-git-send-email-kettler@internode.on.net> For most commands it is an error if no object type is specified and there is no default (although that is an unusual situation). For example, previously the keys "T c" gave an obscure error message (TypeError: e is undefined). Now the error message is clear for this and other similar situations. There are two callers of read_browser_object that work with a null browser object; these now specify a nullok flag. --- modules/content-buffer.js | 2 +- modules/element.js | 8 +++++++- modules/scroll.js | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/content-buffer.js b/modules/content-buffer.js index 0f8b86e..9667640 100644 --- a/modules/content-buffer.js +++ b/modules/content-buffer.js @@ -559,7 +559,7 @@ interactive("reload", "reloaded.", function (I) { check_buffer(I.buffer, content_buffer); - var element = yield read_browser_object(I); + var element = yield read_browser_object(I, true); reload(I.buffer, I.P, element, I.forced_charset); }); diff --git a/modules/element.js b/modules/element.js index 576cfff..6d24126 100644 --- a/modules/element.js +++ b/modules/element.js @@ -270,9 +270,15 @@ interactive("browser-object-text", }, $prefix); -function read_browser_object (I) { +function read_browser_object (I, nullok) { var browser_object = I.browser_object; var result; + if (browser_object == null) { + if (nullok) + yield co_return(null); + else + throw interactive_error("No browser object type specified."); + } // literals cannot be overridden if (browser_object instanceof Function) { result = yield browser_object(I); diff --git a/modules/scroll.js b/modules/scroll.js index b0dd0e5..4ad7bdd 100644 --- a/modules/scroll.js +++ b/modules/scroll.js @@ -77,7 +77,7 @@ define_browser_object_class("previous-heading", null, function scroll (I) { - var element = yield read_browser_object(I); + var element = yield read_browser_object(I, true); // no scrolling and no error if we failed to get an object. if (! element) return; -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:25 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:25 +1030 Subject: [Conkeror] [PATCH] clock_widget: adjust display change to minute rollover In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-7-git-send-email-kettler@internode.on.net> Previously the clock display could be up to one minute late. Now the update time is synchronised to occur within one tenth of a second after the minute changes. --- modules/mode-line.js | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/modules/mode-line.js b/modules/mode-line.js index 28b42fa..7c04d7b 100644 --- a/modules/mode-line.js +++ b/modules/mode-line.js @@ -180,7 +180,10 @@ function clock_widget(window) this.class_name = "clock-widget"; text_widget.call(this, window); var obj = this; - this.timer_ID = window.setInterval(function () { obj.update(); }, 60000); + this.do_update = function () { obj.update(); }; + // todo: use one timer for multiple clock widgets + this.timer_ID = window.setTimeout(this.do_update, 0); + this.timer_timeout = true; } clock_widget.prototype.__proto__ = text_widget.prototype; clock_widget.prototype.update = function () { @@ -188,6 +191,17 @@ clock_widget.prototype.update = function () { var hours = time.getHours(); var mins = time.getMinutes(); this.view.text = (hours<10 ? "0" + hours:hours) + ":" + (mins<10 ?"0" +mins:mins); + if (time.getSeconds() > 0 || time.getMilliseconds() > 100) { + this.window.clearTimeout(this.timer_ID); + var time = time.getSeconds() * 1000 + time.getMilliseconds(); + time = 60000 - time; + this.timer_ID = this.window.setTimeout(this.do_update, time); + this.timer_timeout = true; + } else if (this.timer_timeout) { + this.window.clearTimeout(this.timer_ID); + this.timer_ID = this.window.setInterval(this.do_update, 60000); + this.timer_timeout = false; + } }; clock_widget.prototype.destroy = function () { this.window.clearTimeout(this.timer_ID); -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:29 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:29 +1030 Subject: [Conkeror] [RFC] index-webjump: test suite In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-11-git-send-email-kettler@internode.on.net> This depends on [[PATCH] index-webjump: New module to define webjumps for index pages]. The test is partially broken; it makes use of conkeror_source_code_path to find auxiliary test files, which fails when that variable is undefined. For command line use ctx.local.cwd would work, but the test suite doesn't have access to the context. --- tests/simple/gitweb-webjump-test.opml | 12 +++++++++ tests/simple/index-webjump.js | 45 +++++++++++++++++++++++++++++++++ tests/simple/xpath-webjump-test.xhtml | 12 +++++++++ 3 files changed, 69 insertions(+), 0 deletions(-) create mode 100644 tests/simple/gitweb-webjump-test.opml create mode 100644 tests/simple/index-webjump.js create mode 100644 tests/simple/xpath-webjump-test.xhtml diff --git a/tests/simple/gitweb-webjump-test.opml b/tests/simple/gitweb-webjump-test.opml new file mode 100644 index 0000000..661eefc --- /dev/null +++ b/tests/simple/gitweb-webjump-test.opml @@ -0,0 +1,12 @@ + + + + foobar repositories OPML Export + + + + + + + + diff --git a/tests/simple/index-webjump.js b/tests/simple/index-webjump.js new file mode 100644 index 0000000..cd36104 --- /dev/null +++ b/tests/simple/index-webjump.js @@ -0,0 +1,45 @@ +require('walnut.js'); +require('index-webjump.js'); + +{ let suite = { + suite_setup: function () { + this.real_webjumps = webjumps; + this.real_index_webjumps = index_webjumps; + conkeror.webjumps = {}; + conkeror.index_webjumps = {}; + }, + suite_teardown: function () { + conkeror.webjumps = this.real_webjumps; + conkeror.index_webjumps = this.real_index_webjumps; + }, + path: conkeror_source_code_path + "/tests/simple", + test_xpath_webjump: function () { + define_xpath_webjump( + "xpath", "http://dummy/xpath", '//xhtml:a[@class="index"]', + $index_file = this.path + '/xpath-webjump-test.xhtml'); + assert_equals(get_webjump("xpath foo"), "foo"); + var w = index_webjumps.xpath; + w.extract_completions(); + assert_equals(w.completions.length, 2); + assert_equals(w.completions[0][1], "The bar"); + assert_equals(w.completions[0][0], "http://dummy/xpath/bar"); + assert_equals(w.completions[1][1], "The foo"); + assert_equals(w.completions[1][0], "http://dummy/foo"); + }, + test_gitweb_webjump: function() { + define_gitweb_summary_webjump( + "gitweb", "http://dummy/gitweb", $default = "bar", + $opml_file = this.path + '/gitweb-webjump-test.opml'); + assert_equals(get_webjump("gitweb"), + "http://dummy/gitweb/gitweb.cgi?p=bar.git;a=summary"); + assert_equals(get_webjump("gitweb foo"), + "http://dummy/gitweb/gitweb.cgi?p=foo.git;a=summary"); + var w = index_webjumps.gitweb; + w.extract_completions(); + assert_equals(w.completions.length, 2); + assert_equals(w.completions[0][0], "bar"); + assert_equals(w.completions[1][0], "foo"); + }, + }; + walnut_run(suite); +} diff --git a/tests/simple/xpath-webjump-test.xhtml b/tests/simple/xpath-webjump-test.xhtml new file mode 100644 index 0000000..89e1d0b --- /dev/null +++ b/tests/simple/xpath-webjump-test.xhtml @@ -0,0 +1,12 @@ + + + +Dummy + + +The foo +The bar +The baz + + -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:27 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:27 +1030 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-9-git-send-email-kettler@internode.on.net> Currently the match_required state is set at the beginning when input is being read. This commit allows completers to change that state during the input. In particular, this can be used to allow a webjump with a limited set of valid inputs to prevent invalid inputs from being accepted. For example, the following webjump can now be defined and will only allow valid bookmarks to be chosen. Without $match_required, the webjump will try to visit any arbitrary input, which is confusing and not useful. /* Access bookmarks via completion from a webjump. */ define_webjump("bookmark", function(term) {return term;}, $completer = history_completer($use_history = false, $use_bookmarks = true, $match_required = true)); Another example is in the upcoming index webjump feature. --- Note: In merge_completers I think the destroy function needs something like call_all('destroy'), rather than forward(). --- modules/history.js | 7 +++++-- modules/minibuffer-completion.js | 17 +++++++++++++++-- modules/minibuffer-read.js | 6 ++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/modules/history.js b/modules/history.js index 2aa243d..953f379 100644 --- a/modules/history.js +++ b/modules/history.js @@ -9,11 +9,13 @@ const nav_history_service = Cc["@mozilla.org/browser/nav-history-service;1"] .getService(Ci.nsINavHistoryService); -define_keywords("$use_webjumps", "$use_history", "$use_bookmarks"); +define_keywords("$use_webjumps", "$use_history", "$use_bookmarks", + "$match_required"); function history_completer () { keywords(arguments); var use_history = arguments.$use_history; var use_bookmarks = arguments.$use_bookmarks; + let match_required = arguments.$match_required; return function (input, pos, conservative) { if (conservative && input.length == 0) return null; @@ -36,7 +38,8 @@ function history_completer () { get_string: function (i) root.getChild(i).uri, get_description: function (i) root.getChild(i).title, get_input_state: function (i) [root.getChild(i).uri], - destroy: function () { root.containerOpen = false; } + destroy: function () { root.containerOpen = false; }, + get_match_required: function() match_required }; } } diff --git a/modules/minibuffer-completion.js b/modules/minibuffer-completion.js index 5436f7b..e221bc4 100644 --- a/modules/minibuffer-completion.js +++ b/modules/minibuffer-completion.js @@ -268,7 +268,7 @@ function merge_completers (completers) { var count = 0; for (let i = 0; i < completers.length; ++i) { let r = yield completers[i](input, pos, conservative); - if (r != null && r.count > 0) { + if (r != null && (r.count > 0 || "get_match_required" in r)) { results.push(r); count += r.count; } @@ -290,11 +290,24 @@ function merge_completers (completers) { return null; } } + function combine_or(name) { + return function() { + var b = false; + for (var j=0; j < results.length; j++) { + var r = results[j]; + if (name in r && r[name] != null) { + b = b || r[name].apply(this, arguments); + } + } + return b; + } + } yield co_return({count: count, get_string: forward('get_string'), get_description: forward('get_description'), get_input_state: forward('get_input_state'), - destroy: forward('destroy') + destroy: forward('destroy'), + get_match_required: combine_or('get_match_required') }); }; } diff --git a/modules/minibuffer-read.js b/modules/minibuffer-read.js index bdcf139..6d96cb4 100644 --- a/modules/minibuffer-read.js +++ b/modules/minibuffer-read.js @@ -80,6 +80,7 @@ function text_entry_minibuffer_state (window, continuation) { this.completions_display_element = null; this.selected_completion_index = -1; this.match_required = !!arguments.$match_required; + this.match_required_default = this.match_required; if (this.match_required) this.default_completion = arguments.$default_completion; } @@ -297,6 +298,11 @@ text_entry_minibuffer_state.prototype = { this.completions_valid = true; this.applied_common_prefix = false; + if (c && ("get_match_required" in c)) + this.match_required = c.get_match_required(); + if (this.match_required == null) + this.match_required = this.match_required_default; + let i = -1; if (c && c.count > 0) { if (this.match_required) { -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:30 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:30 +1030 Subject: [Conkeror] [PATCH] Provide buttons on the mode-line for basic browser control. In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-12-git-send-email-kettler@internode.on.net> Simple GUI buttons are provided for controlling conkeror. They are intended to be unobtrusive and to steal as little screen space as possible. Clicking on them executes a conkeror command. Hovering over them tells you the command and the corresponding keystroke. The buttons are intended to make conkeror usable for a casual user and also to aid the novice user while they become familiar with conkeror's interface. They can be enabled with: require("mode-line-buttons.js"); add_mode_line_buttons(standard_mode_line_buttons, true); --- Problems: - The icons used do not clearly indicate their function. - The names of the commands are also probably unclear for novices. - There are probably too many buttons. It might be better to have just a few, together with a popup menu. --- modules/mode-line-buttons.js | 88 ++++++++++++++++++++++++++++++++++++++++++ modules/mode-line.js | 3 + 2 files changed, 91 insertions(+), 0 deletions(-) create mode 100644 modules/mode-line-buttons.js diff --git a/modules/mode-line-buttons.js b/modules/mode-line-buttons.js new file mode 100644 index 0000000..82ee4e9 --- /dev/null +++ b/modules/mode-line-buttons.js @@ -0,0 +1,88 @@ +/** + * (C) Copyright 2009 David Kettler + * + * Use, modification, and distribution are subject to the terms specified in the + * COPYING file. +**/ + +require("mode-line.js"); + +function button_widget(window) { + this.class_name = "button-widget"; + text_widget.call(this, window); +} +button_widget.prototype = { + __proto__ : text_widget.prototype, + + make_element : function (window) { + var command = this.command; + var element = create_XUL(window, "image"); + + element.addEventListener("click", function (event) { + var I = new interactive_context(window.buffers.current); + co_call(call_interactively(I, command)); + }, false); + + element.addEventListener("mouseover", function (event) { + var msg = "Button: " + command; + var keymaps = get_current_keymaps(window); + var list = keymap_lookup_command(keymaps, command); + if (list.length) + msg += " (which is on key " + list.join(", ") + ")"; + window.minibuffer.show(msg); + }, false); + + element.addEventListener("mouseout", function (event) { + window.minibuffer.show(""); + }, false); + + element.setAttribute("id", "button-widget-" + command); + element.setAttribute("class", this.class_name); + for (var a in this.attributes) { + element.setAttribute(a, this.attributes[a]); + } + + return element; + } +}; + +function make_button_widget(command, attributes) { + if (typeof(attributes) == "string") + // Simple case + attributes = {src: "moz-icon://stock/gtk-" + attributes}; + + function new_widget(window) { + button_widget.call(this, window); + } + new_widget.prototype = { + __proto__ : button_widget.prototype, + command : command, + attributes : attributes + } + new_widget.mode_line_adder = function (window) { + var widget = new new_widget(window); + window.mode_line.add_widget(widget, widget.make_element(window)); + } + + return new_widget; +} + +function mode_line_add_buttons(buttons, prepend) { + for (var i = 0; i < buttons.length; i++) { + var j = prepend ? buttons.length - i - 1 : i; + var w = make_button_widget(buttons[j][0], buttons[j][1]); + add_hook("mode_line_hook", mode_line_adder(w), prepend); + } +} + +standard_mode_line_buttons = [ + ["find-url", "open"], + ["find-url-new-buffer", "new"], + ["back", "go-back"], + ["forward", "go-forward"], + ["reload", "refresh"], + ["kill-current-buffer", "close"], + ["buffer-previous", "go-up"], + ["buffer-next", "go-down"], + ["help-page", "help"], +]; diff --git a/modules/mode-line.js b/modules/mode-line.js index 7c04d7b..53e607a 100644 --- a/modules/mode-line.js +++ b/modules/mode-line.js @@ -33,6 +33,9 @@ generic_element_widget_container.prototype = { element.setAttribute("class", class_name); if (crop) element.setAttribute("crop", crop); + return this.add_widget(widget, element); + }, + add_widget : function (widget, element) { element.conkeror_widget = new generic_widget_element(element, widget); this.container.appendChild(element); return element.conkeror_widget; -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:26 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:26 +1030 Subject: [Conkeror] [PATCH] Show errors from completers, etc. In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-8-git-send-email-kettler@internode.on.net> If an interactive_error was thrown in a minibuffer completer function, the error was previously lost. For complicated completers, for instance when completions are dynamically loaded from a file, it is useful for the user to see any error messages. This commit ensures that the error message is displayed briefly in the minibuffer. The user can continue with typing in the minibuffer as usual. The problem arises because direct uses of co_call do not propagate exceptions. The same fix is applied to the two other places in conkeror that could lose an error message. One other place, in download_helper.handle_show, already handled the problem in the same way. --- An alternative fix would be to provide an interactive_co_call to do the wrappering. The last time I submitted this, Jeremy commented that he had "specifically intended that an exception being thrown would just result in no completions being generated." This patch displays an error, but does not change the user interaction; no completions are generated and the user is still in the minibuffer read. http://thread.gmane.org/gmane.comp.mozilla.conkeror/1522/focus=1524 --- modules/download-manager.js | 2 ++ modules/help.js | 8 +++++++- modules/minibuffer-read.js | 2 ++ 3 files changed, 11 insertions(+), 1 deletions(-) diff --git a/modules/download-manager.js b/modules/download-manager.js index 367277f..7e8dceb 100644 --- a/modules/download-manager.js +++ b/modules/download-manager.js @@ -318,6 +318,8 @@ var download_progress_listener = { yield shell_command_with_argument(info.shell_command, info.target_file.path, $cwd = info.shell_command_cwd); + } catch (e) { + handle_interactive_error(info.source_buffer.window, e); } finally { if (info.temporary_status == DOWNLOAD_TEMPORARY_FOR_COMMAND) if(delete_temporary_files_for_command) { diff --git a/modules/help.js b/modules/help.js index be15720..cd231ef 100644 --- a/modules/help.js +++ b/modules/help.js @@ -44,12 +44,18 @@ help_document_generator.prototype = { source_code_reference : function (ref, parent) { var f = this.document.createDocumentFragment(); var module_name = ref.module_name; + var buffer = this.buffer; //f.appendChild(this.text(module_name != null ? "module " : "file ")); var x = this.element("a", "class", "source-code-reference", "href", "javascript:"); x.addEventListener("click", function (event) { - co_call(ref.open_in_editor()); + co_call(function () { + try { + yield ref.open_in_editor(); + } catch (e) { + handle_interactive_error(buffer.window, e); + }}()); event.preventDefault(); event.stopPropagation(); }, false /* capture */); diff --git a/modules/minibuffer-read.js b/modules/minibuffer-read.js index 1849f70..bdcf139 100644 --- a/modules/minibuffer-read.js +++ b/modules/minibuffer-read.js @@ -268,6 +268,8 @@ text_entry_minibuffer_state.prototype = { var x; try { x = yield c; + } catch (e) { + handle_interactive_error(m.window, e); } finally { s.completions_cont = null; already_done = true; -- 1.6.5 From kettler at internode.on.net Tue Nov 17 03:44:28 2009 From: kettler at internode.on.net (David Kettler) Date: Tue, 17 Nov 2009 22:14:28 +1030 Subject: [Conkeror] [PATCH] index-webjump: New module to define webjumps for index pages. In-Reply-To: <1258458270-6371-1-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> Message-ID: <1258458270-6371-10-git-send-email-kettler@internode.on.net> Index webjumps provide convenient access, with completion, to a set of web pages that are indexed (referenced) from another page. For instance, webjumps for documentation (e.g., git, ImageMagick) are easy to define. A webjump to access URLs referenced from an index page is defined using define_xpath_webjump. An xpath expression is used to extract the indexed URLs and the anchor text; this provides completion for the webjump. The completion must be enabled using webjump-get-index once for each index webjump. This module also subsumes define_gitweb_summary_webjump, which results in changes to how gitweb webjumps are set up. --- This patch only shows the new index-webjumps.js module. The eventual commit will also remove the existing gitweb-webjumps.js module. This makes use of functionality provided by [[PATCH] Let completion functions set the match_required state], but that is not vital. It's also helped by [[PATCH] Show errors from completers, etc]. Conkeror wiki pages will also be updated as follows. = Writing Webjumps = == Index webjumps == Index webjumps provide convenient access to a set of web pages that are indexed (referenced) from another page. Two kinds are provided; xpath webjumps and gitweb summary webjumps. Completions can be provided for the webjump by saving a copy of the index page to `index_webjumps_directory`, which can be set as follows. {{{ require("index-webjump.js"); index_webjumps_directory = get_home_directory(); index_webjumps_directory.appendRelativePath(".conkerorrc/index-webjumps"); }}} For each defined index webjump the index page can be saved using `M-x webjump-get-index`. === Gitweb summary webjumps === These webjumps help you visit repositories at a gitweb server: {{{ define_gitweb_summary_webjump("gitweb-ko", "http://git.kernel.org"); define_gitweb_summary_webjump("gitweb-cz", "http://repo.or.cz/w"); }}} You can now use the following webjumps: {{{ gitweb-cz conkeror gitweb-ko git/git }}} To make completions available use `M-x webjump-get-index` and select `gitweb-cz` then, once the download is finished, completions will be available for that webjump. Sites with many repositories (such as the two given) can take many minutes to return the OPML data. When defining the webjump, a default repository at the gitweb server can be specified using the `$default` keyword. An `$alternative` may otherwise be given as usual. If neither are given then the alternative url for the webjump is defined to be the gitweb repository list page. === XPath webjumps === An xpath webjump extracts the set of referenced web pages from an index page using an [[http://www.w3.org/TR/xpath|XPath]] expression. For these webjumps to work, the index must be downloaded using `M-x webjump-get-index`. Unfortunately, the xulrunner parser that is used is quite fussy and, in particular, is an xml parser. Many web pages fail to parse correctly. To correct this problem the downloaded index page is automatically cleaned up using `index_xpath_webjump_tidy_command`. The html [[http://tidy.sourceforge.net|tidy]] program should be installed for this to work. It can take a few attempts to figure out an appropriate XPath expression; `index_webjump_try_xpath` is provided to help with that process. Examples: {{{ define_xpath_webjump( "gitdoc", "http://www.kernel.org/pub/software/scm/git/docs/", '//xhtml:dt/xhtml:a', $description = "Git documentation"); }}} The following examples require the html tidy program to be installed. {{{ define_xpath_webjump( "conkerorwiki-page", "http://conkeror.org/", '//xhtml:li/xhtml:p/xhtml:a[starts-with(@href,"/")]', $description = "Conkeror wiki pages linked from the front page"); define_xpath_webjump( "imagemagick-options", "http://imagemagick.org/script/command-line-options.php", '//xhtml:p[@class="navigation-index"]/xhtml:a', $description = "Imagemagick command line options"); }}} = BreakingChanges = Gitweb summary webjumps are now implemented as index webjumps. The `webjump-get-index` command and `index_webjumps_directory` variable are used rather than the previous gitweb equivalents. Existing gitweb opml files can be moved to the new locations using something like: {{{ cd ~/.conkerorrc mkdir index-webjumps for f in gitweb-webjumps-opml/*.opml; do mv $f index-webjumps/$(basename $f .opml).index done rmdir gitweb-webjumps-opml }}} The `$completer` option is no longer available. = User Variables = index_webjumps_directory:: :: A directory for storing the index files corresponding to index webjumps; the index data can be downloaded from the index URL using `webjump-get-index`. If the index file is available for an index webjump then the webjump will provide completions for the indexed URLs. index_xpath_webjump_tidy_command:: :: A command to run on the downloaded index. The xulrunner parser is quite fussy and specifically requires xhtml (or other xml). Running something like html tidy can avoid parser problems. --- modules/gitweb-webjump.js | 175 ------------------------- modules/index-webjump.js | 312 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 312 insertions(+), 175 deletions(-) delete mode 100644 modules/gitweb-webjump.js create mode 100644 modules/index-webjump.js diff --git a/modules/index-webjump.js b/modules/index-webjump.js new file mode 100644 index 0000000..16d1a49 --- /dev/null +++ b/modules/index-webjump.js @@ -0,0 +1,312 @@ +/** + * (C) Copyright 2009 David Kettler + * + * Use, modification, and distribution are subject to the terms specified in the + * COPYING file. + * + * Construct a webjump (with completer) to visit URLs referenced from + * an index page. An xpath expression is used to extract the indexed + * URLs. A specialized form is also provided for gitweb summary + * pages. +**/ + +require("webjump.js"); + +/* Objects with completion data for index webjumps. */ +index_webjumps = {}; + +define_variable("index_webjumps_directory", null, + "A directory for storing the index files corresponding to " + + "index webjumps; the index data can be downloaded from the " + + "index URL using webjump-get-index. " + + "If the index file is available for an index webjump then " + + "the webjump will provide completions for the indexed URLs."); + +define_variable("index_xpath_webjump_tidy_command", + "tidy -asxhtml -wrap 0 -modify -quiet --show-warnings no", + "A command to run on the downloaded index. The xulrunner " + + "parser is quite fussy and specifically requires xhtml (or " + + "other xml). Running something like html tidy can avoid " + + "parser problems."); + +function index_webjump(key, url, file) { + this.key = key; + this.url = url; + this.file = this.canonicalize_file(file); + + if (this.require_completions && !this.file) + throw interactive_error("Index file not defined for " + this.key); +} +index_webjump.prototype = { + constructor : index_webjump, + + mime_type : null, + xpath_expr : null, + make_completion : null, + require_completions : false, + completions : null, + file_time : 0, + tidy_command : null, + + /* Extract full completion list from index file. */ + extract_completions : function () { + /* Parse the index file. */ + var stream = Cc["@mozilla.org/network/file-input-stream;1"] + .createInstance(Ci.nsIFileInputStream); + stream.init(this.file, MODE_RDONLY, 0644, false); + var parser = Cc["@mozilla.org/xmlextras/domparser;1"] + .createInstance(Ci.nsIDOMParser); + var doc = parser.parseFromStream(stream, null, + this.file.fileSize, this.mime_type); + + /* Extract the completion items. */ + var cmpl = [], node, res; + res = doc.evaluate( + this.xpath_expr, doc, xpath_lookup_namespace, + Ci.nsIDOMXPathResult.UNORDERED_NODE_ITERATOR_TYPE, null); + while ((node = res.iterateNext())) + cmpl.push(this.make_completion(node)); + + cmpl.sort(function(a, b) { + if (a[1] < b[1]) return -1; + if (a[1] > b[1]) return 1; + if (a[0] < b[0]) return -1; + if (a[0] > b[0]) return 1; + return 0; + }); + + this.completions = cmpl; + }, + + /* The guts of the completer. */ + internal_completer : function (input, pos, conservative) { + if (pos == 0 && conservative) + yield co_return(undefined); + + let require = this.require_completions; + + /* Update full completion list if necessary. */ + if (require && !this.file.exists()) + throw interactive_error("Index file missing for " + this.key); + if (this.file.exists() && + this.file.lastModifiedTime > this.file_time) { + this.file_time = this.file.lastModifiedTime; + this.extract_completions(); + } + if (require && !this.completions) + throw interactive_error("No completions for " + this.key); + if (!this.completions) + yield co_return(null); + + /* Match completions against input. */ + let words = trim_whitespace(input.toLowerCase()).split(/\s+/); + let data = this.completions.filter(function (x) { + for (var i = 0; i < words.length; ++i) + if (x[0].toLowerCase().indexOf(words[i]) == -1 && + x[1].toLowerCase().indexOf(words[i]) == -1) + return false; + return true; + }); + + let c = { count: data.length, + get_string: function (i) data[i][0], + get_description: function (i) data[i][1], + get_input_state: function (i) [data[i][0]], + get_match_required: function() require + }; + yield co_return(c); + }, + + /* A completer suitable for supplying to define_webjump. */ + make_completer : function() { + if (!this.file) + return null; + let jmp = this; + return function (input, pos, conservative) { + return jmp.internal_completer(input, pos, conservative); + }; + }, + + /* Fetch and save the index for later use with completion. + * (buffer is used only to associate with the download) */ + get_index : function (buffer) { + if (!this.file) + throw interactive_error("Index file not defined for " + this.key); + + var cwd = null; + if (index_webjumps_directory instanceof Ci.nsILocalFile) + cwd = index_webjumps_directory.path; + else if (index_webjumps_directory) + cwd = index_webjumps_directory; + + var info = save_uri(load_spec(this.url), this.file, + $buffer = buffer, $use_cache = false, + $temp_file = true); + + // Note: it would be better to run this before the temp file + // is renamed; that requires support in save_uri. + if (this.tidy_command) + info.set_shell_command(this.tidy_command, cwd); + }, + + /* Try to make a suitable file object when the supplied file is a + * string or null. */ + canonicalize_file : function (file) { + if (typeof file == 'string') + file = make_file(file); + if (!file && index_webjumps_directory) { + file = Cc["@mozilla.org/file/local;1"] + .createInstance(Ci.nsILocalFile); + if (index_webjumps_directory instanceof Ci.nsILocalFile) + file.initWithFile(index_webjumps_directory); + else + file.initWithPath(index_webjumps_directory); + file.appendRelativePath(this.key + ".index"); + } + return file; + } +} + + +function index_webjump_xhtml(key, url, file, xpath_expr) { + index_webjump.call(this, key, url, file); + this.xpath_expr = xpath_expr; +} +index_webjump_xhtml.prototype = { + constructor : index_webjump_xhtml, + + require_completions : true, + mime_type : "application/xhtml+xml", + tidy_command : index_xpath_webjump_tidy_command, + + make_completion : function (node) { + return [makeURLAbsolute(this.url, node.href), node.text]; + }, + + __proto__ : index_webjump.prototype +} + + +function index_webjump_gitweb(key, url, file) { + index_webjump.call(this, key, url, file); +} +index_webjump_gitweb.prototype = { + constructor : index_webjump_gitweb, + + mime_type : "text/xml", + xpath_expr : '//outline[@type="rss"]', + + make_completion : function (node) { + var name = node.getAttribute("text"); + return [name.replace(/\.git$/, ""), ""]; + }, + + __proto__ : index_webjump.prototype +} + + +interactive("webjump-get-index", + "Fetch and save the index URL corresponding to an index " + + "webjump. It will then be available to the completer.", + function (I) { + var completions = []; + for (let i in index_webjumps) + completions.push(i); + completions.sort(); + + var key = yield I.minibuffer.read( + $prompt = "Fetch index for index webjump:", + $history = "webjump", + $completer = + all_word_completer($completions = completions), + $match_required = true); + + var jmp = index_webjumps[key]; + if (jmp) + jmp.get_index(I.buffer); + }); + +/** + * Construct a webjump to visit URLs referenced from an index page. + * + * The index page must be able to be parsed as xhtml. The anchor + * nodes indexed are those that match the given xpath_expr. Don't + * forget to use xhtml: prefixes on the xpath steps. + * + * If an alternative is not specified then it is set to the index page. + * + * A completer is provided that uses the index page. A local file for + * the index must be specified either with $index_file or via + * index_webjumps_directory. The index must be manually downloaded; + * eg. using webjump-get-index. Each time the completer is used it + * will check if the file has been updated and reload if necessary. + * This kind of webjump is not useful without the completions. + */ +define_keywords("$alternative", "$index_file", "$description"); +function define_xpath_webjump(key, index_url, xpath_expr) { + keywords(arguments); + let alternative = arguments.$alternative || index_url; + + var jmp = new index_webjump_xhtml(key, index_url, arguments.$index_file, + xpath_expr); + index_webjumps[key] = jmp; + + define_webjump(key, function (term) {return term;}, + $completer = jmp.make_completer(), + $alternative = alternative, + $description = arguments.$description); +} + +/** + * Modify the xpath for an index webjump and show the resulting + * completions. Useful for figuring out an appropriate xpath. Either + * run using mozrepl or eval in the browser with the dump parameter + * set. + */ +function index_webjump_try_xpath(key, xpath_expr, dump) { + jmp = index_webjumps[key]; + if (xpath_expr) + jmp.xpath_expr = xpath_expr; + jmp.extract_completions(); + if (dump) + dumpln(dump_obj(jmp.completions, + "Completions for index webjump " + key)); + return jmp.completions; +} + + +/** + * Construct a webjump to visit repository summary pages at a gitweb + * server. + * + * If a repository name is supplied as $default then the alternative + * url is set to that repository at the gitweb site. If an + * alternative is not specified by either $default or $alternative + * then it is set to the repository list page of the gitweb site. + * + * A completer is provided that uses the list of repositories from the + * OPML data on the gitweb server. The completer is setup in the same + * way as for define_xpath_webjump, but the webjump will work without + * the completions. + */ +define_keywords("$default", "$alternative", "$opml_file", "$description"); +function define_gitweb_summary_webjump(key, base_url) { + keywords(arguments); + let alternative = arguments.$alternative; + let gitweb_url = base_url + "/gitweb.cgi"; + let summary_url = gitweb_url + "?p=%s.git;a=summary"; + let opml_url = gitweb_url + "?a=opml"; + + if (arguments.$default) + alternative = summary_url.replace("%s", arguments.$default); + if (!alternative) + alternative = gitweb_url; + + var jmp = new index_webjump_gitweb(key, opml_url, arguments.$opml_file); + index_webjumps[key] = jmp; + + define_webjump(key, summary_url, + $completer = jmp.make_completer(), + $alternative = alternative, + $description = arguments.$description); +} -- 1.6.5 From jjfoerch at earthlink.net Tue Nov 17 08:23:49 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 11:23:49 -0500 Subject: [Conkeror] [PATCH] Fix editing source from help buffer. In-Reply-To: <1258458270-6371-2-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-2-git-send-email-kettler@internode.on.net> Message-ID: <20091117162349.GA20160@hecubus> On Tue, Nov 17, 2009 at 10:14:20PM +1030, David Kettler wrote: > This was probably broken by commit 6c90a66 (load-spec refactoring, 2009-02-03). Good.. -- John Foerch From jjfoerch at earthlink.net Tue Nov 17 08:24:47 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 11:24:47 -0500 Subject: [Conkeror] [PATCH] Fix command line +u In-Reply-To: <1258458270-6371-3-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-3-git-send-email-kettler@internode.on.net> Message-ID: <20091117162447.GB20160@hecubus> On Tue, Nov 17, 2009 at 10:14:21PM +1030, David Kettler wrote: > Broken in c0c519a (new input system, 2009-10-08). Good.. -- John Foerch From jjfoerch at earthlink.net Tue Nov 17 08:28:43 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 11:28:43 -0500 Subject: [Conkeror] [RFC] Let composable browser objects work with the default browser object. In-Reply-To: <1258458270-6371-5-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-5-git-send-email-kettler@internode.on.net> Message-ID: <20091117162843.GC20160@hecubus> On Tue, Nov 17, 2009 at 10:14:23PM +1030, David Kettler wrote: > The composable browser object introduced in b1c194a > (browser-object-text: new composable browser object, bound to T, > 2009-11-16) failed when no explicit browser object was given. For > example the keys "T c" resulted in an error. > > Determining the default browser object is now performed when the > object is read, which allows composition with the default, so that > those keys now work. > --- > > Moving the default handling from call_interactively (as is done here) > is the most straightforward fix, but perhaps doesn't respect the > abstraction boundaries. > > The existing default handling was a little obscure; I think the order > in which to choose a default goes: > > - I.binding_browser_object; > - I.command.browser_object, only if it's a literal, not a class > - I.buffer.default_browser_object_classes > - I.command.browser_object > > The text of this patch depends on [[PATCH] Give a useful error message > when no browser object type is specified], but could easily be made > independent. I was thinking along the same lines, but I'm going to take some time to think this through. -- John Foerch From jjfoerch at earthlink.net Tue Nov 17 08:31:03 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 11:31:03 -0500 Subject: [Conkeror] [PATCH] Enable URL completion for both bookmarks and history (workaround). In-Reply-To: <1258458270-6371-6-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-6-git-send-email-kettler@internode.on.net> Message-ID: <20091117163103.GD20160@hecubus> On Tue, Nov 17, 2009 at 10:14:24PM +1030, David Kettler wrote: > Previously, enabling url_completion_use_bookmarks when > url_completion_use_history was enabled did not provide bookmarks in > the completion list. The underlying issue is that QUERY_TYPE_UNIFIED > is not implemented in xulrunner. > > This commit works around the problem by issuing two separate queries. > That will lead to duplicates if the URL appears in both bookmarks and > history, but I don't think that's an important issue. Is there a way to filter the duplicates out? -- John Foerch From jjfoerch at earthlink.net Tue Nov 17 08:32:11 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 11:32:11 -0500 Subject: [Conkeror] [PATCH] clock_widget: adjust display change to minute rollover In-Reply-To: <1258458270-6371-7-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-7-git-send-email-kettler@internode.on.net> Message-ID: <20091117163211.GE20160@hecubus> On Tue, Nov 17, 2009 at 10:14:25PM +1030, David Kettler wrote: > Previously the clock display could be up to one minute late. Now the > update time is synchronised to occur within one tenth of a second > after the minute changes. Okay -- John Foerch From jjfoerch at earthlink.net Tue Nov 17 08:35:18 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 11:35:18 -0500 Subject: [Conkeror] [PATCH] Show errors from completers, etc. In-Reply-To: <1258458270-6371-8-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-8-git-send-email-kettler@internode.on.net> Message-ID: <20091117163518.GF20160@hecubus> On Tue, Nov 17, 2009 at 10:14:26PM +1030, David Kettler wrote: > If an interactive_error was thrown in a minibuffer completer function, > the error was previously lost. For complicated completers, for > instance when completions are dynamically loaded from a file, it is > useful for the user to see any error messages. This commit ensures > that the error message is displayed briefly in the minibuffer. The > user can continue with typing in the minibuffer as usual. > > The problem arises because direct uses of co_call do not propagate > exceptions. The same fix is applied to the two other places in > conkeror that could lose an error message. One other place, in > download_helper.handle_show, already handled the problem in the same > way. > --- > > An alternative fix would be to provide an interactive_co_call to do > the wrappering. > > The last time I submitted this, Jeremy commented that he had > "specifically intended that an exception being thrown would just > result in no completions being generated." This patch displays an > error, but does not change the user interaction; no completions are > generated and the user is still in the minibuffer read. > > http://thread.gmane.org/gmane.comp.mozilla.conkeror/1522/focus=1524 Can you tell me steps to reproduce the problem, to help me understand the situation being addressed here? -- John Foerch From jjfoerch at earthlink.net Tue Nov 17 08:38:52 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 11:38:52 -0500 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <1258458270-6371-9-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> Message-ID: <20091117163852.GG20160@hecubus> On Tue, Nov 17, 2009 at 10:14:27PM +1030, David Kettler wrote: > Currently the match_required state is set at the beginning when input > is being read. This commit allows completers to change that state > during the input. In particular, this can be used to allow a webjump > with a limited set of valid inputs to prevent invalid inputs from > being accepted. > > For example, the following webjump can now be defined and will only > allow valid bookmarks to be chosen. Without $match_required, the webjump > will try to visit any arbitrary input, which is confusing and not useful. > > /* Access bookmarks via completion from a webjump. */ > define_webjump("bookmark", > function(term) {return term;}, > $completer = history_completer($use_history = false, > $use_bookmarks = true, > $match_required = true)); > > Another example is in the upcoming index webjump feature. > --- > > Note: In merge_completers I think the destroy function needs something > like call_all('destroy'), rather than forward(). Cool feature. Okay -- John Foerch From jjfoerch at earthlink.net Tue Nov 17 08:43:24 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 11:43:24 -0500 Subject: [Conkeror] [PATCH] index-webjump: New module to define webjumps for index pages. In-Reply-To: <1258458270-6371-10-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-10-git-send-email-kettler@internode.on.net> Message-ID: <20091117164324.GH20160@hecubus> On Tue, Nov 17, 2009 at 10:14:28PM +1030, David Kettler wrote: > Index webjumps provide convenient access, with completion, to a set of > web pages that are indexed (referenced) from another page. For > instance, webjumps for documentation (e.g., git, ImageMagick) are easy > to define. > > A webjump to access URLs referenced from an index page is defined > using define_xpath_webjump. An xpath expression is used to extract > the indexed URLs and the anchor text; this provides completion for the > webjump. The completion must be enabled using webjump-get-index once > for each index webjump. > > This module also subsumes define_gitweb_summary_webjump, which results > in changes to how gitweb webjumps are set up. > --- > > This patch only shows the new index-webjumps.js module. The eventual > commit will also remove the existing gitweb-webjumps.js module. > > This makes use of functionality provided by [[PATCH] Let completion > functions set the match_required state], but that is not vital. It's > also helped by [[PATCH] Show errors from completers, etc]. > > Conkeror wiki pages will also be updated as follows. Sounds good -- John Foerch From jjfoerch at earthlink.net Tue Nov 17 08:58:56 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 11:58:56 -0500 Subject: [Conkeror] [PATCH] Provide buttons on the mode-line for basic browser control. In-Reply-To: <1258458270-6371-12-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-12-git-send-email-kettler@internode.on.net> Message-ID: <20091117165856.GI20160@hecubus> On Tue, Nov 17, 2009 at 10:14:30PM +1030, David Kettler wrote: > Simple GUI buttons are provided for controlling conkeror. They are > intended to be unobtrusive and to steal as little screen space as > possible. Clicking on them executes a conkeror command. Hovering > over them tells you the command and the corresponding keystroke. > > The buttons are intended to make conkeror usable for a casual user and > also to aid the novice user while they become familiar with conkeror's > interface. > > They can be enabled with: > require("mode-line-buttons.js"); > add_mode_line_buttons(standard_mode_line_buttons, true); > --- > > Problems: > - The icons used do not clearly indicate their function. > - The names of the commands are also probably unclear for novices. > - There are probably too many buttons. It might be better to have > just a few, together with a popup menu. I like the feature, but I don't think the framework is in place to do it robustly yet. What I have in mind is a more general Menu subsystem that handles menus in the abstract, rather than in terms of particular UI representations of them. I also think there are problems in the interactive system that need to be addressed first, like a way to disable commands, and gray-out buttons that run those commands, when they should not be called. No objections to something like this going into contrib/ or the wiki, though, so people who would find it convenient can use it in the meantime. -- John Foerch From jjfoerch at earthlink.net Tue Nov 17 09:03:52 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 12:03:52 -0500 Subject: [Conkeror] [RFC] index-webjump: test suite In-Reply-To: <1258458270-6371-11-git-send-email-kettler@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-11-git-send-email-kettler@internode.on.net> Message-ID: <20091117170352.GA20767@hecubus> On Tue, Nov 17, 2009 at 10:14:29PM +1030, David Kettler wrote: > This depends on [[PATCH] index-webjump: New module to define webjumps > for index pages]. > > The test is partially broken; it makes use of > conkeror_source_code_path to find auxiliary test files, which fails > when that variable is undefined. For command line use ctx.local.cwd > would work, but the test suite doesn't have access to the context. Is there a way that this suite could fail when conkeror_source_code_path is not set, and provide instructions to the user for how to set it from the command line? -- John Foerch From levy at msri.org Tue Nov 17 10:10:27 2009 From: levy at msri.org (Silvio Levy) Date: Tue, 17 Nov 2009 10:10:27 -0800 Subject: [Conkeror] Questions about history In-Reply-To: Your message of Wed, 11 Nov 2009 19:09:41 -0500 Message-ID: <20091117181027.82E6ADFCF@xi.msri.org> Dear Conkeror Wizards, Two questions about history: 1. How can I find out when a URL that I see on the history buffer was visited? 2. How can I dump the history buffer somewhere? Often the information I want from the history is a URL string, but I'm unable to cut and paste it. In fact I generally can't even see it in full, unless I make the window very wide and the font size smaller than is comfortable for me. Thanks, Silvio From jjfoerch at earthlink.net Tue Nov 17 10:27:51 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Tue, 17 Nov 2009 13:27:51 -0500 Subject: [Conkeror] Questions about history In-Reply-To: <20091117181027.82E6ADFCF@xi.msri.org> References: <20091117181027.82E6ADFCF@xi.msri.org> Message-ID: <20091117182751.GA21562@hecubus> On Tue, Nov 17, 2009 at 10:10:27AM -0800, Silvio Levy wrote: > > Dear Conkeror Wizards, > > Two questions about history: > > 1. How can I find out when a URL that I see on the history buffer was > visited? > > 2. How can I dump the history buffer somewhere? Often the information > I want from the history is a URL string, but I'm unable to cut and > paste it. In fact I generally can't even see it in full, unless I make > the window very wide and the font size smaller than is comfortable for me. > > Thanks, > > Silvio You'll have to do this through the mozilla api. Conkeror doesn't have either of these features. -- John Foerch From kettler at internode.on.net Wed Nov 18 05:35:30 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 00:05:30 +1030 Subject: [Conkeror] [PATCH] Fix command line +u In-Reply-To: <20091117162447.GB20160@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-3-git-send-email-kettler@internode.on.net> <20091117162447.GB20160@hecubus> Message-ID: <4B03F822.9070907@internode.on.net> Thanks for your reviews, John. I've pushed six patches, including this one. From kettler at internode.on.net Wed Nov 18 05:36:32 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 00:06:32 +1030 Subject: [Conkeror] [PATCH] index-webjump: New module to define webjumps for index pages. In-Reply-To: <20091117164324.GH20160@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-10-git-send-email-kettler@internode.on.net> <20091117164324.GH20160@hecubus> Message-ID: <4B03F860.1060606@internode.on.net> Pushed with some additions: - Check that there are a non-zero number of completions. - Have tidy do more cleanup. - index_webjumps_directory must be an nsILocalFile. regards, David From kettler at internode.on.net Wed Nov 18 05:37:39 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 00:07:39 +1030 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <20091117163852.GG20160@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> <20091117163852.GG20160@hecubus> Message-ID: <4B03F8A3.6070601@internode.on.net> > Cool feature. Okay Pushed. There's a remaining case though that should be covered. If the completer fails (say because it couldn't load a file and it threw an error), then the match_required doesn't get passed through. So, for instance the new xpath webjumps will report errors properly when you try to complete, but when you press enter it will follow a bogus url. regards, David From kettler at internode.on.net Wed Nov 18 05:38:53 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 00:08:53 +1030 Subject: [Conkeror] [PATCH] Enable URL completion for both bookmarks and history (workaround). In-Reply-To: <20091117163103.GD20160@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-6-git-send-email-kettler@internode.on.net> <20091117163103.GD20160@hecubus> Message-ID: <4B03F8ED.7000103@internode.on.net> > Is there a way to filter the duplicates out? Not easily. I suppose a modified merge_completers() could extract all the completions, sort and uniquify them, then return the survivors to pre-sorted order. I'm not particularly motivated to do so, for several reasons. Firstly, I no longer personally care for having both bookmark and history completion. I have only webjump and history completion enabled and I access bookmarks (with completion) via the "bookmark" webjump. Secondly, it's possible to have duplicates in any case, simply by having multiple bookmarks of the same page. That tends to happen for me, mostly because I don't cull the bookmarks (as there's currently no convenient way to do so). Having many bookmarks isn't really an issue, because the completion mechanism is superb. Thirdly, this is in any case just a workaround for a mozilla bug; maybe it will be fixed one day. But probably not; I can't access the bug server now, but I seem to recall the bug has been known for many years. https://bugzilla.mozilla.org/show_bug.cgi?id=425726 In any case, I think the present patch is an incremental improvement that's worth having for now. regards, David From kettler at internode.on.net Wed Nov 18 05:39:45 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 00:09:45 +1030 Subject: [Conkeror] [RFC] index-webjump: test suite In-Reply-To: <20091117170352.GA20767@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-11-git-send-email-kettler@internode.on.net> <20091117170352.GA20767@hecubus> Message-ID: <4B03F921.2050908@internode.on.net> > Is there a way that this suite could fail when conkeror_source_code_path > is not set, and provide instructions to the user for how to set it from > the command line? I kludged that in and pushed it. Maybe it would be better for walnut to check for failure in suite_setup(). regards, David From kettler at internode.on.net Wed Nov 18 05:40:56 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 00:10:56 +1030 Subject: [Conkeror] [PATCH] Provide buttons on the mode-line for basic browser control. In-Reply-To: <20091117165856.GI20160@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-12-git-send-email-kettler@internode.on.net> <20091117165856.GI20160@hecubus> Message-ID: <4B03F968.3030900@internode.on.net> > I like the feature, but I don't think the framework is in place to do it > robustly yet. Yes, it's just a quick hack. Also, the text and generic widgets could do with some refactoring. > No objections to something like this going into contrib/ or the wiki, > though, so people who would find it convenient can use it in the meantime. If I put it in contrib, what's the best way to suggest that people use it: - require(conkeror_source_code_path + "/contrib/modules/mode-line-buttons.js"); - or symlink into ~/.conkerorrc (or whatever) and use an explicit path? The patch also included a minor change to mode-line. I can make that a separate patch. regards, David From kettler at internode.on.net Wed Nov 18 05:42:07 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 00:12:07 +1030 Subject: [Conkeror] [PATCH] Show errors from completers, etc. In-Reply-To: <20091117163518.GF20160@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-8-git-send-email-kettler@internode.on.net> <20091117163518.GF20160@hecubus> Message-ID: <4B03F9AF.5040607@internode.on.net> > Can you tell me steps to reproduce the problem, to help me understand the > situation being addressed here? With the new index-webjump mode, the xpath webjumps are unusable without completions being available, so the index webjump completer will throw an error in that case. Without this patch, the error will be discarded, so the user won't see the explanation and won't know why there are no completions. You can see the problem by defining such a webjump, e.g.: define_xpath_webjump( "gitdoc", "http://www.kernel.org/pub/software/scm/git/docs/", '//xhtml:dt/xhtml:a', $description = "Git documentation"); Do not call webjump-get-index. Now press "g gitdoc g". The last "g" will try to load the completions, which will fail. Without this patch the user won't know why. But see also my reply to [PATCH] Let completion functions set the match_required state. There may be other ways to currently trigger such an error, and future changes might introduce more. It's a good general principle to give the user info about what failed. regards, David From kettler at internode.on.net Wed Nov 18 05:42:51 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 00:12:51 +1030 Subject: [Conkeror] Page mode keymaps Message-ID: <4B03F9DB.90201@internode.on.net> John, I'm interested in hearing about your intentions regarding the new keymap and input system with page modes. The present overriding of keystrokes is certainly awkward to use. Do you intend that there simply be a convenient way to toggle modes between the page mode keymap and content_buffer_normal_keymap? regards, David From jjfoerch at earthlink.net Wed Nov 18 09:55:21 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Wed, 18 Nov 2009 12:55:21 -0500 Subject: [Conkeror] [RFC] index-webjump: test suite In-Reply-To: <4B03F921.2050908@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-11-git-send-email-kettler@internode.on.net> <20091117170352.GA20767@hecubus> <4B03F921.2050908@internode.on.net> Message-ID: <20091118175521.GA31863@hecubus> On Thu, Nov 19, 2009 at 12:09:45AM +1030, David Kettler wrote: > >Is there a way that this suite could fail when conkeror_source_code_path > >is not set, and provide instructions to the user for how to set it from > >the command line? > > I kludged that in and pushed it. Maybe it would be better for walnut > to check for failure in suite_setup(). > > regards, David What about using a mock object instead? Haven't read the code in detail, so maybe I misunderstand. -- John Foerch From jjfoerch at earthlink.net Wed Nov 18 10:24:17 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Wed, 18 Nov 2009 13:24:17 -0500 Subject: [Conkeror] [PATCH] Provide buttons on the mode-line for basic browser control. In-Reply-To: <4B03F968.3030900@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-12-git-send-email-kettler@internode.on.net> <20091117165856.GI20160@hecubus> <4B03F968.3030900@internode.on.net> Message-ID: <20091118182417.GA32262@hecubus> On Thu, Nov 19, 2009 at 12:10:56AM +1030, David Kettler wrote: > > I like the feature, but I don't think the framework is in place to do it > > robustly yet. > > Yes, it's just a quick hack. Also, the text and generic widgets could > do with some refactoring. > > > No objections to something like this going into contrib/ or the wiki, > > though, so people who would find it convenient can use it in the > meantime. > > If I put it in contrib, what's the best way to suggest that people use > it: > - require(conkeror_source_code_path + > "/contrib/modules/mode-line-buttons.js"); > - or symlink into ~/.conkerorrc (or whatever) and use an explicit path? > > The patch also included a minor change to mode-line. I can make that > a separate patch. We'll need to make a chrome domain for conkeror-contrib, so that people can opt in with: load_paths.unshift("chrome://conkeror-contrib/content/"); -- John Foerch From brian at gweep.ca Wed Nov 18 10:38:37 2009 From: brian at gweep.ca (Brian Edmonds) Date: Wed, 18 Nov 2009 10:38:37 -0800 Subject: [Conkeror] [PATCH] Provide buttons on the mode-line for basic browser control. In-Reply-To: <413a3a380911181034j378f1cb2s6c1654a3aec1e9c3@mail.gmail.com> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-12-git-send-email-kettler@internode.on.net> <20091117165856.GI20160@hecubus> <4B03F968.3030900@internode.on.net> <20091118182417.GA32262@hecubus> <413a3a380911181034j378f1cb2s6c1654a3aec1e9c3@mail.gmail.com> Message-ID: <413a3a380911181038g218a36f4ud9654b85283d0d77@mail.gmail.com> I'm generally not that excited about browser bling, but having a tablet, I've given thought a number of times to adding buttons for at least switching and closing buffers. Brian. On Nov 18, 2009 10:25 AM, "John J. Foerch" wrote: On Thu, Nov 19, 2009 at 12:10:56AM +1030, David Kettler wrote: > > I like the feature, but I don't t... We'll need to make a chrome domain for conkeror-contrib, so that people can opt in with: load_paths.unshift("chrome://conkeror-contrib/content/"); -- John Foerch _______________________________________________ Conkeror mailing list Conkeror at mozdev.org https://ww... -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjfoerch at earthlink.net Wed Nov 18 10:49:02 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Wed, 18 Nov 2009 13:49:02 -0500 Subject: [Conkeror] Page mode keymaps In-Reply-To: <4B03F9DB.90201@internode.on.net> References: <4B03F9DB.90201@internode.on.net> Message-ID: <20091118184902.GA32487@hecubus> On Thu, Nov 19, 2009 at 12:12:51AM +1030, David Kettler wrote: > John, I'm interested in hearing about your intentions regarding the > new keymap and input system with page modes. The present overriding > of keystrokes is certainly awkward to use. Do you intend that there > simply be a convenient way to toggle modes between the page mode > keymap and content_buffer_normal_keymap? I want to split up page-modes, and remove the restriction of "there can be only one". Instead of each existing "monolithic" page-mode, there would be a group of additive modes, each of which is responsible for one feature. In emacs terminology, page-modes will be more like a collection of minor-modes than like a major-mode. In mozilla terminology, page-modes will be more like greasemonkey scripts. Some of these modes will provide keymaps, but there will be nothing special about those keymaps.. they would just be optional keymaps as could be installed by any module. The last piece of the puzzle will be providing a UI by which the user can interactively toggle optional keymaps, though I'm not sure exactly what form that UI will take at the moment. -- John Foerch From jjfoerch at earthlink.net Wed Nov 18 10:57:55 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Wed, 18 Nov 2009 13:57:55 -0500 Subject: [Conkeror] [PATCH] Provide buttons on the mode-line for basic browser control. In-Reply-To: <413a3a380911181038g218a36f4ud9654b85283d0d77@mail.gmail.com> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-12-git-send-email-kettler@internode.on.net> <20091117165856.GI20160@hecubus> <4B03F968.3030900@internode.on.net> <20091118182417.GA32262@hecubus> <413a3a380911181034j378f1cb2s6c1654a3aec1e9c3@mail.gmail.com> <413a3a380911181038g218a36f4ud9654b85283d0d77@mail.gmail.com> Message-ID: <20091118185755.GA32675@hecubus> On Wed, Nov 18, 2009 at 10:38:37AM -0800, Brian Edmonds wrote: > I'm generally not that excited about browser bling, but having a tablet, I've > given thought a number of times to adding buttons for at least switching and > closing buffers. See new-tabs. -- John Foerch From jjfoerch at earthlink.net Wed Nov 18 12:18:29 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Wed, 18 Nov 2009 15:18:29 -0500 Subject: [Conkeror] [PATCH] Show errors from completers, etc. In-Reply-To: <4B03F9AF.5040607@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-8-git-send-email-kettler@internode.on.net> <20091117163518.GF20160@hecubus> <4B03F9AF.5040607@internode.on.net> Message-ID: <20091118201829.GA1538@hecubus> On Thu, Nov 19, 2009 at 12:12:07AM +1030, David Kettler wrote: > >Can you tell me steps to reproduce the problem, to help me understand the > >situation being addressed here? > > With the new index-webjump mode, the xpath webjumps are unusable > without completions being available, so the index webjump completer > will throw an error in that case. Without this patch, the error will > be discarded, so the user won't see the explanation and won't know why > there are no completions. > > You can see the problem by defining such a webjump, e.g.: > > define_xpath_webjump( > "gitdoc", > "http://www.kernel.org/pub/software/scm/git/docs/", > '//xhtml:dt/xhtml:a', > $description = "Git documentation"); > > Do not call webjump-get-index. Now press "g gitdoc g". The last "g" > will try to load the completions, which will fail. Without this patch > the user won't know why. > > But see also my reply to [PATCH] Let completion functions set the > match_required state. > > There may be other ways to currently trigger such an error, and future > changes might introduce more. It's a good general principle to give > the user info about what failed. Oh okay, sounds like a good thing then. -- John Foerch From kettler at internode.on.net Thu Nov 19 04:02:42 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 22:32:42 +1030 Subject: [Conkeror] [PATCH] Provide buttons on the mode-line for basic browser control. In-Reply-To: <20091118182417.GA32262@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-12-git-send-email-kettler@internode.on.net> <20091117165856.GI20160@hecubus> <4B03F968.3030900@internode.on.net> <20091118182417.GA32262@hecubus> Message-ID: <4B0533E2.4070207@internode.on.net> > We'll need to make a chrome domain for conkeror-contrib, so that people > can opt in with: > > load_paths.unshift("chrome://conkeror-contrib/content/"); Okay, sounds good. It'd also be nice to be able to directly require() such a chrome: url. And load it from the command line with -l. regards, David From kettler at internode.on.net Thu Nov 19 04:15:35 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 22:45:35 +1030 Subject: [Conkeror] Page mode keymaps In-Reply-To: <20091118184902.GA32487@hecubus> References: <4B03F9DB.90201@internode.on.net> <20091118184902.GA32487@hecubus> Message-ID: <4B0536E7.80302@internode.on.net> Thanks for the explanation, John. Sounds good. > The last piece of the puzzle will be > providing a UI by which the user can interactively toggle optional > keymaps, though I'm not sure exactly what form that UI will take at the > moment. It's be nice if it were possible to have both sets of keys available without collision, to avoid the need to toggle. That works in emacs because there are strong conventions to avoid modes stomping on general keys. Whereas keys assigned by sites are very likely to collide with conkeror key assignments. And the standard conkeror keystrokes are too convenient to change for this purpose. Just musing, David From kettler at internode.on.net Thu Nov 19 04:24:56 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 22:54:56 +1030 Subject: [Conkeror] [RFC] index-webjump: test suite In-Reply-To: <20091118175521.GA31863@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-11-git-send-email-kettler@internode.on.net> <20091117170352.GA20767@hecubus> <4B03F921.2050908@internode.on.net> <20091118175521.GA31863@hecubus> Message-ID: <4B053918.8070704@internode.on.net> I could have the text of the two xml files literally in the test suite and modify the index-webjump to parse that text. Is that what you mean? Maybe that's the best solution, but it will mean a little less of the code is exercised by the test. You suggested chrome://conkeror-contrib elsewhere. How about also having a chrome://conkeror-test something like the following. Then I don't need conkeror_source_code_path. (I'd chop this into 2 or 3 commits to push.) Subject: [PATCH] Make chrome URLs for contrib and tests. Use in index-webjump test. --- chrome/chrome.manifest | 3 +++ modules/utils.js | 5 +++++ tests/simple/index-webjump.js | 11 ++--------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/chrome/chrome.manifest b/chrome/chrome.manifest index 2b49211..db7a844 100644 --- a/chrome/chrome.manifest +++ b/chrome/chrome.manifest @@ -6,6 +6,9 @@ locale conkeror-gui en-US file:../locale/en-US/ content conkeror-help file:../help/ +content conkeror-contrib file:../contrib/modules/ +content conkeror-test file:../tests/ + locale branding en-US file:../branding/ override chrome://global/locale/netErrorApp.dtd chrome://conkeror-gui/locale/netError.dtd diff --git a/modules/utils.js b/modules/utils.js index e2dd6d3..3d724f3 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -144,6 +144,11 @@ function make_uri (uri, charset, base_uri) { return io_service.newURI(uri, charset, base_uri); } +function make_file_from_chrome (url) { + var crs = Cc['@mozilla.org/chrome/chrome-registry;1'] + .getService(Ci.nsIChromeRegistry); + return crs.convertChromeURL(make_uri(url)); +} function get_document_content_disposition (document_o) { var content_disposition = null; diff --git a/tests/simple/index-webjump.js b/tests/simple/index-webjump.js index 8df10fe..aff8a76 100644 --- a/tests/simple/index-webjump.js +++ b/tests/simple/index-webjump.js @@ -12,7 +12,7 @@ require('index-webjump.js'); conkeror.webjumps = this.real_webjumps; conkeror.index_webjumps = this.real_index_webjumps; }, - path: conkeror_source_code_path + "/tests/simple", + path: make_file_from_chrome("chrome://conkeror-test/content/simple").path, test_xpath_webjump: function () { define_xpath_webjump( "xpath", "http://dummy/xpath", '//xhtml:a[@class="index"]', @@ -41,12 +41,5 @@ require('index-webjump.js'); assert_equals(w.completions[1][0], "foo"); }, }; - if (conkeror_source_code_path) - walnut_run(suite); - else - dumpln('Suite setup failed; conkeror_source_code_path not set.' + - ' Try:\n' + - ' conkeror -q -batch' + - ' -e "conkeror_source_code_path=\\"$PWD\\";"' + - ' -l tests/simple/index-webjump.js'); + walnut_run(suite); } -- 1.6.5 From kettler at internode.on.net Thu Nov 19 04:29:55 2009 From: kettler at internode.on.net (David Kettler) Date: Thu, 19 Nov 2009 22:59:55 +1030 Subject: [Conkeror] [PATCH] Show errors from completers, etc. In-Reply-To: <20091118201829.GA1538@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-8-git-send-email-kettler@internode.on.net> <20091117163518.GF20160@hecubus> <4B03F9AF.5040607@internode.on.net> <20091118201829.GA1538@hecubus> Message-ID: <4B053A43.9050101@internode.on.net> > Oh okay, sounds like a good thing then. Thanks. Pushed. From jjfoerch at earthlink.net Thu Nov 19 11:40:17 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Thu, 19 Nov 2009 14:40:17 -0500 Subject: [Conkeror] Page mode keymaps In-Reply-To: <4B0536E7.80302@internode.on.net> References: <4B03F9DB.90201@internode.on.net> <20091118184902.GA32487@hecubus> <4B0536E7.80302@internode.on.net> Message-ID: <20091119194017.GA14061@hecubus> On Thu, Nov 19, 2009 at 10:45:35PM +1030, David Kettler wrote: > Thanks for the explanation, John. Sounds good. > > > The last piece of the puzzle will be > >providing a UI by which the user can interactively toggle optional > >keymaps, though I'm not sure exactly what form that UI will take at the > >moment. > > It's be nice if it were possible to have both sets of keys > available without collision, to avoid the need to toggle. That > works in emacs because there are strong conventions to avoid > modes stomping on general keys. Whereas keys assigned by sites > are very likely to collide with conkeror key assignments. And > the standard conkeror keystrokes are too convenient to change for > this purpose. > > Just musing, David In emacs, unmodified alphanumerics are bound to self-insert, which is more or less equivalent to Conkeror's concept of a fallthrough. Conkeror's use of unmodified alphanumeric bindings is not only very un-emacsy, but also very much in conflict with the assumptions of most web designers, because there seems to be an implicit convention that those keys should be available for web pages to use. That said, having those bindings is so convenient, and so fundamental to Conkeror's UI, that it's not really an option to give them up. Thus, we must muddle along and deal with the conflicts as best we can. Our concept of modality is really a lot more like vi's UI than emacs's. -- John Foerch From jeremy at jeremyms.com Thu Nov 19 14:18:14 2009 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Thu, 19 Nov 2009 14:18:14 -0800 Subject: [Conkeror] Questions about history In-Reply-To: <20091117181027.82E6ADFCF@xi.msri.org> (Silvio Levy's message of "Tue, 17 Nov 2009 10:10:27 -0800") References: <20091117181027.82E6ADFCF@xi.msri.org> Message-ID: <873a4acg61.fsf@jeremyms.com> Silvio Levy writes: > Dear Conkeror Wizards, > Two questions about history: > 1. How can I find out when a URL that I see on the history buffer was > visited? > 2. How can I dump the history buffer somewhere? Often the information > I want from the history is a URL string, but I'm unable to cut and > paste it. In fact I generally can't even see it in full, unless I make > the window very wide and the font size smaller than is comfortable for > me. C-x C-v is useful for getting the current URL. -- Jeremy Maitin-Shepard From kettler at internode.on.net Thu Nov 19 23:19:01 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 20 Nov 2009 17:49:01 +1030 Subject: [Conkeror] Page mode keymaps In-Reply-To: <20091119194017.GA14061@hecubus> References: <4B03F9DB.90201@internode.on.net> <20091118184902.GA32487@hecubus> <4B0536E7.80302@internode.on.net> <20091119194017.GA14061@hecubus> Message-ID: <4B0642E5.2050702@internode.on.net> > In emacs, unmodified alphanumerics are bound to self-insert, which is more > or less equivalent to Conkeror's concept of a fallthrough. Conkeror's use > of unmodified alphanumeric bindings is not only very un-emacsy, ... But many emacs modes that are "applications" in themselves do use plain alphabetic keys extensively; e.g. dired, gnus. Conkeror's bindings are consistent with emacs usage in that sense. > Our concept of modality is really a lot more like vi's UI than emacs's. Yeah, bummer. From jjfoerch at earthlink.net Fri Nov 20 08:11:59 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Fri, 20 Nov 2009 11:11:59 -0500 Subject: [Conkeror] Page mode keymaps In-Reply-To: <4B0642E5.2050702@internode.on.net> References: <4B03F9DB.90201@internode.on.net> <20091118184902.GA32487@hecubus> <4B0536E7.80302@internode.on.net> <20091119194017.GA14061@hecubus> <4B0642E5.2050702@internode.on.net> Message-ID: <20091120161159.GA22717@hecubus> On Fri, Nov 20, 2009 at 05:49:01PM +1030, David Kettler wrote: > >In emacs, unmodified alphanumerics are bound to self-insert, which is more > >or less equivalent to Conkeror's concept of a fallthrough. Conkeror's use > >of unmodified alphanumeric bindings is not only very un-emacsy, ... > > But many emacs modes that are "applications" in themselves do use > plain alphabetic keys extensively; e.g. dired, gnus. Conkeror's > bindings are consistent with emacs usage in that sense. I think the analogy to emacs applications was definitely an important principle early on in the development of Conkeror, but experience has taught us that the analogy quickly breaks down because of the sheer complexity of dealing with DOM documents on the web, as compared to the relative simplicity of working with plain text. DOM documents can be applications in their own right with key bindings that need to be respected, etc. > > >Our concept of modality is really a lot more like vi's UI than emacs's. > > Yeah, bummer. > Haha, I don't see it as a bummer at all. I think it's a gift that a nice program like vi exists, from which we can gain ideas for ways to solve problems for which the emacs UI style is insufficient. -- John Foerch From jjfoerch at earthlink.net Sat Nov 21 20:08:00 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Sat, 21 Nov 2009 23:08:00 -0500 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <4B03F8A3.6070601@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> <20091117163852.GG20160@hecubus> <4B03F8A3.6070601@internode.on.net> Message-ID: <20091122040800.GA16421@hecubus> On Thu, Nov 19, 2009 at 12:07:39AM +1030, David Kettler wrote: > >Cool feature. Okay > > Pushed. There's a remaining case though that should be covered. If > the completer fails (say because it couldn't load a file and it threw > an error), then the match_required doesn't get passed through. So, > for instance the new xpath webjumps will report errors properly when > you try to complete, but when you press enter it will follow a bogus > url. > > regards, David Found another problem with this patch.. To reproduce: * start conkeror -q * g wikipedia tag Lots of errors on the console. Can you look into this? -- John Foerch From kettler at internode.on.net Sun Nov 22 03:19:33 2009 From: kettler at internode.on.net (David Kettler) Date: Sun, 22 Nov 2009 21:49:33 +1030 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <20091122040800.GA16421@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> <20091117163852.GG20160@hecubus> <4B03F8A3.6070601@internode.on.net> <20091122040800.GA16421@hecubus> Message-ID: <4B091E45.7070905@internode.on.net> > Lots of errors on the console. Can you look into this? Thanks. I pushed the following fix. Subject: [PATCH] Properly merge completers with null elements When a completer does not support an element it was possible for merge completers to erroneously call the next completer with a negative index. For instance, this occurred with the wikipedia webjump, for which the search engine does not provide descriptions for its completions. This latent bug was exposed by 2005f2e (Let completion functions set the match_required state) because more completers can now be on the completion list, even if they have no results. --- modules/minibuffer-completion.js | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/modules/minibuffer-completion.js b/modules/minibuffer-completion.js index e221bc4..ff453de 100644 --- a/modules/minibuffer-completion.js +++ b/modules/minibuffer-completion.js @@ -283,6 +283,8 @@ function merge_completers (completers) { if (name in r && r[name] != null) { args.unshift(i); return r[name].apply(this, args); + } else { + return null; } } i -= r.count; From jjfoerch at earthlink.net Sun Nov 22 07:04:50 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Sun, 22 Nov 2009 10:04:50 -0500 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <4B091E45.7070905@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> <20091117163852.GG20160@hecubus> <4B03F8A3.6070601@internode.on.net> <20091122040800.GA16421@hecubus> <4B091E45.7070905@internode.on.net> Message-ID: <20091122150450.GA23620@hecubus> On Sun, Nov 22, 2009 at 09:49:33PM +1030, David Kettler wrote: > >Lots of errors on the console. Can you look into this? > > Thanks. I pushed the following fix. > > Subject: [PATCH] Properly merge completers with null elements > > When a completer does not support an element it was possible for merge > completers to erroneously call the next completer with a negative > index. For instance, this occurred with the wikipedia webjump, for > which the search engine does not provide descriptions for its > completions. > > This latent bug was exposed by 2005f2e (Let completion functions set > the match_required state) because more completers can now be on the > completion list, even if they have no results. Thank you -- John Foerch From kettler at internode.on.net Sun Nov 22 13:39:43 2009 From: kettler at internode.on.net (David Kettler) Date: Mon, 23 Nov 2009 08:09:43 +1030 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <20091122150450.GA23620@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> <20091117163852.GG20160@hecubus> <4B03F8A3.6070601@internode.on.net> <20091122040800.GA16421@hecubus> <4B091E45.7070905@internode.on.net> <20091122150450.GA23620@hecubus> Message-ID: <4B09AF9F.7060008@internode.on.net> >>> Lots of errors on the console. I was surprised that I had missed this problem, especially as I've been using this code for about six months. I think there's two reasons. Firstly, while I had tested various cases, I didn't realise there was this difference with the wikipedia webjump and had not specifically tested that case. Secondly, xulrunner reports many javascript errors from various webpages. So conkeror errors can be lost in the garbage. I wonder if there's a way to direct the errors from webpages separately from conkeror errors. regards, David. From jjfoerch at earthlink.net Sun Nov 22 18:51:54 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Sun, 22 Nov 2009 21:51:54 -0500 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <4B09AF9F.7060008@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> <20091117163852.GG20160@hecubus> <4B03F8A3.6070601@internode.on.net> <20091122040800.GA16421@hecubus> <4B091E45.7070905@internode.on.net> <20091122150450.GA23620@hecubus> <4B09AF9F.7060008@internode.on.net> Message-ID: <20091123025154.GA32550@hecubus> On Mon, Nov 23, 2009 at 08:09:43AM +1030, David Kettler wrote: > >>>Lots of errors on the console. > > I was surprised that I had missed this problem, especially as I've > been using this code for about six months. I think there's two > reasons. Firstly, while I had tested various cases, I didn't realise > there was this difference with the wikipedia webjump and had not > specifically tested that case. Secondly, xulrunner reports many > javascript errors from various webpages. So conkeror errors can be > lost in the garbage. > > I wonder if there's a way to direct the errors from webpages > separately from conkeror errors. > > regards, David. Those errors are dumped to the console by conkeror, not xulrunner. See utils.js, console_service.registerListener... I find it helpful to see content javascript errors on the console. Do you have another idea? -- John Foerch From mashdot at toshine.net Mon Nov 23 09:09:42 2009 From: mashdot at toshine.net ('Mash) Date: Mon, 23 Nov 2009 17:09:42 +0000 Subject: [Conkeror] Spellcheck? Message-ID: <20091123170942.GO3292@grace.toshine.net> I couldn't find anything, but is there a spell check module available? 'Mash From kettler at internode.on.net Wed Nov 25 04:34:32 2009 From: kettler at internode.on.net (David Kettler) Date: Wed, 25 Nov 2009 23:04:32 +1030 Subject: [Conkeror] Error messages Was: [PATCH] Let completion functions set the match_required state. In-Reply-To: <20091123025154.GA32550@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> <20091117163852.GG20160@hecubus> <4B03F8A3.6070601@internode.on.net> <20091122040800.GA16421@hecubus> <4B091E45.7070905@internode.on.net> <20091122150450.GA23620@hecubus> <4B09AF9F.7060008@internode.on.net> <20091123025154.GA32550@hecubus> Message-ID: <4B0D2458.7050807@internode.on.net> > Those errors are dumped to the console by conkeror, not xulrunner. See > utils.js, console_service.registerListener... Okay, thanks. > I find it helpful to see > content javascript errors on the console. Do you have another idea? I'm mostly interested in errors from conkeror, but usually not from content over which I have no control. Mainly I don't want to miss seeing a conkeror error because I'm ignoring other crap. Usually I run conkeror from the command line so that errors just end up in my terminal. Simply redirecting output to a file that I occasionally inspect will probably fix the problem for me. Two other suggestions: Put content errors in a log file, separate from conkeror errors. Have much terser errors on the output. Put details in a log file. But if others aren't bothered, I'll just change my habits. regards, David From jjfoerch at earthlink.net Wed Nov 25 08:17:28 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Wed, 25 Nov 2009 11:17:28 -0500 Subject: [Conkeror] Error messages Was: [PATCH] Let completion functions set the match_required state. In-Reply-To: <4B0D2458.7050807@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> <20091117163852.GG20160@hecubus> <4B03F8A3.6070601@internode.on.net> <20091122040800.GA16421@hecubus> <4B091E45.7070905@internode.on.net> <20091122150450.GA23620@hecubus> <4B09AF9F.7060008@internode.on.net> <20091123025154.GA32550@hecubus> <4B0D2458.7050807@internode.on.net> Message-ID: <20091125161728.GA4023@hecubus> On Wed, Nov 25, 2009 at 11:04:32PM +1030, David Kettler wrote: > >Those errors are dumped to the console by conkeror, not xulrunner. See > >utils.js, console_service.registerListener... > > Okay, thanks. > > >I find it helpful to see > >content javascript errors on the console. Do you have another idea? > > I'm mostly interested in errors from conkeror, but usually not from > content over which I have no control. Mainly I don't want to miss > seeing a conkeror error because I'm ignoring other crap. > > Usually I run conkeror from the command line so that errors just end > up in my terminal. Simply redirecting output to a file that I > occasionally inspect will probably fix the problem for me. Two > other suggestions: > > Put content errors in a log file, separate from conkeror errors. > > Have much terser errors on the output. Put details in a log file. > > But if others aren't bothered, I'll just change my habits. > > regards, David Please open a thread about this on bugs.conkeror.org and we can collect ideas for better ways to deal with errors, warnings and messages. This is the kind of thing that could easily turn into a huge project involving the creation of a *Messages* buffer, user-configurable streams for different log levels, et cetera. -- John Foerch From jjfoerch at earthlink.net Thu Nov 26 18:08:37 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Thu, 26 Nov 2009 21:08:37 -0500 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <4B03F8A3.6070601@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-9-git-send-email-kettler@internode.on.net> <20091117163852.GG20160@hecubus> <4B03F8A3.6070601@internode.on.net> Message-ID: <20091127020837.GA24963@hecubus> On Thu, Nov 19, 2009 at 12:07:39AM +1030, David Kettler wrote: > >Cool feature. Okay > > Pushed. There's a remaining case though that should be covered. If > the completer fails (say because it couldn't load a file and it threw > an error), then the match_required doesn't get passed through. So, > for instance the new xpath webjumps will report errors properly when > you try to complete, but when you press enter it will follow a bogus > url. > > regards, David Can you also put a note about this on bugs.conkeror.org, so we don't forget about it? -- John Foerch From jjfoerch at earthlink.net Thu Nov 26 18:16:40 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Thu, 26 Nov 2009 21:16:40 -0500 Subject: [Conkeror] [RFC] index-webjump: test suite In-Reply-To: <4B053918.8070704@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-11-git-send-email-kettler@internode.on.net> <20091117170352.GA20767@hecubus> <4B03F921.2050908@internode.on.net> <20091118175521.GA31863@hecubus> <4B053918.8070704@internode.on.net> Message-ID: <20091127021640.GB24963@hecubus> On Thu, Nov 19, 2009 at 10:54:56PM +1030, David Kettler wrote: > I could have the text of the two xml files literally in the test suite > and modify the index-webjump to parse that text. Is that what you > mean? Maybe that's the best solution, but it will mean a little less > of the code is exercised by the test. > > You suggested chrome://conkeror-contrib elsewhere. How about also > having a chrome://conkeror-test something like the following. Then I > don't need conkeror_source_code_path. (I'd chop this into 2 or 3 > commits to push.) Before adding a chrome domain for conkeror-test, I'd like to take a step back and just ask, does this really represent a qualitative improvement to our unit testing capabilities? What kinds of things does it let us test, beyond this particular case? -- John Foerch From kettler at internode.on.net Fri Nov 27 02:16:20 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 27 Nov 2009 20:46:20 +1030 Subject: [Conkeror] [RFC] index-webjump: test suite In-Reply-To: <20091127021640.GB24963@hecubus> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-11-git-send-email-kettler@internode.on.net> <20091117170352.GA20767@hecubus> <4B03F921.2050908@internode.on.net> <20091118175521.GA31863@hecubus> <4B053918.8070704@internode.on.net> <20091127021640.GB24963@hecubus> Message-ID: <4B0FA6F4.7000206@internode.on.net> > Before adding a chrome domain for conkeror-test, I'd like to take a step > back and just ask, does this really represent a qualitative improvement to > our unit testing capabilities? What kinds of things does it let us test, > beyond this particular case? I don't have a strong justification for it, I just thought it was neat. It gives us a way to refer to local test data. The only other (pretty weak) instances I can think of are: * Test html files for automated testing of basic browser navigation. * A test html file for a page mode. Such a test case is probably not very useful though, as page modes depend entirely on the vagaries of changes to web sites out of our control. * Invoking test cases from anywhere with conkeror -q -batch -l chrome://conkeror-test/content/simple/keymap.js (This will need changes to load_rc().) regards, David From jjfoerch at earthlink.net Fri Nov 27 09:05:39 2009 From: jjfoerch at earthlink.net (John J. Foerch) Date: Fri, 27 Nov 2009 12:05:39 -0500 Subject: [Conkeror] [RFC] index-webjump: test suite In-Reply-To: <4B0FA6F4.7000206@internode.on.net> References: <1258458270-6371-1-git-send-email-kettler@internode.on.net> <1258458270-6371-11-git-send-email-kettler@internode.on.net> <20091117170352.GA20767@hecubus> <4B03F921.2050908@internode.on.net> <20091118175521.GA31863@hecubus> <4B053918.8070704@internode.on.net> <20091127021640.GB24963@hecubus> <4B0FA6F4.7000206@internode.on.net> Message-ID: <20091127170539.GA31955@hecubus> On Fri, Nov 27, 2009 at 08:46:20PM +1030, David Kettler wrote: > >Before adding a chrome domain for conkeror-test, I'd like to take a step > >back and just ask, does this really represent a qualitative improvement to > >our unit testing capabilities? What kinds of things does it let us test, > >beyond this particular case? > > I don't have a strong justification for it, I just thought it was neat. > > It gives us a way to refer to local test data. The only other > (pretty weak) instances I can think of are: > > * Test html files for automated testing of basic browser navigation. We have almost zero test coverage for UI stuff right now. If walnut could be enhanced to be able to test some of these things, that would be a very positive improvement. > > * A test html file for a page mode. Such a test case is probably > not very useful though, as page modes depend entirely on the > vagaries of changes to web sites out of our control. > No feeling on this... would rather wait until page-modes have been split up as we talked about in another thread, before worrying about testing them. > * Invoking test cases from anywhere with > conkeror -q -batch -l chrome://conkeror-test/content/simple/keymap.js > (This will need changes to load_rc().) > That would be nice. We should only allow loading js from trusted url schemes though... file: and chrome:. -- John Foerch