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

Re: keyboard handling (specifically mutt_getch)



On Tue, Dec 16, 2003 at 01:08:52PM -0500, Allister MacLeod wrote:
> On Tue, Dec 16, 2003 at 05:29:06AM -0500, David Yitzchak Cohen wrote:
> > On Tue, Dec 16, 2003 at 01:38:13AM -0500, Allister MacLeod wrote:

> > >     if (tmp.op)
> > > As far as I can tell, tmp is only ever set by assignment from the
> > > mutt_getch() function.  Upon reading that function, it looks like
> > > maybe the .op field of the return value is only ever set when there is
> > > an error (and then its value is OP_NULL).  I'm not sure, though.  Can
> > > anyone tell me whether there are other cases where tmp.op would be
> > > nonzero?
> > Well, I'm affraid to say anything here, since I'll probably be wrong,
> > and you-know-who's gonna be gunnin' for my next wrong statement ;-P
> > (I've never even looked at this part of the code before.)  However,
> > what I can reliably say is that (a) that if is in a loop, (b) there are
> > multiple levels of recursion involved here, and (c) my head hurts just
> > looking at it.
> > HTH (though I doubt it will),
> 
> Heh.. thanks anyway for giving a second viewpoint.  I'd like to point
> some things out, in light of the ones that you brought up.  Even
> though there's a fair amount of recursion involved in km_dokey() and
> retry_generic(), the event_t tmp is a local variable.  So, barring
> some total weirdness, its value is just taken from settings within the
> function.

Yeah, now that I'm awake, everything makes a lot more sense :-)

> Now that I've (I think) learned that OP_NULL == 0, at least according
> to Thomas's example, I wonder if the body of the if(tmp.op) block ever
> gets executed.

If you're curious, put a couple of lines in there to write the value
of tmp.op to a file every time the block is executed.  (That way, you
don't need to run off the debugger all the time.)

 - Dave

-- 
Uncle Cosmo, why do they call this a word processor?
It's simple, Skyler.  You've seen what food processors do to food, right?

Please visit this link:
http://rotter.net/israel

Attachment: pgpdMtJ5MKisy.pgp
Description: PGP signature