From andrewmcintosh at yahoo.com Fri May 1 21:00:13 2009 From: andrewmcintosh at yahoo.com (andrew mcintosh) Date: Fri, 1 May 2009 21:00:13 -0700 (PDT) Subject: [Conkeror] M-: and C-: as M-; and C-; Message-ID: <398399.45627.qm@web54203.mail.re2.yahoo.com> Whenever I type 'M-:' or 'C-:', Conkeror recognizes them as 'M-;' and 'C-;' (colons being interpreted as semicolons, but _only_ with the CTRL or META keys). When i just type ':' (as right now, I'm doing this from Conkeror), everything's all right. I don't get this problem in Emacs. I'm using conkeror.mozdev.org conkeror 0.9 (commit 6944096a1af033d0aa70d8b4cc19b271e0d832b1, Debian-0.9~git080629-2) on Ubuntu 9.04. Does anyone else get this? Is it a bug? Or is there a way around it? From deniz.a.m.dogan at gmail.com Sat May 2 05:00:49 2009 From: deniz.a.m.dogan at gmail.com (Deniz Dogan) Date: Sat, 2 May 2009 14:00:49 +0200 Subject: [Conkeror] M-: and C-: as M-; and C-; In-Reply-To: <398399.45627.qm@web54203.mail.re2.yahoo.com> References: <398399.45627.qm@web54203.mail.re2.yahoo.com> Message-ID: <7b501d5c0905020500q1843c1fcia60f1ce8750a9c99@mail.gmail.com> 2009/5/2 andrew mcintosh : > > Whenever I type 'M-:' or 'C-:', Conkeror recognizes them as 'M-;' and 'C-;' (colons being interpreted as semicolons, but _only_ with the CTRL or META keys). > > When i just type ':' (as right now, I'm doing this from Conkeror), everything's all right. ?I don't get this problem in Emacs. > > I'm using conkeror.mozdev.org conkeror 0.9 (commit 6944096a1af033d0aa70d8b4cc19b271e0d832b1, Debian-0.9~git080629-2) on Ubuntu 9.04. > > Does anyone else get this? ?Is it a bug? ?Or is there a way around it? Sounds like a classic example of xmodmap madness. Do you use xmodmap or anything similar? Deniz From jjfoerch at earthlink.net Sun May 3 16:47:11 2009 From: jjfoerch at earthlink.net (John J Foerch) Date: Sun, 03 May 2009 19:47:11 -0400 Subject: [Conkeror] M-: and C-: as M-; and C-; References: <398399.45627.qm@web54203.mail.re2.yahoo.com> Message-ID: <87vdohwxz4.fsf@earthlink.net> andrew mcintosh writes: > Whenever I type 'M-:' or 'C-:', Conkeror recognizes them as 'M-;' and 'C-;' (colons being interpreted as semicolons, but _only_ with the CTRL or META keys). > > When i just type ':' (as right now, I'm doing this from Conkeror), everything's all right. I don't get this problem in Emacs. > > I'm using conkeror.mozdev.org conkeror 0.9 (commit 6944096a1af033d0aa70d8b4cc19b271e0d832b1, Debian-0.9~git080629-2) on Ubuntu 9.04. > > Does anyone else get this? Is it a bug? Or is there a way around it? What version of xulrunner do you have? `aptitude show xulrunner-1.9' will be more informative than `xulrunner-1.9 -version' for this question. -- John Foerch From fosslistmail at googlemail.com Tue May 5 05:31:39 2009 From: fosslistmail at googlemail.com (foss[ilized]) Date: Tue, 5 May 2009 20:31:39 +0800 Subject: [Conkeror] Error when running custom command Message-ID: <2b0573450905050531o659c1c39p5af70e13c6d3c385@mail.gmail.com> I followed the tip at: http://conkeror.org/Tips#ManipulateProxySettings for configuring the proxy settings interactively. But when I enter values for the proxy server and the proxy port, via the following command sequence: (1) M-x set-proxy-session (2) server: localhost (3) port: 8118 [for privoxy] I get the following error: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.setCharPref] set_branch_pref()@chrome://conkeror/content/utils.js:491 default_pref()@chrome://conkeror/content/utils.js:501 session_pref()@chrome://conkeror/content/utils.js:558 set_proxy_session()@chrome://conkeror/content/rc.js -> file:///home/cachalot/.conkerorrc:20 anonymous()@chrome://conkeror/content/rc.js -> file:///home/cachalot/.conkerorrc:38 _do_call()@chrome://conkeror/content/coroutine.js:278 anonymous()@chrome://conkeror/content/coroutine.js:410 exit_minibuffer()@chrome://conkeror/content/minibuffer-read.js:436 anonymous()@chrome://conkeror/content/minibuffer-read.js:439 call_interactively()@chrome://conkeror/content/interactive.js:133 keypress_handler()@chrome://conkeror/content/keyboard.js:518 I'm running the Debian conkeror package 0.9~git090223-1 with the xulrunner package 1.9.0.6-1. Is this a known problem? Thanks in advance. From rohan.nicholls at googlemail.com Wed May 6 03:21:40 2009 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Wed, 6 May 2009 12:21:40 +0200 Subject: [Conkeror] return key not working in text fields Message-ID: Hi all, I did an upgrade of ubuntu lately, and since then the return button in text boxes is not working. It works in the minibuffer if I am running commands etc. but not in text boxes. Has anyone else had this problem? I have changed nothing else, on updates etc. So this seems something to do with xulrunner. The version of xulrunner: Mozilla XULRunner 1.8.1.22pre_0000000000 And the last two commit in git that I have is: commit 9d9abfed2dfb20a9fa6e56821e69315e7c2ca7c5 Author: John Foerch Date: Mon Apr 27 18:08:04 2009 -0400 reddit-mode: substantial rewrite new user variable, reddit_end_behavior: Controls the behavior of reddit-next-link and reddit-prev-link when on the last or first link of the page respectively. Allowed values are "stop"(default), "wrap", and "page". To make reddit-mode behave as before, put this in your rc: reddit_end_behavior = 'page'; commit 05dd8e5122c01ee45abd93fa12e240353f0bf18d Author: John Foerch Date: Mon Apr 27 18:03:41 2009 -0400 follow-current* commands browser-object-focused-element: new browser object. new commands: follow-current, follow-current-new-buffer, follow-current-new-buffer-background, follow-current-new-window: new bindings: return = follow-current o = follow-current-new-buffer trivial bugfix: C-return binding for non-existent command removed I searched the list for any reports of the same problem, but had no luck, hence the email. Thanks for any help. Rohan From rohan.nicholls at googlemail.com Wed May 6 03:29:15 2009 From: rohan.nicholls at googlemail.com (Rohan Nicholls) Date: Wed, 6 May 2009 12:29:15 +0200 Subject: [Conkeror] return key not working in text fields In-Reply-To: References: Message-ID: Sorry about the noise. I have done a git pull, and everything is working as it should. :-$ On Wed, May 6, 2009 at 12:21 PM, Rohan Nicholls wrote: > Hi all, > > I did an upgrade of ubuntu lately, and since then the return button in > text boxes is not working. ?It works in the minibuffer if I am running > commands etc. but not in text boxes. > > Has anyone else had this problem? ?I have changed nothing else, on > updates etc. So this seems something to do with xulrunner. > > The version of xulrunner: Mozilla XULRunner 1.8.1.22pre_0000000000 > And the last two commit in git that I have is: > commit 9d9abfed2dfb20a9fa6e56821e69315e7c2ca7c5 > Author: John Foerch > Date: ? Mon Apr 27 18:08:04 2009 -0400 > > ? ?reddit-mode: substantial rewrite > > ? ?new user variable, reddit_end_behavior: > ? ? ?Controls the behavior of reddit-next-link and reddit-prev-link when > ? ?on the last or first link of the page respectively. ?Allowed values are > ? ?"stop"(default), "wrap", and "page". ?To make reddit-mode behave as > ? ?before, put this in your rc: > > ? ? ?reddit_end_behavior = 'page'; > commit 05dd8e5122c01ee45abd93fa12e240353f0bf18d > Author: John Foerch > Date: ? Mon Apr 27 18:03:41 2009 -0400 > > ? ?follow-current* commands > > ? ?browser-object-focused-element: new browser object. > > ? ?new commands: follow-current, follow-current-new-buffer, > ? ?follow-current-new-buffer-background, follow-current-new-window: > > ? ?new bindings: > ? ? ?return = follow-current > ? ? ?o = follow-current-new-buffer > > ? ?trivial bugfix: > ? ? ?C-return binding for non-existent command removed > > > I searched the list for any reports of the same problem, but had no > luck, hence the email. > > Thanks for any help. > > Rohan > From kettler at internode.on.net Fri May 8 05:37:04 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 8 May 2009 22:07:04 +0930 Subject: [Conkeror] [PATCH] Add TAGS to .gitignore Message-ID: <1241786227-11918-1-git-send-email-kettler@internode.on.net> --- .gitignore | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index 2f3bbab..78b2019 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ /conkeror.xulapp #*# .#* +TAGS xulrunner-stub conkeror-spawn-helper conkeror -- 1.6.2.4 From kettler at internode.on.net Fri May 8 05:37:07 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 8 May 2009 22:07:07 +0930 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <1241786227-11918-3-git-send-email-kettler@internode.on.net> References: <1241786227-11918-1-git-send-email-kettler@internode.on.net> <1241786227-11918-2-git-send-email-kettler@internode.on.net> <1241786227-11918-3-git-send-email-kettler@internode.on.net> Message-ID: <1241786227-11918-4-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 2ca52de..be894d6 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 503a09e..25cdebf 100644 --- a/modules/minibuffer-completion.js +++ b/modules/minibuffer-completion.js @@ -266,7 +266,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; } @@ -288,11 +288,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 53ec922..d72d9c0 100644 --- a/modules/minibuffer-read.js +++ b/modules/minibuffer-read.js @@ -78,6 +78,7 @@ function text_entry_minibuffer_state(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.2.4 From kettler at internode.on.net Fri May 8 05:37:05 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 8 May 2009 22:07:05 +0930 Subject: [Conkeror] [PATCH] Show errors from completers, etc. In-Reply-To: <1241786227-11918-1-git-send-email-kettler@internode.on.net> References: <1241786227-11918-1-git-send-email-kettler@internode.on.net> Message-ID: <1241786227-11918-2-git-send-email-kettler@internode.on.net> If an interactive_error was thrown in a minibuffer completer function, the error was previously lost. This commit ensures that the error message is displayed in the minibuffer. 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. --- 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 1426acf..7d7d9c7 100644 --- a/modules/download-manager.js +++ b/modules/download-manager.js @@ -452,6 +452,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 be57beb..c6bf106 100644 --- a/modules/help.js +++ b/modules/help.js @@ -53,12 +53,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 */, false /* allow untrusted */); diff --git a/modules/minibuffer-read.js b/modules/minibuffer-read.js index 743181f..53ec922 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.2.4 From kettler at internode.on.net Fri May 8 05:37:06 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 8 May 2009 22:07:06 +0930 Subject: [Conkeror] [PATCH] Fix editing source from help buffer. In-Reply-To: <1241786227-11918-2-git-send-email-kettler@internode.on.net> References: <1241786227-11918-1-git-send-email-kettler@internode.on.net> <1241786227-11918-2-git-send-email-kettler@internode.on.net> Message-ID: <1241786227-11918-3-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 81f05fe..d7bcf3c 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -394,7 +394,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.2.4 From kettler at internode.on.net Fri May 8 05:40:40 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 8 May 2009 22:10:40 +0930 Subject: [Conkeror] [PATCH] index-webjump: New module to define webjumps for index pages. Message-ID: <1241786440-12057-1-git-send-email-kettler@internode.on.net> A webjump to access URLs referenced from an index page can be 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. For example, have this in your rc: require("index-webjump.js"); index_webjumps_directory = get_home_directory(); index_webjumps_directory.appendRelativePath(".conkerorrc/index-webjumps"); define_xpath_webjump( "gitdoc", "http://www.kernel.org/pub/software/scm/git/docs/", '//xhtml:dt/xhtml:a'); and enable completions with M-x webjump-get-index, selecting gitdoc. The gitdoc webjump will now visit the git documentation page selected. This module also subsumes define_gitweb_summary_webjump, which results in changes to how gitweb webjumps are set up. The $completer option is no longer available. 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 An enhancement (particularly for bloated pages) would be to extract the completions from the index file and write them to, say, a json file. The index file could then be discarded. Could also possibly filter, eg. with "tidy -asxhtml" (see note in code regarding html). --- This patch only shows the new index-webjumps.js module. The eventual commit will also remove the existing gitweb-webjumps.js module. The wiki Webjumps and BreakingChanges pages will also be updated. --- modules/index-webjump.js | 277 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 277 insertions(+), 0 deletions(-) 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..16f7953 --- /dev/null +++ b/modules/index-webjump.js @@ -0,0 +1,277 @@ +/** + * (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."); + + +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, + + /* 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); + save_uri(load_spec(this.url), this.file, + $buffer = buffer, $use_cache = false, + $temp_file = true); + }, + + /* 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", + + 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. + * + * Unfortunately, an html (rather than xhtml) index page won't work + * (see https://bugzilla.mozilla.org/show_bug.cgi?id=102699). As a + * workaround, go ahead and download the index then manually run + * "tidy -asxhtml" to convert to xhtml. + */ +define_keywords("$alternative", "$index_file"); +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); +} + +/** + * 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"); +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); +} -- 1.6.2.4 From kettler at internode.on.net Fri May 8 05:42:05 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 8 May 2009 22:12:05 +0930 Subject: [Conkeror] [PATCH] Provide buttons on the mode-line for basic browser control. Message-ID: <1241786525-12105-1-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. Hopefully they are useful for novices and casual users. They can be enabled with: 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. --- There is no change in functionality compared with the previous version of this patch, but the code makes better use of prototypes. When I turn this on now, I don't use it. But when I first started using conkeror I would have found it helpful. --- modules/mode-line.js | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 83 insertions(+), 0 deletions(-) diff --git a/modules/mode-line.js b/modules/mode-line.js index 72315f7..cbe45b6 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; @@ -224,6 +227,66 @@ loading_count_widget.prototype.update = function () { this.view.text = ""; }; + +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 ctx = { window: window, key_sequence: [], sticky_modifiers: 0 }; + call_interactively(ctx, command); + }, false); + + element.addEventListener("mouseover", function (event) { + var msg = "Button: " + command; + var list = find_command_in_keymap(window.buffers.current, 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_adder(widget_constructor) { if (!('mode_line_adder' in widget_constructor)) widget_constructor.mode_line_adder = function (window) { @@ -232,6 +295,26 @@ function mode_line_adder(widget_constructor) { return widget_constructor.mode_line_adder; } +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"], + ["go-back", "go-back"], + ["go-forward", "go-forward"], + ["reload", "refresh"], + ["kill-current-buffer", "close"], + ["buffer-previous", "go-up"], + ["buffer-next", "go-down"], + ["help-page", "help"], +]; + add_hook("mode_line_hook", mode_line_adder(current_buffer_name_widget)); add_hook("mode_line_hook", mode_line_adder(clock_widget)); add_hook("mode_line_hook", mode_line_adder(current_buffer_scroll_position_widget)); -- 1.6.2.4 From jeremy at jeremyms.com Fri May 8 11:02:52 2009 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Fri, 08 May 2009 11:02:52 -0700 Subject: [Conkeror] [PATCH] Show errors from completers, etc. In-Reply-To: <1241786227-11918-2-git-send-email-kettler@internode.on.net> (David Kettler's message of "Fri, 08 May 2009 22:07:05 +0930") References: <1241786227-11918-1-git-send-email-kettler@internode.on.net> <1241786227-11918-2-git-send-email-kettler@internode.on.net> Message-ID: <87ws8rwjzn.fsf@jeremyms.com> David Kettler writes: > If an interactive_error was thrown in a minibuffer completer function, > the error was previously lost. This commit ensures that the error > message is displayed in the minibuffer. > 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. I'll take a closer look at this patch later today when I have more time. In some with regard to completions I had specifically intended that an exception being thrown would just result in no completions being generated. -- Jeremy Maitin-Shepard From jeremy at jeremyms.com Fri May 8 11:04:23 2009 From: jeremy at jeremyms.com (Jeremy Maitin-Shepard) Date: Fri, 08 May 2009 11:04:23 -0700 Subject: [Conkeror] [PATCH] Let completion functions set the match_required state. In-Reply-To: <1241786227-11918-4-git-send-email-kettler@internode.on.net> (David Kettler's message of "Fri, 08 May 2009 22:07:07 +0930") References: <1241786227-11918-1-git-send-email-kettler@internode.on.net> <1241786227-11918-2-git-send-email-kettler@internode.on.net> <1241786227-11918-3-git-send-email-kettler@internode.on.net> <1241786227-11918-4-git-send-email-kettler@internode.on.net> Message-ID: <87skjfwjx4.fsf@jeremyms.com> David Kettler writes: > 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. I'll also take a closer look at this patch later today. -- Jeremy Maitin-Shepard From brian at microcomaustralia.com.au Sun May 10 21:53:41 2009 From: brian at microcomaustralia.com.au (Brian May) Date: Mon, 11 May 2009 14:53:41 +1000 Subject: [Conkeror] conkeror can't find xulrunner Message-ID: <20090511045341.GH7918@sys11.in.vpac.org> For some reason I thought this was already fixed: brian at sys11:~/tree/conkeror$ conkeror /home/brian/tree/conkeror/contrib/run-conkeror: line 65: /usr/lib/xulrunner-1.9.0.9/xulrunner: No such file or directory /home/brian/tree/conkeror/contrib/run-conkeror: line 65: exec: /usr/lib/xulrunner-1.9.0.9/xulrunner: cannot execute: No such file or directory brian at sys11:~/tree/conkeror$ which xulrunner /usr/bin/xulrunner brian at sys11:~/tree/conkeror$ which xulrunner-1.9 /usr/bin/xulrunner-1.9 This happened after installing the latest security updates for Intrepid. -- Brian May From dcl441-bugs at yahoo.com Fri May 15 06:02:42 2009 From: dcl441-bugs at yahoo.com (Daniel Clemente) Date: Fri, 15 May 2009 15:02:42 +0200 Subject: [Conkeror] For those who miss the blackened theme References: <8763i4dwzn.fsf@earthlink.net> <20090320163842.GI3980@sym.noone.org> <87ljqy4itk.fsf@yahoo.com> <873acbpkar.fsf_-_@CPU107.opentrends.net> Message-ID: <87preay0wd.fsf@CPU107.opentrends.net> El dc, abr 15 2009, Nicholas A. Zigarovich va escriure: > No need to run an old version. Conkeror still supports themes, but > only includes the default. > > 1. Check out: git clone git://repo.or.cz/conkeror.git > 2. Go back in time: cd conkeror && git checkout > a38b3a3630ebf85a403207b37220cee9790d3a82 > 3. Copy styles/blackened somewhere: cp -r styles/blackened /path/to/somewhere > 4. Return to the present: git checkout master > 5. Add the following to ~/.conkerorrc: > > theme_load_paths.push("/path/to/somewhere"); > theme_load("blackened"); > > After restarting, conkeror should be blackened. > > Cheers, > Hi, this was a useful information (thanks, by the way), which I would like to put into the wiki, concretely as a subsection of ?2. Theming? in http://conkeror.org/Appearance However I'm not allowed to edit the wiki. Can someone add it there? Thanks -- Daniel From nicktastic at gmail.com Fri May 15 08:44:05 2009 From: nicktastic at gmail.com (Nicholas A. Zigarovich) Date: Fri, 15 May 2009 11:44:05 -0400 Subject: [Conkeror] For those who miss the blackened theme In-Reply-To: <87preay0wd.fsf@CPU107.opentrends.net> References: <8763i4dwzn.fsf@earthlink.net> <20090320163842.GI3980@sym.noone.org> <87ljqy4itk.fsf@yahoo.com> <873acbpkar.fsf_-_@CPU107.opentrends.net> <87preay0wd.fsf@CPU107.opentrends.net> Message-ID: What is your username at the wiki? On Fri, May 15, 2009 at 9:02 AM, Daniel Clemente wrote: > El dc, abr 15 2009, Nicholas A. Zigarovich va escriure: >> No need to run an old version. Conkeror still supports themes, but >> only includes the default. >> >> 1. Check out: git clone git://repo.or.cz/conkeror.git >> 2. Go back in time: cd conkeror && git checkout >> a38b3a3630ebf85a403207b37220cee9790d3a82 >> 3. Copy styles/blackened somewhere: cp -r styles/blackened /path/to/somewhere >> 4. Return to the present: git checkout master >> 5. Add the following to ~/.conkerorrc: >> >> ? ?theme_load_paths.push("/path/to/somewhere"); >> ? ?theme_load("blackened"); >> >> After restarting, conkeror should be blackened. >> >> Cheers, >> > > ?Hi, > > ?this was a useful information (thanks, by the way), which I would like to put into the wiki, concretely as a subsection of ?2. Theming? in http://conkeror.org/Appearance > > ?However I'm not allowed to edit the wiki. Can someone add it there? > > ?Thanks > > -- Daniel > > _______________________________________________ > Conkeror mailing list > Conkeror at mozdev.org > https://www.mozdev.org/mailman/listinfo/conkeror > From heart.of.sea.xp at gmail.com Sun May 17 22:10:37 2009 From: heart.of.sea.xp at gmail.com (Highfield) Date: Mon, 18 May 2009 13:10:37 +0800 Subject: [Conkeror] A question about the command follow In-Reply-To: References: Message-ID: <4A10EDCD.6080308@gmail.com> hi, I install a new version of the nightly build conkeor on May 17. And I found a little change in the command follow. Originally, conkeror open a page in the current buffer, no matter whether the page ask it to. But now, thing's changed. I kind of like the behavior in the past. Would someone told me how to do that. From dcl441-bugs at yahoo.com Mon May 18 00:51:02 2009 From: dcl441-bugs at yahoo.com (Daniel Clemente) Date: Mon, 18 May 2009 09:51:02 +0200 Subject: [Conkeror] For those who miss the blackened theme References: <8763i4dwzn.fsf@earthlink.net> <20090320163842.GI3980@sym.noone.org> <87ljqy4itk.fsf@yahoo.com> <873acbpkar.fsf_-_@CPU107.opentrends.net> <87preay0wd.fsf@CPU107.opentrends.net> Message-ID: <87iqjyluhl.fsf@CPU107.opentrends.net> El dv, mai 15 2009, Nicholas A. Zigarovich va escriure: > What is your username at the wiki? DanielClemente From jjfoerch at earthlink.net Mon May 18 16:58:43 2009 From: jjfoerch at earthlink.net (John J Foerch) Date: Mon, 18 May 2009 19:58:43 -0400 Subject: [Conkeror] A question about the command follow References: <4A10EDCD.6080308@gmail.com> Message-ID: <87r5ymvu8c.fsf@earthlink.net> Highfield writes: > hi, > I install a new version of the nightly build conkeor on May 17. And > I found a little change in the command follow. > Originally, conkeror open a page in the current buffer, no matter > whether the page ask it to. But now, thing's changed. > I kind of like the behavior in the past. Would someone told me how to > do that. set_handler("follow", alternates(follow_current_buffer, follow_new_buffer, follow_new_window)); -- John Foerch From phil at shellarchive.co.uk Fri May 22 13:25:27 2009 From: phil at shellarchive.co.uk (Phil Jackson) Date: Fri, 22 May 2009 21:25:27 +0100 Subject: [Conkeror] [PATCH] Filename manipulation on download Message-ID: <87d4a0ga14.fsf@shellarchive.co.uk> Hi all, Please find a patch that allows the user to define some behaviour for files when downloading. -------------- next part -------------- A non-text attachment was scrubbed... Name: filename-manip-for-download-patch.diff Type: text/x-diff Size: 2021 bytes Desc: not available URL: -------------- next part -------------- Cheers, Phil -- Philip Jackson web: http://www.shellarchive.co.uk From jjfoerch at earthlink.net Tue May 26 16:03:36 2009 From: jjfoerch at earthlink.net (John J Foerch) Date: Tue, 26 May 2009 19:03:36 -0400 Subject: [Conkeror] hooks, functions and features of interactive References: <87r60r7gjj.fsf@internode.on.net> Message-ID: <87my8zwjp3.fsf@earthlink.net> David Kettler writes: > Another feature of interactive that would be useful is the alternates > mechanism. For instance I usually want url_remoting_fn to > OPEN_NEW_BUFFER. But sometimes I want OPEN_NEW_BUFFER_BACKGROUND. I > currently use the code below, but alternates would be nicer. > > Does this sound like something worth pursuing? > > Current code that would be neater with alternates: > > /* For url_remoting_fn; load in a new buffer. If -uu is given on the > * command line, do so in the background. */ > function load_url_in_new_buffer_perhaps_bg(url, ctx) { > create_buffer_in_current_window( > buffer_creator(content_buffer, $load = url, > $configuration = ctx.config), > ctx.prefix_argument ? OPEN_NEW_BUFFER_BACKGROUND : OPEN_NEW_BUFFER, > !ctx.prefix_argument); > } > > url_remoting_fn = load_url_in_new_buffer_perhaps_bg; Hi David, This is very much like what I would like to do, but messier than I want to do it. You have noticed the existence of the command-line switch `-uu' which allows you to give a universal-arg prefix to a command called by the `-f' switch. I do intend to extend this behavior to urls passed on the command line, so that `alternates' can be used. However, to accomplish that, I would like to deprecate the variable `url_remoting_fn' and replace it by something along the lines of `default_remoting_command'. Its value will be the name of an interactive command instead of a function. That command will respect -uu. This change requires a modification to the interactive system to remove the assumption (for some commands) that an existing window is available. Incidentally, the reason that -uu has such a funny name is that `-u' is already consumed by Mozilla. I was also thinking of changing it to `+u' to get around that limitation, but using `+' as a switch prefix will require a little adjustment of the command-line module, and I haven't gotten around to it. It's going to take me a long time to catch up with all the outstanding patches on the mailing list, but I am mindful of them and appreciate your patience. I'll try to address each item individually. -- John Foerch From mashdot at toshine.net Wed May 27 10:25:15 2009 From: mashdot at toshine.net ('Mash) Date: Wed, 27 May 2009 18:25:15 +0100 Subject: [Conkeror] xulrunner-1.9 high CPU load? Message-ID: <20090527172515.GA2050@grace.toshine.net> Is anyone else noticing that xulrunner-1.9 is using > 80% CPU, by just opening Conkeror? I thought that maybe it was to do with the "flashplugin-nonfree" and so removed it. But still, just opening Conkeror... 53, 83, 85; then just hitting "g" puts it up to 89. Linux version 2.6.26-2-686 (Debian 4.1.2-25) conkeror 0.9~git090223-1 xulrunner-1.9 1.9.0.7-1 'Mash From nicktastic at gmail.com Wed May 27 10:48:23 2009 From: nicktastic at gmail.com (Nicholas A. Zigarovich) Date: Wed, 27 May 2009 13:48:23 -0400 Subject: [Conkeror] xulrunner-1.9 high CPU load? In-Reply-To: <20090527172515.GA2050@grace.toshine.net> References: <20090527172515.GA2050@grace.toshine.net> Message-ID: This is a known bug in xulrunner. A work-around for Conkeror was committed mid-March. I suggest using current git. Cheers, - Nick On Wed, May 27, 2009 at 1:25 PM, 'Mash wrote: > > Is anyone else noticing that xulrunner-1.9 is using > 80% CPU, by just opening Conkeror? > > I thought that maybe it was to do with the "flashplugin-nonfree" and so removed it. > But still, just opening Conkeror... 53, 83, 85; then just hitting "g" puts it up to 89. > > > Linux version 2.6.26-2-686 (Debian 4.1.2-25) > > conkeror ? 0.9~git090223-1 > xulrunner-1.9 ? 1.9.0.7-1 > > > 'Mash > _______________________________________________ > Conkeror mailing list > Conkeror at mozdev.org > https://www.mozdev.org/mailman/listinfo/conkeror > From kettler at internode.on.net Fri May 29 02:05:22 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 29 May 2009 18:35:22 +0930 Subject: [Conkeror] hooks, functions and features of interactive In-Reply-To: <87my8zwjp3.fsf@earthlink.net> References: <87r60r7gjj.fsf@internode.on.net> <87my8zwjp3.fsf@earthlink.net> Message-ID: <4A1FA552.4060907@internode.on.net> J Foerch writes: > I would like to deprecate the variable `url_remoting_fn' and replace > it by something along the lines of `default_remoting_command'. Its > value will be the name of an interactive command instead of a > function. That command will respect -uu. That sounds good. > This change requires a modification to the interactive system to > remove the assumption (for some commands) that an existing window is > available. Is that necesary? The command_line_handler for "uu" has this code: if (! ctx.window) ctx.window = window_watcher.activeWindow; Provided that the conkeror server always has a window open, won't that suffice? If so, changing to default_remoting_command will be straightforward. > It's going to take me a long time to catch up with all the outstanding > patches on the mailing list, but I am mindful of them and appreciate > your patience. I'll try to address each item individually. Thanks, David From kettler at internode.on.net Fri May 29 02:09:58 2009 From: kettler at internode.on.net (David Kettler) Date: Fri, 29 May 2009 18:39:58 +0930 Subject: [Conkeror] [PATCH] Show errors from completers, etc. In-Reply-To: <87ws8rwjzn.fsf@jeremyms.com> References: <1241786227-11918-1-git-send-email-kettler@internode.on.net> <1241786227-11918-2-git-send-email-kettler@internode.on.net> <87ws8rwjzn.fsf@jeremyms.com> Message-ID: <4A1FA666.1050302@internode.on.net> [I responded to Jeremy previously, but omitted the list.] Jeremy Maitin-Shepard wrote: > In some with regard to completions I had specifically intended that an > exception being thrown would just result in no completions being > generated. I wanted this behaviour for the xpath index webjumps (see the later patch). In that case they're not useful without the completion data, which must be separately downloaded, so I thought the error message being displayed was more important in that case. Note that this patch just displays the error; it doesn't terminate the minibuffer read and the result is still just that there are no completions. regards, David. From fosslistmail at googlemail.com Sun May 31 07:49:18 2009 From: fosslistmail at googlemail.com (foss[ilized]) Date: Sun, 31 May 2009 22:49:18 +0800 Subject: [Conkeror] Error when running custom command In-Reply-To: References: <2b0573450905050531o659c1c39p5af70e13c6d3c385@mail.gmail.com> Message-ID: <2b0573450905310749r6d726182hcf48c0cbf98c5b90@mail.gmail.com> On 5/26/09, Ramkumar R wrote: Thanks for the sample script! > Just write your own script to do it. Have a look at mine if you like. > It's specific to the proxies I have in my institute, but you can > modify it according to your needs. // Begin code fragment function switch_proxy (window, server_code) { switch(server_code) { case "x": server = "x.x.x.x"; break; //End code fragment Mostly I modified it to reflect my need to specify both server and port. At the moment, the port is more important since I'm running local web filtering proxies like privoxy and bfilter: // Begin code fragment case "P" : server = "127.0.0.1" ; port = 8118 ; break; // End code fragment