all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: autoload seems inconsistent
Date: Thu, 14 Mar 2019 18:18:48 -0400	[thread overview]
Message-ID: <jwv1s39dsvg.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: CAM-tV-8gJ9A+uhKOveEZfhum4EwsoK2759wb=oNSyTbpCPgZcw@mail.gmail.com

>> 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




  parent reply	other threads:[~2019-03-14 22:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 17:25 autoload seems inconsistent Stefan Huchler
2019-03-14 17:35 ` Noam Postavsky
2019-03-14 18:58   ` Stefan Huchler
2019-03-14 22:18   ` Stefan Monnier [this message]
2019-03-14 18:16 ` phillip.lord
2019-03-14 21:12   ` Stefan Huchler
2019-03-14 21:18     ` Noam Postavsky

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=jwv1s39dsvg.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.