From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.devel Subject: Re: Problems with defcustom setter functions during byte-compile Date: Sat, 06 Oct 2012 22:25:20 +0200 Message-ID: <87mwzz9wlr.fsf@engster.org> References: <87wqz4arlk.fsf@engster.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349555130 26941 80.91.229.3 (6 Oct 2012 20:25:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2012 20:25:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 06 22:25:36 2012 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 1TKawI-0006JY-22 for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2012 22:25:34 +0200 Original-Received: from localhost ([::1]:39215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKawC-00075W-1i for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2012 16:25:28 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKaw9-00075R-Qq for emacs-devel@gnu.org; Sat, 06 Oct 2012 16:25:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKaw9-0002pW-0C for emacs-devel@gnu.org; Sat, 06 Oct 2012 16:25:25 -0400 Original-Received: from randomsample.de ([83.169.19.17]:34677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKaw8-0002oF-Jr for emacs-devel@gnu.org; Sat, 06 Oct 2012 16:25:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=Dh+kmUSr4Yv5Rr8zPDU022ZKcuWJkBXslKcb/yxb5IU=; b=YExbjYHgX20POIx96rKuvfweaS+CBiPSNHZdOQgzIgL5eszJ+/nCrod6xedsQ+Om42oragl898dPFqGEQUxrielwPlFV0fcKfmJklIIi7WS1HOBU7TpHk4cd3+OHa1zY; Original-Received: from dslc-082-083-058-203.pools.arcor-ip.net ([82.83.58.203] helo=spaten) by randomsample.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TKaw5-0005oi-Iy; Sat, 06 Oct 2012 22:25:21 +0200 In-Reply-To: (Stefan Monnier's message of "Sat, 06 Oct 2012 08:44:53 -0400") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) Mail-Followup-To: Stefan Monnier , emacs-devel@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 83.169.19.17 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:154140 Archived-At: Stefan Monnier writes: >> (defcustom srecode-map-load-path >> [... stuff snipped ...] >> :set 'srecode-map-load-path-set) >> The :set function `srecode-map-load-path-set' is called as soon as this >> file is loaded. > > Actually, when the defcustom is executed, the it's the initializer > that's called, and it just so happens that the default initializer in > turn calls the setter. > So you should be able to work around this problem by adding ":initialize > #'custom-initialize-default". Nifty. I didn't know that feature. And while it works as advertised, the SRecode unit tests now fail. I guess that `srecode-map-load-path-set' (which calls `srecode-map-update-map') really must be called when srecode/map is loaded, it just shouldn't happen during byte-compilation... Anyway, I guess that's more a fault on our side. At least for know I "solved" this issue by simply setting `srecode-map-load-path' to nil during byte-compilation. -David