[Top][All Lists]

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

Re: Package initialization

From: Artur Malabarba
Subject: Re: Package initialization
Date: Sun, 19 Jul 2015 13:33:37 +0100

>>> Any personal keybinding would override an autoloaded keymap entry anyway
>> I think that depends on which code runs first.
> Autoloads don't overwrite already loaded proper code.  They only
> overwrite previous autoloads.

That depends on what's autoloaded. Autoloads don't overwrite function
or prefix keymap definitions. But if the package developer autoloads
an arbitrary code snippet (like say, `(define-key some-map "k"
#'some-func)'), then that code will be run as is.

> So you would have to both
> a) define your own bindings with an autoloading keymap (why would you do
> that?)
> b) load libraries with autoloads _after_ defining your own autoloads
> (why would you do that?)

If a library autoloads a call to `define-key', that code will be
executed at the end of emacs initialization (by default).
Then, if the user has a call to `define-key' in his init file for the
same key and keymap, that will get overwriten by the autoload (by no
fault of the user).

reply via email to

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