emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Package initialization


From: Helmut Eller
Subject: Re: Package initialization
Date: Sun, 19 Jul 2015 09:23:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

On Sun, Jul 19 2015, Stephen J. Turnbull wrote:

> 1.  The package has an idempotent initialization function, typically
>     implemented by wrapping the whole function in `(if (not
>     <package>-initialized-p) ...)'.
> 2.  The autoloads include exactly those commands that users are
>     expected to invoke in the uninitialized state.  (Users who know
>     what they are doing can of course explicitly require or load
>     package files and call any function.)
> 3.  All autoloaded commands should call the package initialization
>     function as their first action.
> 4.  The autoloads may defvar global variables in the package's
>     namespace.  However defcustoms (which are automatically
>     initialized by the XEmacs package system) are preferred for
>     variables the user might customize, even if that is unusual.
[]
>  > I quite like to see the explicit call to slime-setup in my .emacs, but
>  > others might not.
>
> I think the rules 1-4 above would satisfy both you and those others.

I don't see how.  Either (require 'slime-autoloads) calls slime-setup or
not.  Calling it lazily when a SLIME related command is invoked the
first time would kinda work for SLIME, but it would be rather strange
that say the slime-connect command implicitly adds hooks to
lisp-mode-hook.  In general, lazy initialization would also not work
well if those autoloaded commands should be bound to keys because before
the first invocation the keys would not be bound.

Helmut



reply via email to

[Prev in Thread] Current Thread [Next in Thread]