[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minor fix for life.el.
From: |
Michaël Cadilhac |
Subject: |
Re: Minor fix for life.el. |
Date: |
Wed, 06 Sep 2006 20:14:04 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) |
David Kastrup <address@hidden> writes:
> address@hidden (Michaël Cadilhac) writes:
>
>> I usually use M-x life with zero as numerical prefix (it's lot of fun).
>> M-0 M-x life RET
>>
>> There's a little bug: when I hit a key, life goes into an infinite
>> loop (not MY life) and I have to C-g to stop this.
>>
>> The following patch fixes this bug (sit-for is still called because he
>> causes redisplay).
>>
>> Index: lisp/play/life.el
>> ===================================================================
>> RCS file: /sources/emacs/emacs/lisp/play/life.el,v
>> retrieving revision 1.25
>> diff -c -r1.25 life.el
>> *** lisp/play/life.el 5 Feb 2006 14:10:44 -0000 1.25
>> --- lisp/play/life.el 6 Sep 2006 16:58:35 -0000
>> ***************
>> *** 269,275 ****
>> (recenter 0)
>>
>> ;; Redisplay; if the user has hit a key, exit the loop.
>> ! (or (eq t (sit-for sleeptime))
>> (throw 'life-exit nil)))
>>
>> (defun life-extinct-quit ()
>> --- 269,276 ----
>> (recenter 0)
>>
>> ;; Redisplay; if the user has hit a key, exit the loop.
>> ! (or (and (sit-for sleeptime) (< 0 sleeptime))
>> ! (not (input-pending-p))
>
> That looks like the wrong fix.
Damn!
> How about
>
> (or (eq t (sit-for (max sleeptime 0)))
I don't think the (eq t) is needed. However, the problem is not fixed
by this as sit-for returns immediately `t' if its argument is zero
(AFAICT). That's why I thought the check for input should be done by
hand.
> (throw 'life-exit nil))
--
| Michaël `Micha' Cadilhac | Isn't vi that text editor with |
| Epita/LRDE Promo 2007 | two modes... One that beeps and |
| http://www.lrde.org/~cadilh_m | one that corrupts your file? |
`-- - JID: address@hidden --' -- Dan Jacobson - --'
pgpQzbeB89AW3.pgp
Description: PGP signature
- Minor fix for life.el., Michaël Cadilhac, 2006/09/06
- Re: Minor fix for life.el., David Kastrup, 2006/09/06
- Re: Minor fix for life.el.,
Michaël Cadilhac <=
- Re: Minor fix for life.el., David Kastrup, 2006/09/06
- Broken sit-for [was: Re: Minor fix for life.el.], Kim F. Storm, 2006/09/07
- Re: Broken sit-for, Michaël Cadilhac, 2006/09/08
- Re: Broken sit-for [was: Re: Minor fix for life.el.], Kim F. Storm, 2006/09/09
- Re: Broken sit-for, David Kastrup, 2006/09/09
- Re: Broken sit-for, Michaël Cadilhac, 2006/09/10
- Re: Broken sit-for, Kim F. Storm, 2006/09/10
- Re: Broken sit-for, Michaël Cadilhac, 2006/09/11
- Re: Broken sit-for, Kim F. Storm, 2006/09/10