Hi.

1. I don't understand why C-t (transpose-chars) won't swap two-letter fields, 
e.g. og → go. The first patch below makes this work. Note that other programs 
(readline, bash, Emacs) do the same.

2. Can transpose-chars be also activated for the minibuffer? The second patch 
does this. I feel I should have used minibuffer-transpose-chars instead of 
transpose-chars, just like the other keys do, but I don't know why the 
minibuffer- prefix was used. In fact, where are all those functions like 
minibuffer-backward-word defined? Could you add some explanatory comments?

Thanks

-- Daniel

[1]:

diff --git a/modules/commands.js b/modules/commands.js
index 6e77a22..1ecced2 100644
--- a/modules/commands.js
+++ b/modules/commands.js
@@ -125,10 +125,9 @@ function transpose_chars (field) {
     var caret = field.selectionStart; // Caret position.
     var length = value.length;
 
-    // If we have less than two character in the field or if we are at the
-    // beginning of the field, do nothing.
-    if (length <= 2 || caret == 0)
-        return;
+    // If we are at the beginning of the field, do nothing.
+       if (caret==0)
+               return;
 
     // If we are at the end of the field, switch places on the two last
     // characters. TODO: This should happen at the end of every line, not only




[2]:

diff --git a/modules/bindings/default/minibuffer.js 
b/modules/bindings/default/minibuffer.js
index 969afcb..8f0f27a 100644
--- a/modules/bindings/default/minibuffer.js
+++ b/modules/bindings/default/minibuffer.js
@@ -23,6 +23,7 @@ define_key(minibuffer_base_keymap, "C-d", 
"minibuffer-cmd_deleteCharForward");
 define_key(minibuffer_base_keymap, "delete", 
"minibuffer-cmd_deleteCharForward");
 define_key(minibuffer_base_keymap, "M-d", "minibuffer-cmd_deleteWordForward");
 define_key(minibuffer_base_keymap, "C-delete", 
"minibuffer-cmd_deleteWordForward");
+define_key(minibuffer_base_keymap, "C-t", "transpose-chars");
 define_key(minibuffer_base_keymap, "C-b", "minibuffer-backward-char");
 define_key(minibuffer_base_keymap, "left", "minibuffer-backward-char");
 define_key(minibuffer_base_keymap, "M-b", "minibuffer-backward-word");

_______________________________________________
Conkeror mailing list
[email protected]
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to