[Conkeror] [PATCH] Typing a substring of a hint now respects a disabled hints_auto_exit_delay.

David Kettler David.Kettler at dsto.defence.gov.au
Sun Nov 2 18:07:14 PST 2008


Previously, if hints_auto_exit_delay was set to zero, a link would be
followed erroneously as soon as an unambiguous substring was typed.
Further typing was then interpreted as keystroke commands.  With this
patch the auto-exit will properly not occur, so the link will not be
automatically followed, but must be explicitly accepted with the
return key.

For example, if you visit http://conkeror.org/, set
hints_auto_exit_delay to zero and type "f tips", the browser would
previously accept "tip" as unambiguously denoting a link, erroneously
load the corresponding page and prompt to save a link (due to the left
over "s").  Now the link will be highlighted, but not followed.

All callers of handle_auto_exit() now first check that the delay
passed is non-zero.  The one place where this did not happen is fixed
in this patch.  There remain structural problems with the code which
should also be addressed.
---

>   When hints_auto_exit_delay is 0, no auto-exit is supposed to happen at
> all, as it says in the docstring.

It was broken in one case, which the patch fixes.  The
hints_minibuffer_state.auto_exit variable doesn't seem to serve a
purpose; it's always set.

I agree that the code is messy and possibly inconsistent.  But I think
that it does now do the right thing and this patch is worth applying
as an interim fix until someone is prepared to clean it up.  I don't
undertand it well enough to attempt that now.

The contents of this patch are the same as my previous submmission;
I've just expanded the explanation.

 modules/hints.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/hints.js b/modules/hints.js
index a397afa..64f1f31 100644
--- a/modules/hints.js
+++ b/modules/hints.js
@@ -441,7 +441,8 @@ hints_minibuffer_state.prototype = {
         this.manager.current_hint_number = -1;
         this.manager.update_valid_hints();
         if (this.auto_exit) {
-            if (this.manager.valid_hints.length == 1)
+            if (this.manager.valid_hints.length == 1
+                && hints_auto_exit_delay > 0)
                 this.handle_auto_exit(m, hints_auto_exit_delay);
             else if (this.manager.valid_hints.length > 1
                      && hints_ambiguous_auto_exit_delay > 0)
-- 
1.6.0.2.605.g208f6.dirty



-- 
IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the
CRIMES ACT 1914. If you have received this email in error, you are
requested to contact the sender and delete the email.



More information about the Conkeror mailing list