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: Defcustoms, how do users find them? Date: Wed, 18 Nov 2009 00:13:45 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1258499668 24591 80.91.229.12 (17 Nov 2009 23:14:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2009 23:14:28 +0000 (UTC) Cc: Emacs-Devel devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 18 00:14:21 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 1NAXFb-000537-8R for ged-emacs-devel@m.gmane.org; Wed, 18 Nov 2009 00:14:19 +0100 Original-Received: from localhost ([127.0.0.1]:51249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAXFa-00041B-CY for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2009 18:14:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAXFT-0003zB-1a for emacs-devel@gnu.org; Tue, 17 Nov 2009 18:14:11 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAXFO-0003pL-8a for emacs-devel@gnu.org; Tue, 17 Nov 2009 18:14:10 -0500 Original-Received: from [199.232.76.173] (port=51647 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAXFO-0003p9-3R for emacs-devel@gnu.org; Tue, 17 Nov 2009 18:14:06 -0500 Original-Received: from mail-yw0-f177.google.com ([209.85.211.177]:35836) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NAXFN-00011J-S8 for emacs-devel@gnu.org; Tue, 17 Nov 2009 18:14:06 -0500 Original-Received: by ywh7 with SMTP id 7so583848ywh.24 for ; Tue, 17 Nov 2009 15:14:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=Rq2+1sejKs6OglT00hQiEsa5mi4vKhlp/EWae1A2gKY=; b=LimzBOE+HW3Enzt2MJez9DY4DHU5PuMo3cn2qqfGvaFfkYlMMSmaxjVO3VpbiZYEVV wGckwp9ohw27ffpfiaAhaF7uuDprQ0pvPdXwVOCuMSNZ7pfuufmiSLuOvtRzkv31J4Pz CayrfGpwIQ6tsEwHjXfLXZLSWrDUuRxtXAzW0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=BKph2hxOJYkZm41tENLzJ+F0UvEpsmURzbIfJnAQHQBaYDyOG68vaCzA/gdvds8cY0 uehOWaI0lmB8iueQLeWSpe2uh4b8/nrkdLjLwT6nqGEOO74MuOVBenh5kq60Rj4HLYGi 6tdIoxFrTdfInARvs4EVgyfMGimrJpks19BEc= Original-Received: by 10.101.176.2 with SMTP id d2mr118057anp.27.1258499645078; Tue, 17 Nov 2009 15:14:05 -0800 (PST) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:117132 Archived-At: On Tue, Nov 17, 2009 at 3:45 PM, Lennart Borgman wrote: > On Tue, Nov 17, 2009 at 3:22 PM, Lennart Borgman > wrote: >> On Tue, Nov 17, 2009 at 4:41 AM, Lennart Borgman >> wrote: >>> On Tue, Nov 17, 2009 at 4:38 AM, Stefan Monnier >>> wrote: >>>>> If it is really annoying to autoload defcustoms then maybe autoloadin= g >>>>> just defgroups would be a possibility? (Or are they already autoloade= d >>>>> in some way?) >>>> >>>> Yes, groups are autoloaded, thanks to cus-load.el. >>>> We could make customize-variable's completion complete to all >>>> defcustoms, using a similar scheme (and have customize-variable >>>> automatically load the var's package if it's not yet loaded). >>>> But autoloading the defcustoms is out of the question. >>> >>> I think that would solve the problem - if help/apropos functions also >>> loaded the var's package. >> >> >> As I understand it we then first have to modify >> custom-make-dependencies so that it also collects defcustoms. Changing >> the part where it write 'custom-loads to cus-dep.el should is enough >> for this I guess, see below. Is this the way to do it? (And then add >> the corresponding pieces to custom-variable-prompt etc.) >> >> *** In custom-make-dependencies change to this **** >> >> =C2=A0(mapatoms (lambda (symbol) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((members (get symb= ol 'custom-group)) > > > And that was not a very good idea for how to modify > custom-make-dependencies. Something like this should make it easier to > write the rest since there is already a lot of stuff handling > 'custom-loads: > > =C2=A0(mapatoms (lambda (symbol) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((members (get symbo= l 'custom-group)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0wher= e found > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(sym= -name (symbol-name symbol)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(opt= ion (get symbol 'standard-value))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when members > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dolist (me= mber > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ;; So x and no-x builds won't differ. > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 (sort (mapcar 'car members) 'string<)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(set= q where (get member 'custom-where)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(unl= ess (or (null where) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(member where found)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(push where found))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when found > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(ins= ert "(put '" sym-name " 'custom-unloaded 'group)\n"))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when option > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq where= (get option 'custom-where)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(insert "(p= ut '" sym-name " 'custom-unloaded 'option)\n") > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(unless (or= (null where) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(member where found)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(pus= h where found))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when found > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(insert "(p= ut '" sym-name > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0" 'custom-loads '") > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(prin1 (nre= verse found) (current-buffer)) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(insert ")\= n")) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0))) > I tested this a little. Loading the new cus-load.el now takes about 2.5 times longer time than before. (This is an old pc, it now takes 0.5 sec.) There are approx 15 000 put statements (before there were approx 1000). Byte compiling will bring down load time to the same time as before (or even less, it was not byte-compiled before), but I do not know if there are any adverse effects from byte compiling it. Is this the way to go to get completion etc for unloaded options (and faces= )?