From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Difference between init_XXX () and syms_of_XXX () Date: Wed, 13 Jul 2011 22:19:39 +0300 Message-ID: <83tyaqdm44.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1310584685 520 80.91.229.12 (13 Jul 2011 19:18:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 19:18:05 +0000 (UTC) Cc: emacs-devel@gnu.org To: Leo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 13 21:18:00 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qh4wa-0004Fb-Ax for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2011 21:18:00 +0200 Original-Received: from localhost ([::1]:32780 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh4wY-0003us-Ve for ged-emacs-devel@m.gmane.org; Wed, 13 Jul 2011 15:17:59 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh4wF-0003u1-8i for emacs-devel@gnu.org; Wed, 13 Jul 2011 15:17:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qh4wD-0005Fp-S9 for emacs-devel@gnu.org; Wed, 13 Jul 2011 15:17:39 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:63846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qh4wD-0005Fg-Gj for emacs-devel@gnu.org; Wed, 13 Jul 2011 15:17:37 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LOA00B00DIMVA00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Wed, 13 Jul 2011 22:17:34 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.229.156.102]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LOA00B81DL9OWA0@a-mtaout20.012.net.il>; Wed, 13 Jul 2011 22:17:34 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:142008 Archived-At: > From: Leo > Date: Thu, 14 Jul 2011 01:15:34 +0800 > > In each C file, there is usually init_XXX () and syms_of_XXX (). How to > tell when to use which? Thanks. See what `main' does in emacs.c with each one of them. In a nutshell, syms_of_FOO are called only `if (!initialized)', i.e. in temacs before it dumps itself. init_FOO are called both by temacs and by dumped Emacs. Anything that needs to be reinitialized whenever a new Emacs session comes up, should be in init_FOO.