From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/54190 Path: main.gmane.org!not-for-mail From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de> Newsgroups: gmane.emacs.gnus.general Subject: Re: loading spam.el and gnus-registry.el with set variables only Date: Thu, 09 Oct 2003 18:24:28 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Sender: ding-owner@lists.math.uh.edu Message-ID: References: <4ny8vwnb04.fsf@lockgroove.bwh.harvard.edu> <4nbrsqzd41.fsf@lockgroove.bwh.harvard.edu> Reply-To: reiner.steib@gmx.de NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1065716855 31915 80.91.224.253 (9 Oct 2003 16:27:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Oct 2003 16:27:35 +0000 (UTC) Original-X-From: ding-owner+M2731@lists.math.uh.edu Thu Oct 09 18:27:33 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A7ddV-0006MZ-00 for ; Thu, 09 Oct 2003 18:27:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1A7dck-0003v7-00; Thu, 09 Oct 2003 11:26:46 -0500 Original-Received: from justine.libertine.org ([66.139.78.221]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1A7dcd-0003uy-00 for ding@lists.math.uh.edu; Thu, 09 Oct 2003 11:26:39 -0500 Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by justine.libertine.org (Postfix) with ESMTP id D88503A004E for ; Thu, 9 Oct 2003 11:26:37 -0500 (CDT) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1A7dca-0001q5-00 for ; Thu, 09 Oct 2003 18:26:36 +0200 Mail-Followup-To: ding@gnus.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A7dcZ-0001px-00 for ; Thu, 09 Oct 2003 18:26:35 +0200 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1A7dcZ-0008Gk-00 for ; Thu, 09 Oct 2003 18:26:35 +0200 Original-Lines: 74 Original-X-Complaints-To: usenet@sea.gmane.org X-Face: /U7=m^"/-Dn61mAl{g9e3>\G5Tp,oEX|V)g2I1hBk\ML;)7A?6cmB-y7y?'NA^J<=oz7syB =(McAwIHgLX!.B?R3X}98d@?>CrT094KLWh]WU4gDpnL/")MS(XoQTv`Oq225uL>+;CpPXo$N5e>N> $tPd-gbB^F{gQS#1ase]XO~D4p4M"3+F-7~u]dy3I?Pb8RO*H-EFeWDUf?Rf,d]pv\Jvh2Cht!A=im yKAS2Z%Ao^;}W/qzMvMm Mail-Copies-To: nobody User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:ryuGTGra13ldjTY4c3H+eGESQ6I= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:54190 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:54190 On Thu, Oct 09 2003, Ted Zlatanov wrote: > On Tue, 07 Oct 2003, tzz@lifelogs.com wrote: > >> Speaking for those two packages, it has been the #1 problem that >> people have to set a variable (gnus-registry-install or >> spam-install-hooks) and then do a require of the .el file. How >> could I make it so setting any of the two variables above will load >> its appropriate package when Gnus is loaded? [Disclaimer: I'm not familiar with gnus-registry.el and spam*.el internals.] The importance of the order seems quite fragile to me, isn't it? _Normally_ (counter-examples follow below) I'd expect that changing a variable has some effect, no matter if a corresponding package is loaded before or after setting the variable. I'd use functions, say `gnus-registry-initialize' and `spam-initialize' (or -install?) and autoload those functions: ;;;###autoload (defun gnus-registry-initialize ...) ;;;###autoload (defun spam-initialize ...) Probably, you should also add autoload cookies to the relevant variables. E.g. in my current setup, gnus-registry isn't loaded, so I cannot customize `gnus-registry-install'. > Anyone? If this is not yet standardized in Gnus, I'll go ahead and > put some code in gnus.el that will look in a table of symbols and if > the symbol is set, will load the corresponding library. I just want > to make sure I'm not missing something obvious. I doubt that we have a Gnus-specific standard/convention. Maybe there's something in the Emacs or Elisp manual? Maybe, instead of ...-initialize, using a minor mode is better? Grepping the Emacs lisp sources for "no effect" gives some examples: ,----[ C-h v normal-erase-is-backspace RET ] | normal-erase-is-backspace's value is t | [...] | Setting this variable with setq doesn't take effect. Programmatically, | call `normal-erase-is-backspace-mode' (which see) instead. | | You can customize this variable. | | Defined in `simple'. `---- ,----[ C-h v utf-translate-cjk-mode RET (in CVS HEAD) ] | utf-translate-cjk-mode's value is nil | | Non-nil if Utf-Translate-Cjk mode is enabled. | See the command `utf-translate-cjk-mode' for a description of this | minor-mode. | Setting this variable directly does not take effect; | use either M-x customize or the function `utf-translate-cjk-mode'. | | You can customize this variable. | | Defined in `international/utf-8'. `---- See the ":set" and ":initialize" keyword of `defcustom'. Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/