GNU bug report logs - #32501
Bouncing parentheses broken in REPL with vi-mode enabled

Previous Next

Package: guile;

Reported by: Daniel Tam <danooo.tam <at> gmail.com>

Date: Wed, 22 Aug 2018 17:07:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Mark H Weaver <mhw <at> netris.org>
To: Daniel Tam <danooo.tam <at> gmail.com>
Cc: 32501 <at> debbugs.gnu.org
Subject: bug#32501: Bouncing parentheses broken in REPL with vi-mode enabled
Date: Wed, 22 Aug 2018 22:42:15 -0400
Hi Daniel,

Daniel Tam <danooo.tam <at> gmail.com> writes:

> I've activated readline support for the Guile repl, but I've found that
> if my inputrc enables vi-mode, then the bouncing parentheses feature
> doesn't work. Disabling vi-mode does the trick.

Indeed.  For some reason that I cannot determine, the bouncing
parentheses feature is specifically disabled when the vi keymap is in
use.  The relevant function is 'init_bouncing_parens' in
guile-readline/readline.c:

  static void
  init_bouncing_parens ()
  {
    if (strncmp (rl_get_keymap_name (rl_get_keymap ()), "vi", 2))
      {
        rl_bind_key (')', match_paren);
        rl_bind_key (']', match_paren);
        rl_bind_key ('}', match_paren);
      }
  }

This is ancient code, predating version control, present in the original
import into CVS in 1999.

I looked at the source code of readline-7.0, and IIUC none of those keys
have mappings in the default vi keymap.

The right fix might be to simply remove the 'if' check above.  Would you
like to try it and report back?

      Thanks,
        Mark




This bug report was last modified 3 years and 71 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.