unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Allow calling package-initialize more than once
@ 2018-08-11 19:51 Radon Rosborough
  2018-08-20 18:10 ` Radon Rosborough
  2018-08-29  2:25 ` Tom Tromey
  0 siblings, 2 replies; 8+ messages in thread
From: Radon Rosborough @ 2018-08-11 19:51 UTC (permalink / raw)
  To: emacs-devel

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

I would like to propose the following change, as a corollary to
previous changes to package initialization for Emacs 27:

| When `package-initialize' is first called, it acts as before; however,
| if it is called again, then it does nothing. This behavior can be
| overridden using a dynamically bound variable or an additional
| argument to `package-initialize'.

This change breaks backwards compatibility only in the following
case:

| Someone who already uses Emacs 27 intentionally calls
| `package-initialize' in their early init-file, then customizes
| `package-user-dir', then intentionally calls `package-initialize'
| again.

I am fairly confident that this use case has never been exercised by
anyone, so the change should be safe.

The benefit to making this change is that there is no need for people
to remove extraneous calls to `package-initialize' from their
init-file when upgrading from Emacs 26 to Emacs 27, and we may remove
the annoying warning introduced in [1] and discussed at [2].

If there are no objections, I would like to prepare a patch to
implement the change.

Best regards,
Radon Rosborough

[1]:
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=2db57579b08ac99c464b6d3698648b3167fc5d55
[2]: https://lists.gnu.org/archive/html/emacs-devel/2018-02/msg00626.html

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

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

* Re: Allow calling package-initialize more than once
  2018-08-11 19:51 Allow calling package-initialize more than once Radon Rosborough
@ 2018-08-20 18:10 ` Radon Rosborough
  2018-08-28 20:36   ` Radon Rosborough
  2018-08-29  2:25 ` Tom Tromey
  1 sibling, 1 reply; 8+ messages in thread
From: Radon Rosborough @ 2018-08-20 18:10 UTC (permalink / raw)
  To: emacs-devel

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

> If there are no objections, I would like to prepare a patch to
> implement the change.

Does the lack of comments mean I am good to go with this?

Thanks,
Radon

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

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

* Re: Allow calling package-initialize more than once
  2018-08-20 18:10 ` Radon Rosborough
@ 2018-08-28 20:36   ` Radon Rosborough
  2018-08-28 22:11     ` Clément Pit-Claudel
  0 siblings, 1 reply; 8+ messages in thread
From: Radon Rosborough @ 2018-08-28 20:36 UTC (permalink / raw)
  To: emacs-devel

Hi,

Is this plan good to go? I would like to get some acknowledgement
before I start writing code.

Thanks,
Radon



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

* Re: Allow calling package-initialize more than once
  2018-08-28 20:36   ` Radon Rosborough
@ 2018-08-28 22:11     ` Clément Pit-Claudel
  2018-08-29 15:45       ` Radon Rosborough
  0 siblings, 1 reply; 8+ messages in thread
From: Clément Pit-Claudel @ 2018-08-28 22:11 UTC (permalink / raw)
  To: emacs-devel

On 2018-08-28 16:36, Radon Rosborough wrote:
> Hi,
> 
> Is this plan good to go? I would like to get some acknowledgement
> before I start writing code.

FWIW this change sounds useful to me.  I can't think of problems it might cause.
It might be good to still make no-op calls to package initialize print a message (but not a warning)?
Lastly, making the existing warning more explicit might be useful (see confusion on e.g. https://github.com/jkitchin/scimax/issues/194)



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

* Re: Allow calling package-initialize more than once
  2018-08-11 19:51 Allow calling package-initialize more than once Radon Rosborough
  2018-08-20 18:10 ` Radon Rosborough
@ 2018-08-29  2:25 ` Tom Tromey
  2018-08-29 15:50   ` Radon Rosborough
  1 sibling, 1 reply; 8+ messages in thread
From: Tom Tromey @ 2018-08-29  2:25 UTC (permalink / raw)
  To: Radon Rosborough; +Cc: emacs-devel

>>>>> "Radon" == Radon Rosborough <radon.neon@gmail.com> writes:

Radon> This change breaks backwards compatibility only in the following
Radon> case:

Radon> | Someone who already uses Emacs 27 intentionally calls
Radon> | `package-initialize' in their early init-file, then customizes
Radon> | `package-user-dir', then intentionally calls `package-initialize'
Radon> | again.

It seems like it also affects users who modify package-directory-list.

Perhaps you could just make package-initialize copy these values and
then do nothing if they have not changed.

Tom



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

* Re: Allow calling package-initialize more than once
  2018-08-28 22:11     ` Clément Pit-Claudel
@ 2018-08-29 15:45       ` Radon Rosborough
  0 siblings, 0 replies; 8+ messages in thread
From: Radon Rosborough @ 2018-08-29 15:45 UTC (permalink / raw)
  To: Clément Pit-Claudel; +Cc: emacs-devel

> It might be good to still make no-op calls to package initialize
> print a message (but not a warning)?

No, I think that defeats the purpose of this change. My idea is to
make it so that people are not bothered by the package.el changes in
Emacs 27 unless they are really doing something that absolutely does
require changes to their configuration.

> Lastly, making the existing warning more explicit might be useful

True, but removing it entirely will be better, I think.



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

* Re: Allow calling package-initialize more than once
  2018-08-29  2:25 ` Tom Tromey
@ 2018-08-29 15:50   ` Radon Rosborough
  2018-08-29 19:33     ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Radon Rosborough @ 2018-08-29 15:50 UTC (permalink / raw)
  To: tom; +Cc: emacs-devel

> It seems like it also affects users who modify
> package-directory-list.

You are correct. The same is true of package-load-list, etc. I was
using package-user-dir as a stand-in for "any values which could be
changed to intentionally load two different sets of packages", and
should have been clearer about that.

> Perhaps you could just make package-initialize copy these values and
> then do nothing if they have not changed.

How about instead of trying to magically fix it, we signal a warning
like present, except only when the aforementioned variables have
changed between the two invocations of package-initialize?

That will solve the problem of ordinary users being unnecessarily
pestered about superfluous package-initialize calls, and also solve
the problem of things silently not working in advanced configurations.



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

* Re: Allow calling package-initialize more than once
  2018-08-29 15:50   ` Radon Rosborough
@ 2018-08-29 19:33     ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2018-08-29 19:33 UTC (permalink / raw)
  To: emacs-devel

>> Perhaps you could just make package-initialize copy these values and
>> then do nothing if they have not changed.
> How about instead of trying to magically fix it, we signal a warning
> like present, except only when the aforementioned variables have
> changed between the two invocations of package-initialize?

I think running package-initialize in those cases will better reproduce
the old behavior, so I think it's better to do that than to skip
running it.
But yes, it needs a warning in any case.


        Stefan




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

end of thread, other threads:[~2018-08-29 19:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-11 19:51 Allow calling package-initialize more than once Radon Rosborough
2018-08-20 18:10 ` Radon Rosborough
2018-08-28 20:36   ` Radon Rosborough
2018-08-28 22:11     ` Clément Pit-Claudel
2018-08-29 15:45       ` Radon Rosborough
2018-08-29  2:25 ` Tom Tromey
2018-08-29 15:50   ` Radon Rosborough
2018-08-29 19:33     ` Stefan Monnier

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