From: michael.cadilhac@lrde.org (Michaël Cadilhac)
Cc: emacs-devel@gnu.org
Subject: Re: Minor fix for life.el.
Date: Wed, 06 Sep 2006 20:14:04 +0200 [thread overview]
Message-ID: <877j0gq2vn.fsf@lrde.org> (raw)
In-Reply-To: <858xkwdg92.fsf@lola.goethe.zz> (David Kastrup's message of "Wed, 06 Sep 2006 20:03:37 +0200")
[-- Attachment #1.1: Type: text/plain, Size: 1904 bytes --]
David Kastrup <dak@gnu.org> writes:
> michael.cadilhac@lrde.org (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: micha@amessage.be --' -- Dan Jacobson - --'
[-- Attachment #1.2: Type: application/pgp-signature, Size: 188 bytes --]
[-- Attachment #2: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2006-09-06 18:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-06 17:05 Minor fix for life.el Michaël Cadilhac
2006-09-06 18:03 ` David Kastrup
2006-09-06 18:14 ` Michaël Cadilhac [this message]
2006-09-06 18:34 ` David Kastrup
2006-09-07 14:27 ` Broken sit-for [was: Re: Minor fix for life.el.] Kim F. Storm
2006-09-08 9:16 ` Broken sit-for Michaël Cadilhac
2006-09-09 23:02 ` Broken sit-for [was: Re: Minor fix for life.el.] Kim F. Storm
2006-09-10 0:28 ` Broken sit-for David Kastrup
2006-09-10 9:18 ` Michaël Cadilhac
2006-09-10 21:26 ` Kim F. Storm
2006-09-11 14:22 ` Michaël Cadilhac
2006-09-10 21:06 ` Kim F. Storm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877j0gq2vn.fsf@lrde.org \
--to=michael.cadilhac@lrde.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).