bind "C-x left" and "C-x right" to buffer-previous and buffer-next
[conkeror/arlinius.git] / modules / page-modes / gmane.js
blob48e01fcd47cb087231f84f1f0803349281c4867e
1 /**
2  * (C) Copyright 2008 David Kettler
3  * (C) Copyright 2009 John J. Foerch
4  *
5  * Use, modification, and distribution are subject to the terms specified in the
6  * COPYING file.
7 **/
9 require("content-buffer.js");
11 define_keymap("gmane_keymap");
13 /* Rebind most overridden commands. */
14 //BAAAAAAD
15 define_key(gmane_keymap, "C-c c", "copy");
16 define_key(gmane_keymap, "C-c +", "zoom-in-text");
17 define_key(gmane_keymap, "C-c -", "zoom-out-text");
18 define_key(gmane_keymap, "C-c f", "follow");
19 define_key(gmane_keymap, "C-c l", "back");
20 define_key(gmane_keymap, "C-c n", "browser-object-links");
24   The f keystroke is hard to live without; put this in rc to restore it:
25     define_key(gmane_keymap, "f", "follow");
29   Loom keystrokes.  http://gmane.org/loom-help.php
31   SPC   Page down, then next article
32   DEL   Page up the current article
33   n     Select the next unread article
34   p     Select the previous unread article
35   N     Select the next article
36   P     Select the previous article
37   +     Go to the next page
38   -     Go to the previous page
39   f     Go to the first page
40   l     Go to the last page
41   c     Catch up -- mark all articles as read
42   C     Clear -- mark all articles as unread
43   R     Refresh the group
44   <     Go to the first article on the page
45   >     Go to the last article on the page
46   .     Go to the first article currently displayed in the frame
47   down  Move focus to the next subject
48   up    Move focus to the previous subject
49 * q     Quit and go to the list of groups
50   S     Report the current article as spam
51 * D     Disable all Loom keystrokes
53   Keystrokes marked with * are not passed through in this mode.
55   There's a disable, but no enable.  Maybe should provide a way to
56   switch the keymap in and out.
59 define_key(gmane_keymap, "space", null, $fallthrough);
60 define_key(gmane_keymap, "back_space", null, $fallthrough);
61 define_key(gmane_keymap, "n", null, $fallthrough);
62 define_key(gmane_keymap, "p", null, $fallthrough);
63 define_key(gmane_keymap, "N", null, $fallthrough);
64 define_key(gmane_keymap, "P", null, $fallthrough);
65 define_key(gmane_keymap, "+", null, $fallthrough);
66 define_key(gmane_keymap, "-", null, $fallthrough);
67 define_key(gmane_keymap, "f", null, $fallthrough);
68 define_key(gmane_keymap, "l", null, $fallthrough);
69 define_key(gmane_keymap, "c", null, $fallthrough);
70 define_key(gmane_keymap, "C", null, $fallthrough);
71 define_key(gmane_keymap, "R", null, $fallthrough);
72 define_key(gmane_keymap, "<", null, $fallthrough);
73 define_key(gmane_keymap, ">", null, $fallthrough);
74 define_key(gmane_keymap, ".", null, $fallthrough);
75 define_key(gmane_keymap, "down", null, $fallthrough);
76 define_key(gmane_keymap, "up", null, $fallthrough);
77 define_key(gmane_keymap, "S", null, $fallthrough);
80 function gmane_modality (buffer, element) {
81     if (! buffer.input_mode)
82         buffer.keymaps.push(gmane_keymap);
86 define_page_mode("gmane_mode",
87     $enable = function (buffer) {
88         buffer.modalities.push(gmane_modality);
89     },
90     $disable = function (buffer) {
91         var i = buffer.modalities.indexOf(gmane_modality);
92         if (i > -1)
93             buffer.modalities.splice(i, 1);
94     },
95     $display_name = "Gmane");
98 let (re = build_url_regex($domain = /(news|thread)\.gmane/, $tlds = ["org"])) {
99     auto_mode_list.push([re, gmane_mode]);