From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: michael.cadilhac@lrde.org (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) Newsgroups: gmane.emacs.devel Subject: Re: Minor fix for life.el. Date: Wed, 06 Sep 2006 20:14:04 +0200 Organization: Epita/LRDE Message-ID: <877j0gq2vn.fsf@lrde.org> References: <87ejup0vth.fsf@lrde.org> <858xkwdg92.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2049714592==" X-Trace: sea.gmane.org 1157566499 5309 80.91.229.2 (6 Sep 2006 18:14:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Sep 2006 18:14:59 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 06 20:14:46 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GL1ur-0006aN-6D for ged-emacs-devel@m.gmane.org; Wed, 06 Sep 2006 20:14:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GL1uq-0004r8-Hf for ged-emacs-devel@m.gmane.org; Wed, 06 Sep 2006 14:14:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GL1ud-0004nS-6W for emacs-devel@gnu.org; Wed, 06 Sep 2006 14:14:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GL1ua-0004eG-S5 for emacs-devel@gnu.org; Wed, 06 Sep 2006 14:14:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GL1ua-0004dm-Me for emacs-devel@gnu.org; Wed, 06 Sep 2006 14:14:08 -0400 Original-Received: from [62.39.139.2] (helo=kualalumpur.lrde.epita.fr) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GL1uk-0007Go-5R; Wed, 06 Sep 2006 14:14:18 -0400 Original-Received: from mahaena.lrde.epita.fr ([192.168.101.66] helo=mahaena.lrde) by kualalumpur.lrde.epita.fr with esmtp (Exim 4.50) id 1GL1uW-0004JM-1W; Wed, 06 Sep 2006 20:14:04 +0200 Original-To: David Kastrup Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEU/JREXDATg1LV8UCao i1fQpmoP3Nd6AAACa0lEQVQ4jWWUQW7jMAxFqZEPICJzAjXeM6W8dyNqX9ji/a8yn04xnWIEJLD9 LJH85DcJFyJV3erqPty8ExHfBikXSdn0WVezC0hOAQiA2nCsAHOqEnPe4k+puU8zw/t+xquqjRKA 4lHsmQBT8C5pDtBwfwH8VdcHI5+FHtjRxrQRwZsf3hNjZRKAPEzHEdH9mFNSYb5dQK3r8KM6ftNy KikAirDZFWdVkDqbxjGFbAcwbQCxxc8mPRHUGOcCIMgMACV23RfJTch3gC6ofT3qCdG0NyUUPfYF yQrKCIAnuYsgX2qPzW2i9sNrfSOSPPZQiygtCNlCjlpXJV38lIKshF/AZzsAMoArdCKNHfXukPuJ ImbLh+9J2gXwap0QpZ7NjZ7ekdkFcDiqPiLGcHmuvaG/AHgy62s52Lae1ABoA7D6d2kDoAvgbnyD ZutEd6lTHOXfYPHVJDH1K8a1+oyrjoZpAGn1x5pfwPr2E9yjxSpk50/gEyKgD/+BD/KzN3tQ13b8 Cx5loF0AgnZf5IUny9hRHQOYBllHDM+6s3oviZBu77mFjDm621Np3hkjR90wE1BkTYvhdDgDgCmR xWChFfcYAOqMm5NZkVWMur8AL5+oeMQOob2FmY76FiM+PrDDZypwGdqokSlAaQOmGH6mW8KpsOwl 0YOLedjSITr6scNRF8D4PesH33QmLrx8AzjpV/3kkg025w2gfAFYKCLluJAc4Ap+h18oo4S8wzaY klDsBUTiY8EZFkg5Iass75FubC9wd8qa0u9+gRxAsAKEaRAo6iB+vwCMGmdBjvgidQGA1ntMX4CS ZYGV/wADyL80LIX/UAAAAABJRU5ErkJggg== In-Reply-To: <858xkwdg92.fsf@lola.goethe.zz> (David Kastrup's message of "Wed, 06 Sep 2006 20:03:37 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:59459 Archived-At: --===============2049714592== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable David Kastrup writes: > michael.cadilhac@lrde.org (Micha=EBl 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 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> 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) >>=20=20=20 >> ;; Redisplay; if the user has hit a key, exit the loop. >> ! (or (eq t (sit-for sleeptime)) >> (throw 'life-exit nil))) >>=20=20=20 >> (defun life-extinct-quit () >> --- 269,276 ---- >> (recenter 0) >>=20=20=20 >> ;; 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)) =2D-=20 | Micha=EBl `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 - -= -' --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFE/w/sZYNf4qobZ7kRAsdvAKCwIJRBvrznmZuwz/HmzP39Qp+SHACgnj9m Sj7YHKuQnEKJMsrUEDUAZpY= =3HU4 -----END PGP SIGNATURE----- --=-=-=-- --===============2049714592== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============2049714592==--