From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Volunteers to implement test for stuff called at startup? Date: Sun, 01 May 2016 19:07:41 -0400 Message-ID: References: <83y47tn5tv.fsf@gnu.org> Reply-To: rms@gnu.org NNTP-Posting-Host: plane.gmane.org Content-Type: text/plain; charset=Utf-8 X-Trace: ger.gmane.org 1462144109 3209 80.91.229.3 (1 May 2016 23:08:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 May 2016 23:08:29 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 02 01:08:20 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ax0TL-0002cI-6s for ged-emacs-devel@m.gmane.org; Mon, 02 May 2016 01:08:19 +0200 Original-Received: from localhost ([::1]:34545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ax0TH-00043B-Cw for ged-emacs-devel@m.gmane.org; Sun, 01 May 2016 19:08:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ax0T8-0003oK-MU for emacs-devel@gnu.org; Sun, 01 May 2016 19:08:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ax0Sx-00078S-40 for emacs-devel@gnu.org; Sun, 01 May 2016 19:08:01 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ax0Sx-00077q-0O for emacs-devel@gnu.org; Sun, 01 May 2016 19:07:55 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1ax0Sj-0007BE-Qf; Sun, 01 May 2016 19:07:41 -0400 In-reply-to: <83y47tn5tv.fsf@gnu.org> (message from Eli Zaretskii on Sun, 01 May 2016 18:41:48 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203508 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > For example, a recent change caused process-list to be called very > early during startup. The code that was installed was not intended to > run during startup, I think, so this was an inadvertent side effect. A simple way to detect this would be to have a global flag process_list_ok_to_call, which starts out 0 and gets set to 1 at the stage where calling it becomes ok. If you call process-list and process_list_ok_to_call is 0, it would signal an error. This is more effective as a test mechanism than writing tests, and simpler than the solution of making a list of all primitives called and checking that. Perhaps a few such variables would be enough to identify the various stages of startup, so that various primitives can test one of these. Another approach for this case is to initialize Vprocess_list earlier. Or make process-list return nil when Vprocess_list is 0. Then there would be no problem calling process-list too early. -- Dr Richard Stallman President, Free Software Foundation (gnu.org, fsf.org) Internet Hall-of-Famer (internethalloffame.org) Skype: No way! See stallman.org/skype.html.