From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Finding a variable before it's loaded Date: Thu, 23 Feb 2012 23:29:57 +0100 Message-ID: References: <7AF76478FD534B8B9A07E9FB79060E64@us.oracle.com> <5b4nuizqj9.fsf@fencepost.gnu.org> <3251750A293C4D74AAB64FD8672192CE@us.oracle.com> <87ehtlykdr.fsf@gmx.li> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1330036233 26174 80.91.229.3 (23 Feb 2012 22:30:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 23 Feb 2012 22:30:33 +0000 (UTC) Cc: emacs-devel@gnu.org, Lawrence Mitchell To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 23 23:30:32 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S0hBC-0002Rn-JO for ged-emacs-devel@m.gmane.org; Thu, 23 Feb 2012 23:30:26 +0100 Original-Received: from localhost ([::1]:51383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0hBC-0007pE-3F for ged-emacs-devel@m.gmane.org; Thu, 23 Feb 2012 17:30:26 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:42379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0hB8-0007oz-Hy for emacs-devel@gnu.org; Thu, 23 Feb 2012 17:30:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0hB7-0000TW-6w for emacs-devel@gnu.org; Thu, 23 Feb 2012 17:30:22 -0500 Original-Received: from mail-lpp01m010-f41.google.com ([209.85.215.41]:51484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0hB4-0000S5-Uj; Thu, 23 Feb 2012 17:30:19 -0500 Original-Received: by lamf4 with SMTP id f4so2510422lam.0 for ; Thu, 23 Feb 2012 14:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=1D1P89ucrhA0KVaSv+5M58zgoNoFNSs17+0ZuEiTtZI=; b=reebob7SGLfT/LkZf0iAacRN55SFbAILOs+geIMhWSk/pP9eAkW6bbNJhLvRxSsjRo Go65MXg5gowR/9UPU0oon3QQar3kRbwTnVMpNYIoV9ltQQmja7S90adHKxCB/IHT9JVX f63om1hv602sRJeqd5plHnPBeHR5yeM2VPY9M= Original-Received: by 10.152.115.69 with SMTP id jm5mr2315868lab.25.1330036217206; Thu, 23 Feb 2012 14:30:17 -0800 (PST) Original-Received: by 10.112.12.6 with HTTP; Thu, 23 Feb 2012 14:29:57 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.215.41 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:148757 Archived-At: On Thu, Feb 23, 2012 at 22:48, Stefan Monnier wr= ote: >>> The docstring of comment-style refers the user to comment-styles for >>> details on what the values mean. =C2=A0However, this is not available u= ntil >>> after newcomment.el is loaded. =C2=A0So autoload comment-styles to avoi= d >>> this problem. >> Then this is an instance of a general problem. See eg >> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D1768 >> for the same thing. >> IMO there should be a general solution rather than papering over every >> instance that occurs with more pre/autoloading. > > Yes, there is a general problem underneath, but it's difficult to > solve satisfactorily. =C2=A0IIRC someone did submit a potential solution = at > some point, but it required building a fairly large file listing where > each var is defined. I did that. Though I did not have time to finish it in the end. However the timing was not a big problem. The table size was perhaps a problem. > I have toyed with a slightly different approach which tries to reduce > the size of this file by keeping not the list of all vars, but only > a list of prefixes used by each file. Sounds like a better solution. > This way, if I want to find `comment-styles', I can simply load all the f= iles > that define variables with the "comment-" prefix. Could not that be problematic? Maybe the build process could warn if a prefix is found in the wrong file?