[Top][All Lists]

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

Re: Byte-compilation warning in eldoc.el

From: Stefan Monnier
Subject: Re: Byte-compilation warning in eldoc.el
Date: Fri, 10 Jul 2020 17:29:10 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>>> Thanks, fixed.  But curiously it doesn't.  You can call it (and I always
>>> do call it) with one argument, as one does in CL.
>> Technically, you can call it with one argument.
>> But in 99% of the cases it's a really bad idea.
> What's the difference to `intern'? or `intern-soft'?

Interning a new symbol doesn't affect existing ones, and interning an
old symbol doesn't do anything, so those two are perfectly harmless.
`unintern` on the other hand can render your Emacs session inoperable.

>>> By the way, the only reason I had to do this (I rarely use this outside
>>> interactive contexts)
>> Exactly: it might make sense occasionally while debugging, but is
>> usually an error in code.
> Not arguing but, like Drew, I wonder why.  FWIW in Common Lisp, intern,
> unintern, find-symbol, etc all assume the "current package" as the thing
> to operate on.

Same here.  `unintern` on the global obarray is really dangerous and
very rarely needed.  Most cases I've found were misuses better served
by something different (e.g. `makunbound`).

> 1. when you `package-install` the new eldoc 1.2.0 package in Emacs 26.3
>    for the first time, it just compiles it, it doesn't load it.  We had
>    witnessed this with Flymake too, remember?

`package-install` is not supposed to "load" the package (it installs
it, activates it, and compiles it).  But yes, it is also supposed to
*reload* already loaded files (right before compiling), so it looks like
there might be a bug somewhere.

You might want to trace through `package--load-files-for-activation` to
see why eldoc.el is not reloaded even though it should be in

> 2. When you shut down that Emacs session, start it again, run
>    package-initialize, you _still_ don't have the new eldoc.el file
>    (1.2.0) loaded.  This is only for eldoc.el, flymake.el works
>    correctly in this use case.

Yes, this is because it's preloaded in Emacs, so when package.el comes
to activate the package, the autoloads in `eldoc-autoloads.el` won't have any
effect because all its functions are already defined (since `eldoc.el`
is already loaded).

This is not a really bug in package.el but arguably a missing feature,
indeed.  When `package-activate-all` is called, it should probably
reload all packages that were already loaded before (when the version
already loaded is different from the one that's just been activated).


reply via email to

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