Initial commit
authorJoerg Jaspert <joerg@ganneff.de>
Wed, 10 Apr 2013 15:45:47 +0000 (17:45 +0200)
committerJoerg Jaspert <joerg@ganneff.de>
Wed, 10 Apr 2013 15:45:47 +0000 (17:45 +0200)
.conkerorrc/basics.js [new file with mode: 0644]
.conkerorrc/functions.js [new file with mode: 0644]
.conkerorrc/keybindings.js [new file with mode: 0644]
.conkerorrc/modeline.js [new file with mode: 0644]
.conkerorrc/webjumps.js [new file with mode: 0644]

diff --git a/.conkerorrc/basics.js b/.conkerorrc/basics.js
new file mode 100644 (file)
index 0000000..a275b35
--- /dev/null
@@ -0,0 +1,154 @@
+//allow for 'contrib' stuff
+load_paths.unshift("chrome://conkeror-contrib/content/");
+
+// the default page for new buffers.
+homepage = "about:blank";
+
+// give me new tabs; open buffers (tabs) in the background
+require("new-tabs.js");
+require("clicks-in-new-buffer.js");
+require("page-modes/google-search-results.js");
+require("page-modes/wikipedia.js");
+require("index-webjump.js");
+require("extensions/adblockplus.js");
+// require("extensions/noscript.js");
+require("session.js");
+require("block-content-focus-change.js");
+require("favicon");
+
+// require("github");
+require("gmail");
+
+// Some settings
+session_auto_save_auto_load = "prompt";
+url_remoting_fn = load_url_in_new_buffer;
+read_buffer_show_icons = true;
+hints_display_url_panel = true;
+
+
+// auto completion in the minibuffer
+require("minibuffer-completion.js");
+minibuffer_auto_complete_default = true;
+url_completion_use_history = true; // should work since bf05c87405
+url_completion_use_bookmarks = true;
+
+// use emacs as editor
+editor_shell_command = "emacsclient -c";
+
+
+// load urls from the command line in new buffers instead
+// of new windows.
+url_remoting_fn = load_url_in_new_buffer;
+
+// load download buffers in the background in the current
+// window, instead of in new windows.
+download_buffer_automatic_open_target = OPEN_NEW_BUFFER_BACKGROUND;
+
+// save a keystroke when selecting a dom node by number.
+hints_auto_exit_delay = 500;
+hints_ambiguous_auto_exit_delay = 500;
+
+// default directory for downloads and shell commands.
+cwd = get_home_directory();
+cwd.append("Downloads");
+
+// automatically handle some mime types internally.
+content_handlers.set("application/pdf", content_handler_save);
+
+
+// external programs for handling various mime types.
+external_content_handlers.set("application/pdf", "xpdf");
+//external_content_handlers.set("video/*", "urxvtc -e mplayer");
+
+// view source in your editor.
+view_source_use_external_editor = true;
+
+// let xkcd-mode put the funny alt text into the page.
+xkcd_add_title = true;
+
+register_user_stylesheet(make_css_data_uri(
+    ["* { image-rendering: -moz-crisp-edges; }"]));
+
+
+// Enable password management service.
+session_pref("signon.rememberSignons", true);
+session_pref("signon.expireMasterPassword", false);
+session_pref("signon.SignonFileName", "signons.txt");
+Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager); // init
+
+// Allow extensions (like Adblock Plus) to be installed
+session_pref("xpinstall.whitelist.required", false);
+
+//session_pref("font.minimum-size.x-western", 16);
+//session_pref("font.name.serif.x-western", "Gentium");
+
+// When true image documents will be automatically scaled to fit the viewport. 
+session_pref("browser.enable_automatic_image_resizing", true);
+
+// When true, smooth-scrolling will be enabled. 
+session_pref("general.smoothScroll", true);
+
+// A value of true makes Mozilla put the word "Firefox" into your
+// user-agent string, which will trick some websites ua sniffing into
+// thinking you are running firefox.
+session_pref("general.useragent.compatMode.firefox", true);
+
+
+// The list of languages (by their ISO639-1 language code) that the
+// browser exposes to websites. Websites can then use this information
+// to change the the interface language when you visit them. The first
+// languagecode listed has highest priority.
+session_pref("intl.accept_languages", "en, de");
+
+
+
+// Delayed session load
+/*
+
+From http://retroj.net/git/conkerorrc/content-delay.js
+
+This script is a hack that provides delayed loading for content buffers.
+The initial url of a buffer will not be loaded until that buffer is
+switched to.  Precaution is taken that the buffer's display_uri_string
+returns the delayed url, not about:blank, so things like tabs and sessions
+will still work properly.
+
+*/
+
+function content_delay (spec) {
+    this.delayed_load = spec;
+}
+
+function content_delay_init (b) {
+    if (b != b.window.buffers.current &&
+        b instanceof content_buffer)
+    {
+        b.load = content_delay;
+        b.__defineGetter__("display_uri_string",
+            function () {
+                if (this.delayed_load) {
+                    if (this.delayed_load instanceof load_spec)
+                        return load_spec_uri_string(this.delayed_load);
+                    return this.delayed_load;
+                }
+                if (this._display_uri)
+                    return this._display_uri;
+                if (this.current_uri)
+                    return this.current_uri.spec;
+                return "";
+            });
+    }
+}
+
+function content_delay_do_initial_load (b) {
+    if (b.hasOwnProperty("load")) {
+        delete b.load;
+        if (b.hasOwnProperty("delayed_load")) {
+            b.load(b.delayed_load);
+            delete b.delayed_load;
+        }
+    }
+}
+
+add_hook("create_buffer_early_hook", content_delay_init);
+add_hook("select_buffer_hook", content_delay_do_initial_load);
diff --git a/.conkerorrc/functions.js b/.conkerorrc/functions.js
new file mode 100644 (file)
index 0000000..9b2398b
--- /dev/null
@@ -0,0 +1,88 @@
+// copy url with C-c u
+interactive("copy-url",
+        "Copy the current buffer's URL to the clipboard",
+        function(I) {
+            var text = I.window.buffers.current.document.location.href;
+            writeToClipboard(text);
+            I.window.minibuffer.message("copied: " + text);
+        }
+);
+define_key(default_global_keymap, "C-c u", "copy-url");
+
+
+// reload conkerorrc with C-c r
+interactive("reload-config", "reload conkerorrc",
+       function(I) {
+          load_rc();
+          I.window.minibuffer.message("config reloaded");
+       }
+);
+define_key(default_global_keymap, "C-c r", "reload-config");
+
+// org-protocol stuff
+function org_capture (url, title, selection, window) {
+    var cmd_str =
+        'emacsclient \"org-protocol:/capture:/x/'+url+'/'+title+'/'+selection+'\"';
+    if (window != null) {
+      window.minibuffer.message('Issuing ' + cmd_str);
+    }
+    shell_command_blind(cmd_str);
+}
+
+interactive("org-capture", "Clip url, title, and selection to capture via org-protocol",
+          function (I) {
+              org_capture(encodeURIComponent(I.buffer.display_uri_string),
+                        encodeURIComponent(I.buffer.document.title),
+                                encodeURIComponent(I.buffer.top_frame.getSelection()),
+                        I.window);
+          });
+// capture with C-c c
+define_key(content_buffer_normal_keymap, "C-c c", "org-capture");
+
+// See also http://kb.mozillazine.org/Network.proxy.type
+require("minibuffer-completion.js");
+function get_proxy_description(x) {
+  switch (x) {
+    case 'direct':             return 'Direct connection, no proxy';
+    case 'manual':             return 'Manually configured proxy';
+    case 'auto-configuration': return 'Proxy auto-configuration (PAC)';
+    case 'auto-detection':     return 'Auto-detect proxy settings';
+    case 'system-settings':    return 'Use system proxy';
+  }
+  return '';
+}
+
+function get_proxy_value(x) {
+  switch (x) {
+    case 'direct':             return 0;
+    case 'manual':             return 1;
+    case 'auto-configuration': return 2;
+    case 'auto-detection':     return 4;
+    case 'system-settings':    return 5;
+  }
+  return '';
+}
+
+function proxy_type_completer (input, cursor_position, conservative) {
+  var completions = ['direct',
+                    'manual',
+                    'auto-configuration',
+                    'auto-detection',
+                    'system-settings'];
+  yield co_return(
+    prefix_completer($completions = completions,
+                    $get_description = get_proxy_description,
+                    $get_value = get_proxy_value)
+    (input, cursor_position, conservative));
+}
+
+interactive("set-proxy-type", "Change the proxy type or turn proxies off",
+  function(I) {
+    var proxytype = yield I.minibuffer.read(
+      $prompt = "Proxy type to use?",
+      $history = "proxytype",
+      $completer = proxy_type_completer,
+      $match_required = true);
+    user_pref("network.proxy.type", proxytype);
+  }
+);
diff --git a/.conkerorrc/keybindings.js b/.conkerorrc/keybindings.js
new file mode 100644 (file)
index 0000000..98cc7ad
--- /dev/null
@@ -0,0 +1,7 @@
+// Additional key bindings
+
+//define_key(content_buffer_normal_keymap, "C-t", "find-url-new-buffer");
+//define_key(content_buffer_normal_keymap, "C-t", "make-window");
+//define_key(content_buffer_normal_keymap, "C-w", "kill-current-buffer");
+define_key(content_buffer_normal_keymap, "M-left", "back");
+define_key(content_buffer_normal_keymap, "M-right", "forward");
diff --git a/.conkerorrc/modeline.js b/.conkerorrc/modeline.js
new file mode 100644 (file)
index 0000000..24d8405
--- /dev/null
@@ -0,0 +1,27 @@
+require("mode-line.js");
+
+//load_paths.unshift("chrome://conkeror-contrib/content/");
+// funky icons in the modeline
+//require("mode-line-buttons.js");
+//mode_line_add_buttons(standard_mode_line_buttons, true);
+
+// we'd like to see the # of buffers being loaded 
+// favicons hook
+//add_hook("mode_line_hook", mode_line_adder(buffer_icon_widget), true);
+add_hook("mode_line_hook", mode_line_adder(loading_count_widget), true);
+add_hook("mode_line_hook", mode_line_adder(buffer_count_widget), true);
+add_hook("mode_line_hook", mode_line_adder(loading_count_widget), true);
+add_hook("mode_line_hook", mode_line_adder(buffer_count_widget), true);
+
+
+// we don't need a clock
+remove_hook("mode_line_hook", mode_line_adder(clock_widget));
+
+// This is the widget that displays the current url, or for special
+// buffers, their name. To remove it:
+remove_hook("mode_line_hook", mode_line_adder(current_buffer_name_widget));
+
+//hints_minibuffer_annotation_mode(true);
+
+// This widget shows how many buffers are in the current window, and
+// which one is currently selected. To enable it:
diff --git a/.conkerorrc/webjumps.js b/.conkerorrc/webjumps.js
new file mode 100644 (file)
index 0000000..8c2125e
--- /dev/null
@@ -0,0 +1,61 @@
+// "clever" bookmarks. smartlinks. name however. use as "token bla" and it goes to bla on that token
+define_webjump("orgmode-worg","https://www.google.com/cse?cx=002987994228320350715%3Az4glpcrritm&q=%s&sa=Search&siteurl=orgmode.org%2Fworg",$alternative="http://orgmode.org/worg/");// Org-Mode Worg (~Wiki)
+
+// To use The Free Dictionary.com rather than Dictionary.com (the latter is rather cookie-happy):
+define_webjump("dictionary","http://www.thefreedictionary.com/%s");
+
+define_webjump("p", "http://packages.debian.org/search?keywords=%s&searchon=names&suite=unstable&section=all");
+define_webjump("debfile", "http://packages.debian.org/search?searchon=contents&keywords=%s&mode=path&suite=unstable&arch=any");
+define_webjump("debbugs", "http://bugs.debian.org/%s");
+define_webjump("b", "http://bugs.debian.org/%s");
+define_webjump("pts", "http://packages.qa.debian.org/%s");
+define_webjump("buildd", "https://buildd.debian.org/%s");
+define_webjump("buildd-ports", "http://buildd.debian-ports.org/build.php?pkg=%s");
+define_webjump("qa", "http://qa.debian.org/developer.php?login=%s");
+define_webjump("debscreen", "http://screenshots.debian.net/package/%s");
+define_webjump("debsnap", "http://snapshot.debian.org/package/%s/");
+define_webjump("debsec", "http://security-tracker.debian.org/tracker/?query=%s");
+
+define_webjump("github", "http://github.com/search?q=%s&type=Everything");
+define_webjump("gitorious", "http://gitorious.org/search?q=%s");
+
+
+// plain bookmarks
+define_webjump("efu",   "http://emacs-fu.blogspot.com");
+define_webjump("ew",    "http://emacswiki.org");
+
+//browser_prevent_automatic_form_focus_mode(true);
+google_search_bind_number_shortcuts();
+
+// Webjump oneliners
+define_webjump("codesearch", "http://www.google.com/codesearch?q=%s");
+define_webjump("cpan", "http://search.cpan.org/search?query=%s&mode=all");
+define_webjump("leo", "http://dict.leo.org/?lp=ende&lang=de&searchLoc=0&cmpType=relaxed&relink=on&sectHdr=off&spellToler=std&search=%s");
+define_webjump("trans", "http://translate.google.com/translate_t#auto|en|%s");
+define_webjump("urban", "http://www.urbandictionary.com/define.php?term=%s");
+define_webjump("youtube", "http://www.youtube.com/results?search_query=%s&search=Search");
+
+// CVE
+define_webjump("cve", "https://cve.mitre.org/cgi-bin/cvename.cgi?name=%s");
+
+wikipedia_enable_didyoumean = true;
+define_wikipedia_webjumps("en", "de");
+
+define_webjump("wayback",
+  function (url) {
+    if (url) {
+      return "http://web.archive.org/web/*/" + url;
+    } else {
+      return "javascript:window.location.href='http://web.archive.org/web/*/'+window.location.href;";
+    }
+  },
+  $argument = "optional",
+  $completer = history_completer($use_history = false, $use_bookmarks = true));
+
+// ETH Webjumps
+// define_webjump("rt", "https://rt.phys.ethz.ch/rt/Search/Simple.html?q=%s",
+//                      $alternative = "https://rt.phys.ethz.ch/rt/");
+// define_webjump("rtwiki", "https://rt.phys.ethz.ch/wiki/doku.php?do=search&id=%s",
+//                          $alternative = "https://rt.phys.ethz.ch/wiki/doku.php");
+// define_webjump("readme", "https://wiki.phys.ethz.ch/readme/doku.php?do=search&id=%s",
+//                          $alternative = "https://wiki.phys.ethz.ch/readme/doku.php");