<<< Date Index >>>     <<< Thread Index >>>

Re: [broken-patch] unbind command



On 2003-12-15 00:01:52 -0500, David Yitzchak Cohen wrote:

> According to the patch's docs, unbind index z is identical to
> bind index z noop.  Is that incorrect (i.e., does it actually
> unbind the key)?

The unbind patch binds things to OP_NULL.

The attached patch makes sure that mutt tries the generic menu if
the specific one returns OP_NULL.

-- 
Thomas Roessler · Personal soap box at <http://log.does-not-exist.org/>.
? err
? mutt-1.5.5-extra.tgz
? patch
? patch-1.5.3-CVS.tlr.idna.1
? patch-1.5.4.nr.tag_prefix_cond
? patch-1.5.4.tlr.nodots.1
? patch-1.5.4.tlr.pgpsmimeautoselect.1
? patch-1.5.4.tlr.query_mem.1
? patch-1.5.4.tlr.save_attachment.1
? patch-1.5.4.tlr.tag_prefix.1
? patch-1.5.5.1.tlr.libidncompat.1
? patch-1.5.5.1.tlr.thread_free.1
? patch-1.5.5.1.tlr.unbind.1
? patch-1.5.5.1692
? pgpring.sample
? send.c.new
? sort.c.new
? stamp-h1
? typescript
Index: keymap.c
===================================================================
RCS file: /cvs/mutt/mutt/keymap.c,v
retrieving revision 3.10
diff -u -r3.10 keymap.c
--- keymap.c    24 Jul 2003 18:40:50 -0000      3.10
+++ keymap.c    16 Dec 2003 08:34:43 -0000
@@ -443,9 +443,10 @@
     if (LastKey != map->keys[pos])
       return (retry_generic (menu, map->keys, pos, LastKey));
 
-    if (++pos == map->len)
+    if (pos + 1 == map->len)
     {
-
+      if (!map->op)    /* unbound key */
+       return retry_generic (menu, map->keys, pos, LastKey);
       if (map->op != OP_MACRO)
        return map->op;
 
@@ -460,6 +461,7 @@
       map = Keymaps[menu];
       pos = 0;
     }
+    pos++;
   }
 
   /* not reached */

Attachment: pgpXSFUkO05a9.pgp
Description: PGP signature