Alex Kost (2017-04-11 23:04 +0300) wrote:

> Chris Marusich (2017-04-11 00:40 -0700) wrote:
>
>> Alex Kost <alez...@gmail.com> writes:
>>
>>> Note, however, that in most cases (not in this case) using "require" is
>>> not needed at all!  Usually it is enough to have the generated
>>> autoloads.  For example, if you install 'magit', you don't need to (and
>>> shouldn't!) put "(require 'magit)" in your emacs config.  You can use
>>> "M-x magit-status" right away as 'magit-status' command is "autoloaded".
>>
>> That's good to know.  I guess this module didn't do the "autoload magic"
>> that some modules, like magit, do?
>
> Unlike such packages as magit, this package doesn't provide any
> interactive command (thus there is no point to autoload anything), it
> just extends the existing Emacs functionality when it is loaded.  It
> does so simply by adding a couple of hooks, so if you would like to
> avoid loading this package on Emacs start, you can add these hooks
> yourself:
>
> (add-hook 'gnus-message-setup-hook 'mml-secure-encrypt-if-possible)
> (add-hook 'message-send-hook 'mml-secure-check-encryption-p)

Oops, I forgot one thing:

  (autoload 'mml-secure-encrypt-if-possible "jl-encrypt")
  (autoload 'mml-secure-check-encryption-p "jl-encrypt")

> If you add the above 2 lines to your emacs config (instead of the
> "require" line), "jl-encrypt" package will not be loaded on Emacs
> start.  It will be loaded when you'll begin to write a message.

-- 
Alex

Reply via email to