emacs-devel
[Top][All Lists]
Advanced

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

Re: pacifying "might not be defined at runtime" warning


From: Stefan Monnier
Subject: Re: pacifying "might not be defined at runtime" warning
Date: Mon, 09 May 2016 08:20:29 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> "cd lisp; make compile-always" generates several "might not be defined at
> runtime" warnings in the master branch. For example, it generates the attached
> warnings in lisp/vc.

[ Note: when I say "vc.el" below, it includes generic VC
  files other than vc-hooks.el, such as vc-dispatch.el.  ]

The vc-<backend>.el files provide implementations for the functions used
in vc-hooks.el as well as for those used in vc.el.

In the parts that implement the vc.el functionality, it's "perfectly
safe" to call functions provided by vc.el, since they're supposed to
only be used *from* vc.el (i.e. when vc.el is already loaded).

> Is there some reason we shouldn't add directives like
> (require 'vc) to pacify the byte compiler here? (See the 2nd attachment.)

The reason is that vc-<backend>.el is autoloaded as soon as you visit
a file that's managed by <backend>, even if you never have and never
will use VC, so a (require 'vc) in those files would load VC
too eagerly.


        Stefan




reply via email to

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