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: Autoloaded defcustoms Date: Mon, 5 Jan 2009 23:22:53 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1231194194 30430 80.91.229.12 (5 Jan 2009 22:23:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Jan 2009 22:23:14 +0000 (UTC) Cc: Emacs Devel To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 05 23:24: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 1LJxry-0002xO-8N for ged-emacs-devel@m.gmane.org; Mon, 05 Jan 2009 23:24:23 +0100 Original-Received: from localhost ([127.0.0.1]:60037 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJxqe-0006Ox-TC for ged-emacs-devel@m.gmane.org; Mon, 05 Jan 2009 17:23:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LJxqa-0006Nj-Qe for emacs-devel@gnu.org; Mon, 05 Jan 2009 17:22:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LJxqa-0006NJ-Ax for emacs-devel@gnu.org; Mon, 05 Jan 2009 17:22:56 -0500 Original-Received: from [199.232.76.173] (port=32943 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LJxqa-0006NG-86 for emacs-devel@gnu.org; Mon, 05 Jan 2009 17:22:56 -0500 Original-Received: from fg-out-1718.google.com ([72.14.220.159]:9451) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LJxqZ-0002dJ-RK for emacs-devel@gnu.org; Mon, 05 Jan 2009 17:22:56 -0500 Original-Received: by fg-out-1718.google.com with SMTP id l26so2884088fgb.30 for ; Mon, 05 Jan 2009 14:22:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ipwmSZRQI3OCbdplzIotJ20UFPJkFMxnFKZseR5hkSE=; b=gAEzFjCCRSA0/rzOUAw6gUukopX1uodaxo+DYMpbumjMSsR60JQYQCzbgCMWZ4Jcc8 h8WVk++lgxZAMpl2+CCl+OTMtqXcPZh7cAdT2Abe6EVc6Ef3sb8dKG5hf1K/D2gGyQqh oOtM6bBufgfSkRXCe36qHYlw6ZYe9JGt+/XzA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=f219N9gRbsmDzLJf/GZoJUYlvw2UHa0SVunHJadkzuXr1T4mc5Zz8OVhJa32RkDBmp pYLRzNkWZWkPcd2KMkq//ZKeajdojPfCrLTbcHlFpfVa/UoOxsSC8xCNWkSbWV3jlrdA iW9QuoQDa/wZ6BmeF9P1tqPdm8oTueuZGhBtE= Original-Received: by 10.86.50.6 with SMTP id x6mr12392416fgx.71.1231194173145; Mon, 05 Jan 2009 14:22:53 -0800 (PST) Original-Received: by 10.86.35.9 with HTTP; Mon, 5 Jan 2009 14:22:53 -0800 (PST) In-Reply-To: Content-Disposition: inline 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:107618 Archived-At: On Mon, Jan 5, 2009 at 11:15 PM, Stefan Monnier wrote: >> If you add an autoload cookie to a defcustom >> ;;;###autoload >> (defcustom ourcomments-ido-ctrl-tab nil > >> and use get-file-autoloads on this then you get a load def > >> (defvar ourcomments-ido-ctrl-tab nil "\ >> bla bla doc") > >> (custom-autoload 'ourcomments-ido-ctrl-tab "ourcomments-util" nil) > >> This does not take care of :set etc in the defcustom AFAICS. Shouldn't >> it do that? > > It should and AFAIK it does. But your notion of "take care of" might be > different from mine. So please be more specific. If the load def above is run after custom-set-variables then the custom-set part of the defcustom symbol is not run since custom-autoload does not do that. I suggest using something like this instead of custom-autoload (defun nxhtml-custom-autoload (symbol load &optional noset) (custom-autoload symbol load noset) (let* ((standard (get symbol 'standard-value)) (saved (get symbol 'saved-value)) (need-set (get symbol 'custom-set))) (when (or need-set (equal standard saved)) (custom-load-symbol symbol)))) But I am not sure about the details. Jurij, could you please help with the details? What is necessary to do in the function above? >> (Is this the reason that minor modes defined in libraries >> external to Emacs are not turned on properly?) > > I don't know what you're referring to. Global minor modes have a custom-set symbol property that should be run when setting the minor mode through custom.