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

Re: [broken-patch] unbind command



* On 2003.12.15, in <20031215162402.GA569@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
*       "Allister MacLeod" <amacleod@xxxxxxxx> wrote:
> 
> Still, it rankles with my "ivory tower code-purity nerd" side to have
> the operation to "unbind" a key actually be the addition of a
> null-shaped blob, rather than truly the removal of the binding.  If
> the baseline were a keymap full of OP_NULL's, it would not bother me
> at all.  However, the baseline is a map that is empty save for "real"
> bindings.

But I think that *is* the case, effectively. The map is not an array
filled with OP_NULLs for undefined values; rather, it's a table of
mappings which can grow in size. But keymap.c:get_op() shows that in the
case that a correspondence is not found in the map, the result is to
return OP_NULL to the caller -- so this is a shorthand for filling out
a fixed-size array with OP_NULLs. No other condition is defined for an
"unbound" key. Therefore, binding to noop is not precisely the same as
unbinding, but the sole difference is that the mapping table does not
shrink. The operational effect is the same.

The value of an unbind patch, to me, is (marginally) simpler syntax,
and (in my implementation) the ability to unbind from all menus
simultaneously. The years-ago thread to which I was responding when I
wrote the patch specifically wanted to unbind a stroke in all relevant
menus.


> Since the fall-through patch that I described above should be much
> easier to create, I will probably have it to post very soon today.

This idea sounds interesting, though. :)

-- 
 -D.    dgc@xxxxxxxxxxxx
 University of Chicago > NSIT > VDN > ENSS > ENSA > You are here
 .  .  .  .  .  .  .
 always line up dots