From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Defcustoms, how do users find them? Date: Thu, 26 Nov 2009 21:09:13 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1259287772 14626 80.91.229.12 (27 Nov 2009 02:09:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Nov 2009 02:09:32 +0000 (UTC) Cc: Emacs-Devel devel To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 27 03:09:25 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NDqGz-0006Kq-5D for ged-emacs-devel@m.gmane.org; Fri, 27 Nov 2009 03:09:25 +0100 Original-Received: from localhost ([127.0.0.1]:34840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDqGy-00061y-O1 for ged-emacs-devel@m.gmane.org; Thu, 26 Nov 2009 21:09:24 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDqGt-00061f-7g for emacs-devel@gnu.org; Thu, 26 Nov 2009 21:09:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDqGo-0005vR-MS for emacs-devel@gnu.org; Thu, 26 Nov 2009 21:09:18 -0500 Original-Received: from [199.232.76.173] (port=46236 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDqGo-0005v5-GW for emacs-devel@gnu.org; Thu, 26 Nov 2009 21:09:14 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:63976 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NDqGo-0001Bu-7d for emacs-devel@gnu.org; Thu, 26 Nov 2009 21:09:14 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuQEAFDDDktFpYc//2dsb2JhbACBTNQNhDEEihk X-IronPort-AV: E=Sophos;i="4.47,298,1257138000"; d="scan'208";a="50133307" Original-Received: from 69-165-135-63.dsl.teksavvy.com (HELO ceviche.home) ([69.165.135.63]) by ironport2-out.pppoe.ca with ESMTP; 26 Nov 2009 21:09:13 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 57A4CB40E6; Thu, 26 Nov 2009 21:09:13 -0500 (EST) In-Reply-To: (Lennart Borgman's message of "Thu, 26 Nov 2009 18:36:17 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:117840 Archived-At: >> So it ends up increasing Emacs's footprint by a bit less than >> a megabyte. =A0It's not the end of the world, but it might be worthwhile >> trying to avoid loading this data unless it's really needed. > The easiest seems to be to split cus-load.el in two part and only load > this extra part in C-h v etc. I think C-h v, C-h f and very common operations which most of the time do not need this info, so I'd like to avoid eating up 1MB just for that. >> Of course, maybe there's a way to represent the same info >> more compactly > I doubt it is possible, but I do not understand all the figures. > Does it help to erase the data again after C-h v? Erasing the data after use might be a way around the problem. Note that in the form in which you currently store the data (Customize symbol properties), it's difficult to unload it. If you additionally split the data (e.g. based on the first letter), you'd end up only loading a tenth of the data at a time, which would seem a lot more reasonable. >> or to load it piecemeal (e.g. I've been using a local >> hack where C-h v foo-bar RET will try to load foo.el if foo-bar is not >> yet defined). > Doesn't it need this data? No it does it by guessing that "foo-bar" is probably in file foo.el based on the prefix, so it doesn't need any data at all, but then it only works in some cases. And doesn't provide any completion at all. Obviously, this is just a hack. But maybe it can be turned into something more robust. E.g. we could collect a list of unique prefixes for each file, so we could then easily figure out from a variable name (or from a prefix) which (set of) files might provide variables of that name. And this data should be fairly compact. Better yet: it could be used to check/encourage use of the coding convention that asks to use unique prefixes for namespace management: well-coded packages will use less prefixes/less resources. The main interest for me here is that this should work for defvars and defuns as well, without much additional cost. Ideally such a feature should use autoload.el rather than cus-dep.el, so it can also work for unbundled packages. Stefan