unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org
Subject: Re: Flycheck reports are never satisfying!?
Date: Thu, 28 Aug 2014 16:14:17 +0200	[thread overview]
Message-ID: <86bnr4ya4m.fsf@somewhere.org> (raw)
In-Reply-To: mailman.7720.1409233288.1147.help-gnu-emacs@gnu.org

Hello Stefan,

Stefan Monnier wrote:
>> --8<---------------cut here---------------start------------->8---
>>    25   9 warning  assignment to free variable `flycheck-indication-mode' (emacs-lisp)
>> --8<---------------cut here---------------end--------------->8---
>
> The .emacs file is very much unlike a normal Elisp package: instead of
> defining its own functions/command/variables and exporting them for
> use, it normally does mostly things like modifying other package's
> variables.

Right. Though I'd think many, many packages still rely on others (and
refer them). The first example that comes to my mind is Org that is
based on Outline. Or "horizontal" packages called in many others, such
as Helm or IDO...

In such cases, the packages (which use "externals") will output as many
warnings as well, for references to "undefined variables"?

> And those packages are usually not loaded yet, because we want to load
> them lazily to speed up startup.

Right. That's why my preferred solution to write things in my .emacs is
something along these lines:

--8<---------------cut here---------------start------------->8---
  (global-set-key (kbd "<key>") 'some-pkg-fun-foo)

  (with-eval-after-load "some-pkg"
    (setq some-pkg-var-1 "bar")
    (some-pkg-fun-baz))
--8<---------------cut here---------------end--------------->8---

or (for not-heavy packages):

--8<---------------cut here---------------start------------->8---
  (when (try-require 'some-pkg)
    (setq some-pkg-var-1 "bar")
    (some-pkg-fun-baz)
    ...)
--8<---------------cut here---------------end--------------->8---

> So yes, if you try to byte-compile your .emacs chances are the
> byte-compiler will give you lots and lots of warnings about
> assignments or references to free variables.

Still, I don't understand why my first example did return an error:
there is an explicit call to a package which clearly is in `load-path',
so why is the package reported as missing/unloadable?

> That's a problem I'd like to fix, but I'm not completely sure how.
> Suggestions welcome,

Best regards,
  Seb

-- 
Sebastien Vauban


  parent reply	other threads:[~2014-08-28 14:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-28 12:05 Flycheck reports are never satisfying!? Sebastien Vauban
2014-08-28 13:40 ` Stefan Monnier
2014-08-28 15:15   ` Sebastian Wiesner
2014-08-28 15:48     ` Stefan Monnier
2014-08-29  9:01       ` Sebastian Wiesner
2014-08-29 13:05         ` Stefan Monnier
     [not found]     ` <mailman.7732.1409240949.1147.help-gnu-emacs@gnu.org>
2014-08-28 17:35       ` Sebastien Vauban
2014-08-29  3:32         ` Stefan Monnier
     [not found] ` <mailman.7720.1409233288.1147.help-gnu-emacs@gnu.org>
2014-08-28 14:14   ` Sebastien Vauban [this message]
2014-08-28 14:38     ` Stefan Monnier
2014-08-28 15:51       ` worrying about byte-compiler warnings [was: Flycheck reports are never satisfying!?] Drew Adams
2014-08-28 15:25 ` Flycheck reports are never satisfying!? Sebastian Wiesner
     [not found]   ` <61C65218-4004-4FD5-ABE0-6C863E5F60A6-MMJ3jE1zGgOaMJb+Lgu22Q@public.gmane.org>
2014-08-28 15:39     ` Sebastien Vauban
2014-08-28 15:45       ` Sebastian Wiesner
     [not found]         ` <B540BE8A-D03C-4F2D-ADB7-2A17F8E55F4E-MMJ3jE1zGgOaMJb+Lgu22Q@public.gmane.org>
2014-08-28 18:35           ` Sebastien Vauban
     [not found]         ` <mailman.7753.1409250970.1147.help-gnu-emacs@gnu.org>
     [not found]           ` <mailman.7753.1409250970.1147.help-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2014-09-01 10:00             ` Sebastien Vauban
2014-09-01 10:23               ` Sebastian Wiesner
2014-09-01 12:27 ` sokobania.01
2014-09-01 12:30 ` sokobania.01

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86bnr4ya4m.fsf@somewhere.org \
    --to=sva-news-d0wtavr13harg/idocfnwg@public.gmane.org \
    --cc=help-gnu-emacs-mXXj517/zsQ@public.gmane.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).