From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: commit 7719734dd7 org-compat.el: New compatibility function `org-random' Date: Thu, 06 Sep 2012 20:02:47 +0200 Message-ID: <877gs7do6w.fsf@Rainer.invalid> References: <87k3w7dtt2.fsf@Rainer.invalid> <87bohj3vx0.fsf@altern.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9gQ2-0001br-Qn for emacs-orgmode@gnu.org; Thu, 06 Sep 2012 14:03:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9gPx-0002Mc-Sx for emacs-orgmode@gnu.org; Thu, 06 Sep 2012 14:03:10 -0400 Received: from plane.gmane.org ([80.91.229.3]:38041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9gPx-0002MT-Lp for emacs-orgmode@gnu.org; Thu, 06 Sep 2012 14:03:05 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1T9gPw-0002f9-8W for emacs-orgmode@gnu.org; Thu, 06 Sep 2012 20:03:04 +0200 Received: from pd9eb3157.dip.t-dialin.net ([217.235.49.87]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Sep 2012 20:03:04 +0200 Received: from Stromeko by pd9eb3157.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Sep 2012 20:03:04 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Bastien writes: > The real problem is (random t) in previous versions of org-id.el. Yes. > Do you mean this should be (random) instead of (random t) in those > versions? Why? If so, we can simply get rid of the compatibility > macro and use (random). That would be the correct thing to do. >> No package should ever use `(random t)´ at all and especially not >> repeatedly. > > I thought (random t) was okay especially because related functions > (e.g. org-id-new) are *never* repeated at regular intervals. That unfortunate misconception is built into many Emacs packages, hence the effort to finally make this operation a no-op and move the seeding of the PRNG to the Emacs init code. > Besides, (random t) is documented in Emacs <24.3 and XEmacs. Sure, but you still aren't supposed to re-seed a PRNG each time you want a random number from it. Especially not with the seeding method that Emacs used to use. Each Emacs session should call `(random t)´ exactly once, in the user init file. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Factory and User Sound Singles for Waldorf rackAttack: http://Synth.Stromeko.net/Downloads.html#WaldorfSounds