Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Subject: Re: loading spam.el and gnus-registry.el with set variables only
Date: Thu, 09 Oct 2003 18:24:28 +0200	[thread overview]
Message-ID: <v9brsq2xc3.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <4nbrsqzd41.fsf@lockgroove.bwh.harvard.edu>

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/




  reply	other threads:[~2003-10-09 16:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-07 18:44 Ted Zlatanov
2003-10-09 14:42 ` Ted Zlatanov
2003-10-09 16:24   ` Reiner Steib [this message]
2003-10-09 18:00     ` Ted Zlatanov
2003-10-09 19:37       ` Reíner Steib
2003-10-09 19:51         ` Ted Zlatanov
2003-10-10 16:05           ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9brsq2xc3.fsf@marauder.physik.uni-ulm.de \
    --to=4.uce.03.r.s@nurfuerspam.de \
    --cc=reiner.steib@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).