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: Tue, 17 Nov 2009 15:45:32 +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 1258470387 17018 80.91.229.12 (17 Nov 2009 15:06:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2009 15:06:27 +0000 (UTC) Cc: Emacs-Devel devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 17 16:06:20 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 1NAPdA-0005d8-BL for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2009 16:06:08 +0100 Original-Received: from localhost ([127.0.0.1]:41414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAPd9-0006oW-Uj for ged-emacs-devel@m.gmane.org; Tue, 17 Nov 2009 10:06:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAPJn-00049P-2s for emacs-devel@gnu.org; Tue, 17 Nov 2009 09:46:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAPJg-000471-Ck for emacs-devel@gnu.org; Tue, 17 Nov 2009 09:46:04 -0500 Original-Received: from [199.232.76.173] (port=60297 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAPJe-00046o-5F for emacs-devel@gnu.org; Tue, 17 Nov 2009 09:45:59 -0500 Original-Received: from mail-yx0-f191.google.com ([209.85.210.191]:56175) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NAPJd-0000cI-JQ for emacs-devel@gnu.org; Tue, 17 Nov 2009 09:45:57 -0500 Original-Received: by yxe29 with SMTP id 29so54191yxe.14 for ; Tue, 17 Nov 2009 06:45:56 -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=Hl122EChSOOQrhlCL4Qh+6sn3S0VwVbrg1JzkjR93E4=; b=DikyknsgkVnvg/FrfNGY3Oger1D0H90J962QFgvdDoUYWQCtUKWjqOBvVuII4duyyH Eyg9dwDfxYyEDiHBq+bZ+IY1gN5REYm7eQBmsD5fXmM1rn5CTqTp5iczBUINjInfOm6B 0UJ0KyN3EXAW+7+2wNLdRTu/9WK8YBeULhzG8= 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=p/KtjgCotY7785uV9/fwOdVqg4LDyLyXn2KGOWCOklBwWxpj/SY6BWCV29u7qlHBaX 3jPKnCxEePhqv3XuBAVWg7Ywrd89n/r+RP8D6Ya0o1b2+EJnhc8QBgivew0TKMtsJf9v ydeVEd5ZiKvqcoGoSwOyZGo0xHEgv8UQawvIg= Original-Received: by 10.101.113.4 with SMTP id q4mr3174922anm.64.1258469152175; Tue, 17 Nov 2009 06:45:52 -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:117098 Archived-At: 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 autoloading >>>> just defgroups would be a possibility? (Or are they already autoloaded >>>> 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 symbo= l '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: (mapatoms (lambda (symbol) (let ((members (get symbol 'custom-group)) where found (sym-name (symbol-name symbol)) (option (get symbol 'standard-value))) (when members (dolist (member ;; So x and no-x builds won't differ. (sort (mapcar 'car members) 'string<)) (setq where (get member 'custom-where)) (unless (or (null where) (member where found)) (push where found))) (when found (insert "(put '" sym-name " 'custom-unloaded 'group)\n"= ))) (when option (setq where (get option 'custom-where)) (insert "(put '" sym-name " 'custom-unloaded 'option)\n") (unless (or (null where) (member where found)) (push where found))) (when found (insert "(put '" sym-name " 'custom-loads '") (prin1 (nreverse found) (current-buffer)) (insert ")\n")) )))