From a583ad1ede161b03ad5bea51aa18aa21c016b9d4 Mon Sep 17 00:00:00 2001 From: David Kettler Date: Fri, 31 Oct 2008 16:39:28 +1030 Subject: [PATCH] Added page mode for the Gmane mailing list archive. This just arranges to pass keystrokes through to the Loom web interface to the Gmane news spool. --- modules/page-modes/gmane.js | 85 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 modules/page-modes/gmane.js diff --git a/modules/page-modes/gmane.js b/modules/page-modes/gmane.js new file mode 100644 index 0000000..d7d3dd1 --- /dev/null +++ b/modules/page-modes/gmane.js @@ -0,0 +1,85 @@ +/** + * (C) Copyright 2008 David Kettler + * + * Use, modification, and distribution are subject to the terms specified in the + * COPYING file. +**/ + +require("content-buffer.js"); +require("bindings/default/content-buffer/normal.js"); + +define_keymap("gmane_keymap", $parent = content_buffer_normal_keymap); + + +/* Rebind most overridden commands. */ +define_key(gmane_keymap, "C-c c", "copy"); +define_key(gmane_keymap, "C-c +", "zoom-in-text"); +define_key(gmane_keymap, "C-c -", "zoom-out-text"); +define_key(gmane_keymap, "C-c f", "follow"); +define_key(gmane_keymap, "C-c l", "go-back"); + + +/* + The f keystroke is hard to live without; put this in rc to restore it: + define_key(gmane_keymap, "f", "follow"); +*/ + +/* + Loom keystrokes. http://gmane.org/loom-help.php + + SPC Page down, then next article + DEL Page up the current article + n Select the next unread article + p Select the previous unread article + N Select the next article + P Select the previous article + + Go to the next page + - Go to the previous page + f Go to the first page + l Go to the last page + c Catch up -- mark all articles as read + C Clear -- mark all articles as unread + R Refresh the group + < Go to the first article on the page + > Go to the last article on the page + . Go to the first article currently displayed in the frame + down Move focus to the next subject + up Move focus to the previous subject +* q Quit and go to the list of groups + S Report the current article as spam +* D Disable all Loom keystrokes + + Keystrokes marked with * are not passed through in this mode. + + There's a disable, but no enable. Maybe should provide a way to + switch the keymap in and out. +*/ + +define_key(gmane_keymap, "space", null, $fallthrough); +define_key(gmane_keymap, "back_space", null, $fallthrough); +define_key(gmane_keymap, "n", null, $fallthrough); +define_key(gmane_keymap, "p", null, $fallthrough); +define_key(gmane_keymap, "N", null, $fallthrough); +define_key(gmane_keymap, "P", null, $fallthrough); +define_key(gmane_keymap, "+", null, $fallthrough); +define_key(gmane_keymap, "-", null, $fallthrough); +define_key(gmane_keymap, "f", null, $fallthrough); +define_key(gmane_keymap, "l", null, $fallthrough); +define_key(gmane_keymap, "c", null, $fallthrough); +define_key(gmane_keymap, "C", null, $fallthrough); +define_key(gmane_keymap, "R", null, $fallthrough); +define_key(gmane_keymap, "<", null, $fallthrough); +define_key(gmane_keymap, ">", null, $fallthrough); +define_key(gmane_keymap, ".", null, $fallthrough); +define_key(gmane_keymap, "down", null, $fallthrough); +define_key(gmane_keymap, "up", null, $fallthrough); +define_key(gmane_keymap, "S", null, $fallthrough); + + +define_page_mode("gmane_mode", "Gmane", + $enable = function (buffer) { + buffer.local_variables.content_buffer_normal_keymap = gmane_keymap; + }); + +var gmane_re = build_url_regex($domain = /(news|thread)\.gmane/, $tlds = ["org"]); +auto_mode_list.push([gmane_re, gmane_mode]); -- 2.11.4.GIT