help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: autoload seems inconsistent


From: Stefan Monnier
Subject: Re: autoload seems inconsistent
Date: Thu, 14 Mar 2019 18:18:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> When I manually evaluate the whole kodi-remote.el file all works
>> fine. But when I install it over melpa and it autoloads something goes
>> south.
>>
>> When I start kodi-remote-movies it works but if I open up
>> kodi-remote-series or kodi-remote or kodi-remote-music I get such
>> errors:
>>
>> "kodi-remote-music-mode symbol value as variable is void"
>
> Do you get any compilation warnings? I guess the problem might be that
> you use the kodi-remote-context macro before it's defined.

Definitely looks like the culprit indeed.

While I'm here: you seem to have many more autoloads than needed,
because AFAICT it makes no sense to call kodi-remote-playlists-draw
before any other kodi-remote function.

Autoload cookies should only be placed on those function that can be
called by the user before the file is loaded.  Once one of those
function has been called, the autoload will have caused the file to be
loaded, so the other functions will be available already without any
need for an autoload cookie.

[ For similar reasons I don't think it's useful to make
  kodi-remote-playlists-draw into an interactive function: it only needs
  to be called via `revert-buffer-function`.  ]
  
Other problems in your file: you use CL functions and macros without
doing a (require 'cl), so it risks being miscompiled and/or failing at
run-time if CL wasn't loaded for other reasons (which is more and more
common as packages are slowly moving to the newer cl-lib instead).


        Stefan




reply via email to

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