unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] master 5e43955 1/2: Don't declare vc-exec-after anymore
       [not found]   ` <CAAeL0STEg9P4GgT_XFJh_J0SexBnoT_Vh_=muMxsQYVBoNW-xA@mail.gmail.com>
@ 2015-10-22 12:08     ` Dmitry Gutov
  2015-10-22 12:25       ` Juanma Barranquero
  2015-10-22 15:04       ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Gutov @ 2015-10-22 12:08 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: emacs-devel

Hi Juanma,

On 10/22/2015 11:05 AM, Juanma Barranquero wrote:

>  > branch: master
>  > commit 5e4395544c184d9a8702cf05c7aee9329b0b9482
>  > Author: Dmitry Gutov <dgutov@yandex.ru <mailto:dgutov@yandex.ru>>
>  > Commit: Dmitry Gutov <dgutov@yandex.ru <mailto:dgutov@yandex.ru>>
>  >
>  >     Don't declare vc-exec-after anymore
...
> After this change, compiling vc-mtn.el, vc-git.el and vc-bzr.el give
> warnings (the other three don't):

Thank you for pointing that out. Any idea why that happens?

> trunk@C:\...\vc> for %i in (svn mtn hg cvs git bzr) do emacs -batch -Q
> -f batch-byte-compile vc-%i.el
>
> In end of data:
> vc-mtn.el:378:1:Warning: the function `vc-exec-after' might not be
> defined at
>      runtime.

No direct calls to vc-exec-after appear in any of these files anymore. 
All of them call vc-run-delayed, yet, as you say, the warning is 
displayed only when compiling some of them.

I'd think that if the compiler has gotten around to expanding 
vc-run-delayed, it must have already loaded vc-dispatcher. And then it 
also knows there vc-exec-after is defined.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Emacs-diffs] master 5e43955 1/2: Don't declare vc-exec-after anymore
  2015-10-22 12:08     ` [Emacs-diffs] master 5e43955 1/2: Don't declare vc-exec-after anymore Dmitry Gutov
@ 2015-10-22 12:25       ` Juanma Barranquero
  2015-10-22 15:04       ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Juanma Barranquero @ 2015-10-22 12:25 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 395 bytes --]

On Thu, Oct 22, 2015 at 2:08 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:

> Any idea why that happens?

Not really. I took a brief look and was puzzled, just like you ;-)

> I'd think that if the compiler has gotten around to expanding
vc-run-delayed, it must have already loaded vc-dispatcher.

Perhaps something is messing with loading vc-dispatcher, though I can't
imagine what or how.

    J

[-- Attachment #2: Type: text/html, Size: 596 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Emacs-diffs] master 5e43955 1/2: Don't declare vc-exec-after anymore
  2015-10-22 12:08     ` [Emacs-diffs] master 5e43955 1/2: Don't declare vc-exec-after anymore Dmitry Gutov
  2015-10-22 12:25       ` Juanma Barranquero
@ 2015-10-22 15:04       ` Eli Zaretskii
  2015-10-23  7:29         ` Eli Zaretskii
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2015-10-22 15:04 UTC (permalink / raw)
  To: Dmitry Gutov; +Cc: lekktu, emacs-devel

> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Thu, 22 Oct 2015 15:08:37 +0300
> Cc: emacs-devel <emacs-devel@gnu.org>
> 
>     address@hidden:\...\vc> for %i in (svn mtn hg cvs git bzr) do emacs -batch -Q
>     -f batch-byte-compile vc-%i.el
> 
>     In end of data:
>     vc-mtn.el:378:1:Warning: the function `vc-exec-after' might not be
>     defined at
>          runtime.
> 
> No direct calls to vc-exec-after appear in any of these files anymore. All of them call vc-run-delayed, yet, as you say, the warning is displayed only when compiling some of them.

FWIW, on my system I see that warning with all the vc-*.el files that
call vc-run-delayed.  The only exception is vc-svn.el, and the reason
is this single line:

  (autoload 'vc-expand-dirs "vc")

If you remove it, the warning will appear in vc-svn.el as well.
(Loading vc loads vc-dispatcher as a side effect.)

Another data point: replace this:

  (eval-when-compile (require 'vc))

with this:

  (require 'vc)

and the warning also goes way.  So evidently there's some difference
between these two, or maybe a byte-compiler bug.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Emacs-diffs] master 5e43955 1/2: Don't declare vc-exec-after anymore
  2015-10-22 15:04       ` Eli Zaretskii
@ 2015-10-23  7:29         ` Eli Zaretskii
  2015-10-23 13:38           ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2015-10-23  7:29 UTC (permalink / raw)
  To: dgutov, lekktu; +Cc: emacs-devel

> Date: Thu, 22 Oct 2015 18:04:39 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: lekktu@gmail.com, emacs-devel@gnu.org
> 
> FWIW, on my system I see that warning with all the vc-*.el files that
> call vc-run-delayed.  The only exception is vc-svn.el, and the reason
> is this single line:
> 
>   (autoload 'vc-expand-dirs "vc")
> 
> If you remove it, the warning will appear in vc-svn.el as well.
> (Loading vc loads vc-dispatcher as a side effect.)
> 
> Another data point: replace this:
> 
>   (eval-when-compile (require 'vc))
> 
> with this:
> 
>   (require 'vc)
> 
> and the warning also goes way.  So evidently there's some difference
> between these two, or maybe a byte-compiler bug.

I think bug#21724 supplies an answer: eval-when-compile makes this
function known _at_compile_time_, but the warning says it might not be
known _at_run_time_.

IOW, for a macro it is enough to use eval-when-compile, but if that
macro calls a function, the function should be either auto-loaded, or
the package that defines that function should be require'd.

Does this make sense?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Emacs-diffs] master 5e43955 1/2: Don't declare vc-exec-after anymore
  2015-10-23  7:29         ` Eli Zaretskii
@ 2015-10-23 13:38           ` Dmitry Gutov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2015-10-23 13:38 UTC (permalink / raw)
  To: Eli Zaretskii, lekktu; +Cc: Stefan Monnier, emacs-devel

On 10/23/2015 10:29 AM, Eli Zaretskii wrote:

> I think bug#21724 supplies an answer: eval-when-compile makes this
> function known _at_compile_time_, but the warning says it might not be
> known _at_run_time_.
>
> IOW, for a macro it is enough to use eval-when-compile, but if that
> macro calls a function, the function should be either auto-loaded, or
> the package that defines that function should be require'd.

That makes a lot of sense, thank you. Even thought it's 
counter-intuitive, because that means we not only have to care about the 
functions we call, we must also know, in this kind of situations, what 
macros expand to.

But the fact that using (autoload foo "pkg") fixes it if pkg loads 
vc-dispatcher, muddies the problem. For me, it makes compilation succeed 
without warnings not only in vc-svn, but in vc-hg and vc-cvs as well.

Unless anyone has a better suggestion (Stefan?), guess I'll just revert 
the commit.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-23 13:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20151020190758.14547.6515@vcs.savannah.gnu.org>
     [not found] ` <E1ZocGN-0003nd-DB@vcs.savannah.gnu.org>
     [not found]   ` <CAAeL0STEg9P4GgT_XFJh_J0SexBnoT_Vh_=muMxsQYVBoNW-xA@mail.gmail.com>
2015-10-22 12:08     ` [Emacs-diffs] master 5e43955 1/2: Don't declare vc-exec-after anymore Dmitry Gutov
2015-10-22 12:25       ` Juanma Barranquero
2015-10-22 15:04       ` Eli Zaretskii
2015-10-23  7:29         ` Eli Zaretskii
2015-10-23 13:38           ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

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

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