unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Has eval-and-compile changed in emacs 27?
@ 2021-02-25 13:06 Leo Liu
  2021-02-25 14:59 ` Eli Zaretskii
  2021-02-25 16:18 ` Stefan Monnier
  0 siblings, 2 replies; 24+ messages in thread
From: Leo Liu @ 2021-02-25 13:06 UTC (permalink / raw)
  To: emacs-devel

Hi there,

A file
https://github.com/erlang/otp/blob/master/lib/tools/emacs/erldoc.el
suddenly has a compiler warning under emacs 27, which has no warnings
before.

    erldoc.el:535:1:Warning: the function ‘json-encode’ might not be
    defined at runtime.

I have (eval-and-compile (require 'json)) right before using json-encode
in a function body. Has anything changed in emacs 27 regarding
eval-and-compile? I checked NEWS but couldn't find anything.

Thanks,
Leo




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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 13:06 Has eval-and-compile changed in emacs 27? Leo Liu
@ 2021-02-25 14:59 ` Eli Zaretskii
  2021-02-25 15:06   ` Lars Ingebrigtsen
  2021-02-25 16:18 ` Stefan Monnier
  1 sibling, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2021-02-25 14:59 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

> From: Leo Liu <sdl.web@gmail.com>
> Date: Thu, 25 Feb 2021 21:06:15 +0800
> 
>     erldoc.el:535:1:Warning: the function ‘json-encode’ might not be
>     defined at runtime.
> 
> I have (eval-and-compile (require 'json)) right before using json-encode
> in a function body. Has anything changed in emacs 27 regarding
> eval-and-compile? I checked NEWS but couldn't find anything.

eval-and-compile doesn't make sure the function is known at run time,
it only makes sure it is known at compile time.

(And yes, I think we modified the diagnostics there lately.)



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 14:59 ` Eli Zaretskii
@ 2021-02-25 15:06   ` Lars Ingebrigtsen
  2021-02-25 15:23     ` Eli Zaretskii
  2021-02-25 15:30     ` Basil L. Contovounesios
  0 siblings, 2 replies; 24+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-25 15:06 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Leo Liu, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

> eval-and-compile doesn't make sure the function is known at run time,
> it only makes sure it is known at compile time.

That's `eval-when-compile', surely...  `eval-and-compile' also evaluates
at load time.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 15:06   ` Lars Ingebrigtsen
@ 2021-02-25 15:23     ` Eli Zaretskii
  2021-02-25 21:59       ` Leo Liu
  2021-02-25 15:30     ` Basil L. Contovounesios
  1 sibling, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2021-02-25 15:23 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: sdl.web, emacs-devel

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Thu, 25 Feb 2021 16:06:45 +0100
> Cc: Leo Liu <sdl.web@gmail.com>, emacs-devel@gnu.org
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > eval-and-compile doesn't make sure the function is known at run time,
> > it only makes sure it is known at compile time.
> 
> That's `eval-when-compile', surely...  `eval-and-compile' also evaluates
> at load time.

I guess my crystal ball said that Leo was using the former...

Sorry if my crystal ball is not clear enough today.



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 15:06   ` Lars Ingebrigtsen
  2021-02-25 15:23     ` Eli Zaretskii
@ 2021-02-25 15:30     ` Basil L. Contovounesios
  1 sibling, 0 replies; 24+ messages in thread
From: Basil L. Contovounesios @ 2021-02-25 15:30 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Eli Zaretskii, Leo Liu, emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> eval-and-compile doesn't make sure the function is known at run time,
>> it only makes sure it is known at compile time.
>
> That's `eval-when-compile', surely...  `eval-and-compile' also evaluates
> at load time.

Yes, but non-top-level requires don't usually make functions known at
run time; for that one needs autoload/declare-function.

Here's how I'd write this particular code, for example:

  (autoload 'json-encode "json")

  (defun
    ...
    (if (not json)
        (pp table (current-buffer))
      (defvar json-encoding-pretty-print)
      (let ((json-encoding-pretty-print t))
        (insert (json-encode table))))
    ...)

or alternatively:

  (defun
    ...
    (if (not json)
        (pp table (current-buffer))
      (require 'json)
      (defvar json-encoding-pretty-print)
      (declare-function json-encode "json" (object))
      (let ((json-encoding-pretty-print t))
        (insert (json-encode table))))
    ...

-- 
Basil



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 13:06 Has eval-and-compile changed in emacs 27? Leo Liu
  2021-02-25 14:59 ` Eli Zaretskii
@ 2021-02-25 16:18 ` Stefan Monnier
  2021-02-25 16:28   ` Stefan Monnier
  1 sibling, 1 reply; 24+ messages in thread
From: Stefan Monnier @ 2021-02-25 16:18 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

> https://github.com/erlang/otp/blob/master/lib/tools/emacs/erldoc.el
> suddenly has a compiler warning under emacs 27, which has no warnings
> before.
>
>     erldoc.el:535:1:Warning: the function ‘json-encode’ might not be
>     defined at runtime.

That's weird.  I haven't downloaded the whole thing, but I tried to
reproduce it by byte-compiling a file containing:

    (defun sm-foo-from-erldoc (json table output)
      (with-temp-buffer
        (if (not json)
            (pp table (current-buffer))
          (eval-and-compile (require 'json))
          (let ((json-encoding-pretty-print t))
            (insert (json-encode table))))
        (unless (file-directory-p (file-name-directory output))
          (make-directory (file-name-directory output) t))
        (write-region nil nil output nil nil nil 'ask)))

and that doesn't give me any such warning, neither with Debian's 27.1 nor
with `master`.


        Stefan




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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 16:18 ` Stefan Monnier
@ 2021-02-25 16:28   ` Stefan Monnier
  2021-02-25 21:55     ` Leo Liu
  2021-02-26  6:36     ` Richard Stallman
  0 siblings, 2 replies; 24+ messages in thread
From: Stefan Monnier @ 2021-02-25 16:28 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

>>     erldoc.el:535:1:Warning: the function ‘json-encode’ might not be
>>     defined at runtime.
> That's weird.

Oh, I see: it's the (eval-when-compile (require 'url-parse)) because
apparently `url-parse` now ends up loading `json` somehow.


        Stefan




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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 16:28   ` Stefan Monnier
@ 2021-02-25 21:55     ` Leo Liu
  2021-02-25 22:29       ` Stefan Monnier
  2021-02-26  6:36     ` Richard Stallman
  1 sibling, 1 reply; 24+ messages in thread
From: Leo Liu @ 2021-02-25 21:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 2021-02-25 11:28 -0500, Stefan Monnier wrote:
> Oh, I see: it's the (eval-when-compile (require 'url-parse)) because
> apparently `url-parse` now ends up loading `json` somehow.

I was trying to fix some elisp warnings in
https://github.com/erlang/otp/pull/4542 but there was failed tests:

../../../otp/lib/erlang/lib/tools-3.5/emacs/erldoc.el:534:1:Error: the following functions might not be defined at runtime: json-encode, cl-reduce, cl-mapcan

Somehow I stumbled upon a fix by moving (eval-when-compile (require
'url-parse)) to after (require 'cl-lib) to get rid of the cl-reduce,
cl-mapcan warnings in Emacs 27. But I never understand why. Any ideas?



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 15:23     ` Eli Zaretskii
@ 2021-02-25 21:59       ` Leo Liu
  0 siblings, 0 replies; 24+ messages in thread
From: Leo Liu @ 2021-02-25 21:59 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Lars Ingebrigtsen, emacs-devel

On 2021-02-25 17:23 +0200, Eli Zaretskii wrote:
> I guess my crystal ball said that Leo was using the former...
> Sorry if my crystal ball is not clear enough today.

No problem at all ;)



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 21:55     ` Leo Liu
@ 2021-02-25 22:29       ` Stefan Monnier
  2021-02-26  2:40         ` Leo Liu
  0 siblings, 1 reply; 24+ messages in thread
From: Stefan Monnier @ 2021-02-25 22:29 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

> Somehow I stumbled upon a fix by moving (eval-when-compile (require
> 'url-parse)) to after (require 'cl-lib) to get rid of the cl-reduce,
> cl-mapcan warnings in Emacs 27. But I never understand why. Any ideas?

That one's easy: the way the warning works is that when we process
a `eval-when-compile` we look at the `load-history` to see the functions
that have been defined during execution of its body, and then we remember
those as "only available now but maybe not at runtime".

If that loaded `cl-lib`, then a subsequent (require 'cl-lib) will be
a no-op and won't "unremember" the corresponding functions.


        Stefan




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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 22:29       ` Stefan Monnier
@ 2021-02-26  2:40         ` Leo Liu
  2021-02-26  3:54           ` Stefan Monnier
  0 siblings, 1 reply; 24+ messages in thread
From: Leo Liu @ 2021-02-26  2:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 2021-02-25 17:29 -0500, Stefan Monnier wrote:
> That one's easy: the way the warning works is that when we process
> a `eval-when-compile` we look at the `load-history` to see the functions
> that have been defined during execution of its body, and then we remember
> those as "only available now but maybe not at runtime".
>
> If that loaded `cl-lib`, then a subsequent (require 'cl-lib) will be
> a no-op and won't "unremember" the corresponding functions.

This sounds like nightmare :(

Is this new in Emacs 27? What prompted the change?

I think when managing dependencies I want to be able to look locally at
what I put in a elisp file and be done with it.

The new behaviour means I also need to chase dependencies and their
dependencies...

Another point is subsequent (require 'cl-lib) provides stronger
guarantee but is ignored which produces spurious warnings.



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  2:40         ` Leo Liu
@ 2021-02-26  3:54           ` Stefan Monnier
  2021-02-26  8:40             ` Leo Liu
  0 siblings, 1 reply; 24+ messages in thread
From: Stefan Monnier @ 2021-02-26  3:54 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

>> That one's easy: the way the warning works is that when we process
>> a `eval-when-compile` we look at the `load-history` to see the functions
>> that have been defined during execution of its body, and then we remember
>> those as "only available now but maybe not at runtime".
>>
>> If that loaded `cl-lib`, then a subsequent (require 'cl-lib) will be
>> a no-op and won't "unremember" the corresponding functions.
>
> This sounds like nightmare :(
>
> Is this new in Emacs 27?

No, it was new back when we added the "not known to exist at run-time",
i.e. a long time ago.

> What prompted the change?

We found it useful to try and warn the users when they did
(eval-when-compile (require FOO)) but FOO was also needed at run time.


        Stefan




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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-25 16:28   ` Stefan Monnier
  2021-02-25 21:55     ` Leo Liu
@ 2021-02-26  6:36     ` Richard Stallman
  2021-02-26  7:54       ` Eli Zaretskii
  1 sibling, 1 reply; 24+ messages in thread
From: Richard Stallman @ 2021-02-26  6:36 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: sdl.web, emacs-devel

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > Oh, I see: it's the (eval-when-compile (require 'url-parse)) because
  > apparently `url-parse` now ends up loading `json` somehow.

It's not a good thing for a package to load more other packages
unnecessarily.  If it happens just once, it is not a big deal.
But if many libraries do it, it could lead to a cascade of bloat.

Does url-parse need json all the time, or only in rare special cases?

-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  6:36     ` Richard Stallman
@ 2021-02-26  7:54       ` Eli Zaretskii
  2021-02-26  9:09         ` Basil L. Contovounesios
  2021-02-27  0:34         ` Tomas Hlavaty
  0 siblings, 2 replies; 24+ messages in thread
From: Eli Zaretskii @ 2021-02-26  7:54 UTC (permalink / raw)
  To: rms; +Cc: emacs-devel, monnier, sdl.web

> From: Richard Stallman <rms@gnu.org>
> Date: Fri, 26 Feb 2021 01:36:52 -0500
> Cc: sdl.web@gmail.com, emacs-devel@gnu.org
> 
> It's not a good thing for a package to load more other packages
> unnecessarily.  If it happens just once, it is not a big deal.
> But if many libraries do it, it could lead to a cascade of bloat.
> 
> Does url-parse need json all the time, or only in rare special cases?

I don't see json loaded by any file in the lisp/url directory, so it
must be some indirect load.  The easiest way of finding out who loads
it would be to run Emacs under GDB with a breakpoint on Fload.



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  3:54           ` Stefan Monnier
@ 2021-02-26  8:40             ` Leo Liu
  2021-02-26  9:21               ` Basil L. Contovounesios
  2021-02-26 14:06               ` Stefan Monnier
  0 siblings, 2 replies; 24+ messages in thread
From: Leo Liu @ 2021-02-26  8:40 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 2021-02-25 22:54 -0500, Stefan Monnier wrote:
> No, it was new back when we added the "not known to exist at run-time",
> i.e. a long time ago.

But the erldoc.el has been compiling without warnings since 24.5 and it
suddenly changes in 27.

>> What prompted the change?
>
> We found it useful to try and warn the users when they did
> (eval-when-compile (require FOO)) but FOO was also needed at run time.

But it's been suggesting cl-reduce, cl-mapcan not defined at runtime
when I explicitly have (require 'cl-lib) in the file which seems
contradictory.



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  7:54       ` Eli Zaretskii
@ 2021-02-26  9:09         ` Basil L. Contovounesios
  2021-02-27  0:34         ` Tomas Hlavaty
  1 sibling, 0 replies; 24+ messages in thread
From: Basil L. Contovounesios @ 2021-02-26  9:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: sdl.web, rms, monnier, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Richard Stallman <rms@gnu.org>
>> Date: Fri, 26 Feb 2021 01:36:52 -0500
>> Cc: sdl.web@gmail.com, emacs-devel@gnu.org
>> 
>> It's not a good thing for a package to load more other packages
>> unnecessarily.  If it happens just once, it is not a big deal.
>> But if many libraries do it, it could lead to a cascade of bloat.
>> 
>> Does url-parse need json all the time, or only in rare special cases?
>
> I don't see json loaded by any file in the lisp/url directory, so it
> must be some indirect load.  The easiest way of finding out who loads
> it would be to run Emacs under GDB with a breakpoint on Fload.

url-parse.el has only three requires:

  (require 'url-vars)
  (require 'auth-source)
  (eval-when-compile (require 'cl-lib))

auth-source.el has a known JSON backend, and indeed it loads:

  (require 'json)
  (require 'password-cache)

  (require 'cl-lib)
  (require 'eieio)

-- 
Basil



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  8:40             ` Leo Liu
@ 2021-02-26  9:21               ` Basil L. Contovounesios
  2021-02-26  9:33                 ` Basil L. Contovounesios
  2021-02-28  1:35                 ` Leo Liu
  2021-02-26 14:06               ` Stefan Monnier
  1 sibling, 2 replies; 24+ messages in thread
From: Basil L. Contovounesios @ 2021-02-26  9:21 UTC (permalink / raw)
  To: Leo Liu; +Cc: Stefan Monnier, emacs-devel

Leo Liu <sdl.web@gmail.com> writes:

> On 2021-02-25 22:54 -0500, Stefan Monnier wrote:
>> No, it was new back when we added the "not known to exist at run-time",
>> i.e. a long time ago.
>
> But the erldoc.el has been compiling without warnings since 24.5 and it
> suddenly changes in 27.
>
>>> What prompted the change?
>>
>> We found it useful to try and warn the users when they did
>> (eval-when-compile (require FOO)) but FOO was also needed at run time.
>
> But it's been suggesting cl-reduce, cl-mapcan not defined at runtime
> when I explicitly have (require 'cl-lib) in the file which seems
> contradictory.

What's new in Emacs 27 is auth-source now does

  (require 'cl-lib)

instead of

  (eval-when-compile (require 'cl-lib))

lisp/auth-source.el: Depend on cl-lib unconditionally
90a7cd073b 2019-11-26 14:00:25 +0100
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=90a7cd073bfc7461e0bc824e9883499fe9026727

In turn, url-parse does

  (require 'auth-source)

and erldoc does

  (eval-when-compile (require 'url-parse))
  (require 'cl-lib)

This combination seems to confuse the byte-compiler.

-- 
Basil



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  9:21               ` Basil L. Contovounesios
@ 2021-02-26  9:33                 ` Basil L. Contovounesios
  2021-02-26 12:06                   ` Eli Zaretskii
  2021-02-28  1:35                 ` Leo Liu
  1 sibling, 1 reply; 24+ messages in thread
From: Basil L. Contovounesios @ 2021-02-26  9:33 UTC (permalink / raw)
  To: Leo Liu; +Cc: Stefan Monnier, emacs-devel

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> and erldoc does
>
>   (eval-when-compile (require 'url-parse))
>   (require 'cl-lib)
>
> This combination seems to confuse the byte-compiler.

One solution is to transpose those lines and load cl-lib before
url-parse.

-- 
Basil



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  9:33                 ` Basil L. Contovounesios
@ 2021-02-26 12:06                   ` Eli Zaretskii
  0 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2021-02-26 12:06 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: emacs-devel, sdl.web, monnier

> From: "Basil L. Contovounesios" <contovob@tcd.ie>
> Date: Fri, 26 Feb 2021 09:33:13 +0000
> Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
> 
> >   (eval-when-compile (require 'url-parse))
> >   (require 'cl-lib)
> >
> > This combination seems to confuse the byte-compiler.
> 
> One solution is to transpose those lines and load cl-lib before
> url-parse.

With a comment about the importance of the order, please.



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  8:40             ` Leo Liu
  2021-02-26  9:21               ` Basil L. Contovounesios
@ 2021-02-26 14:06               ` Stefan Monnier
  1 sibling, 0 replies; 24+ messages in thread
From: Stefan Monnier @ 2021-02-26 14:06 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

>> No, it was new back when we added the "not known to exist at run-time",
>> i.e. a long time ago.
> But the erldoc.el has been compiling without warnings since 24.5 and it
> suddenly changes in 27.

That's apparently a consequence of auth-source (`require`d by
`url-parse`) now `require`ing `json`.

>> We found it useful to try and warn the users when they did
>> (eval-when-compile (require FOO)) but FOO was also needed at run time.
> But it's been suggesting cl-reduce, cl-mapcan not defined at runtime
> when I explicitly have (require 'cl-lib) in the file which seems
> contradictory.

Yes, obviously the technique currently used doesn't always get it right.
Patches welcome ;-)


        Stefan




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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  7:54       ` Eli Zaretskii
  2021-02-26  9:09         ` Basil L. Contovounesios
@ 2021-02-27  0:34         ` Tomas Hlavaty
  2021-02-27  7:16           ` Eli Zaretskii
  1 sibling, 1 reply; 24+ messages in thread
From: Tomas Hlavaty @ 2021-02-27  0:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On Fri 26 Feb 2021 at 09:54, Eli Zaretskii <eliz@gnu.org> wrote:
> The easiest way of finding out who loads it would be to run Emacs
> under GDB with a breakpoint on Fload.

does trace-function not work on C functions?



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-27  0:34         ` Tomas Hlavaty
@ 2021-02-27  7:16           ` Eli Zaretskii
  0 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2021-02-27  7:16 UTC (permalink / raw)
  To: Tomas Hlavaty; +Cc: emacs-devel

> From: Tomas Hlavaty <tom@logand.com>
> Cc: emacs-devel@gnu.org
> Date: Sat, 27 Feb 2021 01:34:11 +0100
> 
> On Fri 26 Feb 2021 at 09:54, Eli Zaretskii <eliz@gnu.org> wrote:
> > The easiest way of finding out who loads it would be to run Emacs
> > under GDB with a breakpoint on Fload.
> 
> does trace-function not work on C functions?

It's limited for tracing those; see "Restrictions" in the trace.el's
commentary.

More importantly, it is hard or even impossible to use this when
looking for loads that happen at startup time, which is what this
discussion is about.  (Also, trace.el is much heavier than a single
breakpoint.)



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-26  9:21               ` Basil L. Contovounesios
  2021-02-26  9:33                 ` Basil L. Contovounesios
@ 2021-02-28  1:35                 ` Leo Liu
  2021-02-28  5:04                   ` Stefan Monnier
  1 sibling, 1 reply; 24+ messages in thread
From: Leo Liu @ 2021-02-28  1:35 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: Stefan Monnier, emacs-devel

On 2021-02-26 09:21 +0000, Basil L. Contovounesios wrote:
> What's new in Emacs 27 is auth-source now does
>
>   (require 'cl-lib)
>
> instead of
>
>   (eval-when-compile (require 'cl-lib))
>
> lisp/auth-source.el: Depend on cl-lib unconditionally
> 90a7cd073b 2019-11-26 14:00:25 +0100
> https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=90a7cd073bfc7461e0bc824e9883499fe9026727
>
> In turn, url-parse does
>
>   (require 'auth-source)
>
> and erldoc does
>
>   (eval-when-compile (require 'url-parse))
>   (require 'cl-lib)
>
> This combination seems to confuse the byte-compiler.

Great discovery. It is sad that this is happening. Will wait to see if
others get annoyed by this inadequacy.



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

* Re: Has eval-and-compile changed in emacs 27?
  2021-02-28  1:35                 ` Leo Liu
@ 2021-02-28  5:04                   ` Stefan Monnier
  0 siblings, 0 replies; 24+ messages in thread
From: Stefan Monnier @ 2021-02-28  5:04 UTC (permalink / raw)
  To: Leo Liu; +Cc: Basil L. Contovounesios, emacs-devel

> Great discovery. It is sad that this is happening. Will wait to see if
> others get annoyed by this inadequacy.

I doubt waiting will make much of a difference: this problem
exists since commit ea4b0ca303f8ac30f87fd2ee905a6db53951c636
21 years ago.


        Stefan




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

end of thread, other threads:[~2021-02-28  5:04 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 13:06 Has eval-and-compile changed in emacs 27? Leo Liu
2021-02-25 14:59 ` Eli Zaretskii
2021-02-25 15:06   ` Lars Ingebrigtsen
2021-02-25 15:23     ` Eli Zaretskii
2021-02-25 21:59       ` Leo Liu
2021-02-25 15:30     ` Basil L. Contovounesios
2021-02-25 16:18 ` Stefan Monnier
2021-02-25 16:28   ` Stefan Monnier
2021-02-25 21:55     ` Leo Liu
2021-02-25 22:29       ` Stefan Monnier
2021-02-26  2:40         ` Leo Liu
2021-02-26  3:54           ` Stefan Monnier
2021-02-26  8:40             ` Leo Liu
2021-02-26  9:21               ` Basil L. Contovounesios
2021-02-26  9:33                 ` Basil L. Contovounesios
2021-02-26 12:06                   ` Eli Zaretskii
2021-02-28  1:35                 ` Leo Liu
2021-02-28  5:04                   ` Stefan Monnier
2021-02-26 14:06               ` Stefan Monnier
2021-02-26  6:36     ` Richard Stallman
2021-02-26  7:54       ` Eli Zaretskii
2021-02-26  9:09         ` Basil L. Contovounesios
2021-02-27  0:34         ` Tomas Hlavaty
2021-02-27  7:16           ` Eli Zaretskii

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