unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Why 'define-package' marked obsolete?
@ 2023-03-20 16:21 dalanicolai
  2023-03-20 16:58 ` Philip Kaludercic
  2023-03-20 17:15 ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: dalanicolai @ 2023-03-20 16:21 UTC (permalink / raw)
  To: Emacs Devel

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

HI all!

Can I ask why 'define-package' was marked obsolete?
I can not find any information about it. I have searched the log,
where I could only find the respective commit
<https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ade7a212a882540178d9504e7e0bd3be3bf1fd41>
.

I have also searched the Emacs news for versions 28, 29 and 30,
but also there, I can find no information.

Also in the comments of package.el itself I can not find any information
about it.

Is it documented anywhere?

Thanks!

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

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

* Re: Why 'define-package' marked obsolete?
  2023-03-20 16:21 Why 'define-package' marked obsolete? dalanicolai
@ 2023-03-20 16:58 ` Philip Kaludercic
  2023-03-20 17:15 ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: Philip Kaludercic @ 2023-03-20 16:58 UTC (permalink / raw)
  To: dalanicolai; +Cc: Emacs Devel

dalanicolai <dalanicolai@gmail.com> writes:

> HI all!
>
> Can I ask why 'define-package' was marked obsolete?
> I can not find any information about it. I have searched the log,
> where I could only find the respective commit
> <https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ade7a212a882540178d9504e7e0bd3be3bf1fd41>
> .
>
> I have also searched the Emacs news for versions 28, 29 and 30,
> but also there, I can find no information.
>
> Also in the comments of package.el itself I can not find any information
> about it.
>
> Is it documented anywhere?

`Define-package' is not an expression that is to be evaluated, it is
just a (backwards-compatible) formatting for -pkg.el files.  If you take
a look at `package-process-define-package' and
`package-load-descriptor', you will see that the arguments are actually
passed to `package-desc-from-define' which is a `package-desc'
constructor.

AFAIU the changes you are interested in where made in the commit
a7270fb20feaedc5dc6c4e0936714bdb167062f7.

> Thanks!

-- 
Philip Kaludercic



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

* Re: Why 'define-package' marked obsolete?
  2023-03-20 16:21 Why 'define-package' marked obsolete? dalanicolai
  2023-03-20 16:58 ` Philip Kaludercic
@ 2023-03-20 17:15 ` Eli Zaretskii
  2023-03-20 19:32   ` Philip Kaludercic
  1 sibling, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2023-03-20 17:15 UTC (permalink / raw)
  To: dalanicolai; +Cc: emacs-devel

> From: dalanicolai <dalanicolai@gmail.com>
> Date: Mon, 20 Mar 2023 17:21:04 +0100
> 
> Can I ask why 'define-package' was marked obsolete?

It never did anything useful.  Its original implementation just
signaled an error.



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

* Re: Why 'define-package' marked obsolete?
  2023-03-20 17:15 ` Eli Zaretskii
@ 2023-03-20 19:32   ` Philip Kaludercic
  2023-03-21  9:10     ` dalanicolai
  0 siblings, 1 reply; 9+ messages in thread
From: Philip Kaludercic @ 2023-03-20 19:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: dalanicolai, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: dalanicolai <dalanicolai@gmail.com>
>> Date: Mon, 20 Mar 2023 17:21:04 +0100
>> 
>> Can I ask why 'define-package' was marked obsolete?
>
> It never did anything useful.  Its original implementation just
> signaled an error.

I just looked up the definition from when package.el was merged[0], and it
did stuff, mainly modifying `package-alist'.

[0] https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/package.el?id=44198b6ee97bcb0ac88a5cadd1bf9b62048d0156#n513

-- 
Philip Kaludercic



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

* Re: Why 'define-package' marked obsolete?
  2023-03-20 19:32   ` Philip Kaludercic
@ 2023-03-21  9:10     ` dalanicolai
  2023-03-21  9:36       ` Philip Kaludercic
  0 siblings, 1 reply; 9+ messages in thread
From: dalanicolai @ 2023-03-21  9:10 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Eli Zaretskii, emacs-devel

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

Ah okay, I see.

So I assume that this means that as a function 'define-package' was
redundant, but we should still include a 'define-package' in the
-pkg.el file of a multi file package?

The initial comment of 'package.el' mentions that the -pkg.el file
should consist of 'a call to' define-package. I would say this
formulation is somewhat confusing/misleading then?

Or is the -pkg.el file just outdated? And did I miss the news about it?

On Mon, 20 Mar 2023 at 20:32, Philip Kaludercic <philipk@posteo.net> wrote:

> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: dalanicolai <dalanicolai@gmail.com>
> >> Date: Mon, 20 Mar 2023 17:21:04 +0100
> >>
> >> Can I ask why 'define-package' was marked obsolete?
> >
> > It never did anything useful.  Its original implementation just
> > signaled an error.
>
> I just looked up the definition from when package.el was merged[0], and it
> did stuff, mainly modifying `package-alist'.
>
> [0]
> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/package.el?id=44198b6ee97bcb0ac88a5cadd1bf9b62048d0156#n513
>
> --
> Philip Kaludercic
>

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

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

* Re: Why 'define-package' marked obsolete?
  2023-03-21  9:10     ` dalanicolai
@ 2023-03-21  9:36       ` Philip Kaludercic
  2023-03-21 17:09         ` dalanicolai
  0 siblings, 1 reply; 9+ messages in thread
From: Philip Kaludercic @ 2023-03-21  9:36 UTC (permalink / raw)
  To: dalanicolai; +Cc: Eli Zaretskii, emacs-devel

dalanicolai <dalanicolai@gmail.com> writes:

> Ah okay, I see.
>
> So I assume that this means that as a function 'define-package' was
> redundant, but we should still include a 'define-package' in the
> -pkg.el file of a multi file package?

No, the -pkg.el file is generated by ELPA using the information from the
main file.  There is no need to write it yourself, in fact it is a waste
effort since it will be overwritten anyway.  Package-vc does the same
btw.

> The initial comment of 'package.el' mentions that the -pkg.el file
> should consist of 'a call to' define-package. I would say this
> formulation is somewhat confusing/misleading then?

You are right, that comment is outdated and should be revised.

> Or is the -pkg.el file just outdated? And did I miss the news about it?

No, the file is still required because it contains the package
descriptor.  The only thing that changed is that instead of the contents
being evaluated as code, they are read in and processed manually.
Without that file, you will notice that `package-load-descriptor'
wouldn't add the package to `package-alist', which in turn means that
`package--activate-all' wouldn't activate it.

> On Mon, 20 Mar 2023 at 20:32, Philip Kaludercic <philipk@posteo.net> wrote:
>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> From: dalanicolai <dalanicolai@gmail.com>
>> >> Date: Mon, 20 Mar 2023 17:21:04 +0100
>> >>
>> >> Can I ask why 'define-package' was marked obsolete?
>> >
>> > It never did anything useful.  Its original implementation just
>> > signaled an error.
>>
>> I just looked up the definition from when package.el was merged[0], and it
>> did stuff, mainly modifying `package-alist'.
>>
>> [0]
>> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/package.el?id=44198b6ee97bcb0ac88a5cadd1bf9b62048d0156#n513
>>
>> --
>> Philip Kaludercic
>>



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

* Re: Why 'define-package' marked obsolete?
  2023-03-21  9:36       ` Philip Kaludercic
@ 2023-03-21 17:09         ` dalanicolai
  2023-03-21 17:15           ` Philip Kaludercic
  0 siblings, 1 reply; 9+ messages in thread
From: dalanicolai @ 2023-03-21 17:09 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Eli Zaretskii, emacs-devel

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

Thanks for the explanation...


> No, the -pkg.el file is generated by ELPA using the information from the
> main file.  There is no need to write it yourself, in fact it is a waste
> effort since it will be overwritten anyway.  Package-vc does the same
> btw.
>

I was trying to create a multi-file package, but before submitting it to
elpa-devel, I was testing locally if I did things correctly. So I defined a
'local archive' in a directory, then uploaded the .tar file to that
directory/archive, and then checked if installing worked. When doing
this, it seemed necessary to create the -pkg.el file manually.

Anyway, I understand things better now.

Thanks again!

On Tue, 21 Mar 2023 at 10:35, Philip Kaludercic <philipk@posteo.net> wrote:

> dalanicolai <dalanicolai@gmail.com> writes:
>
> > Ah okay, I see.
> >
> > So I assume that this means that as a function 'define-package' was
> > redundant, but we should still include a 'define-package' in the
> > -pkg.el file of a multi file package?
>
> No, the -pkg.el file is generated by ELPA using the information from the
> main file.  There is no need to write it yourself, in fact it is a waste
> effort since it will be overwritten anyway.  Package-vc does the same
> btw.
>
> > The initial comment of 'package.el' mentions that the -pkg.el file
> > should consist of 'a call to' define-package. I would say this
> > formulation is somewhat confusing/misleading then?
>
> You are right, that comment is outdated and should be revised.
>
> > Or is the -pkg.el file just outdated? And did I miss the news about it?
>
> No, the file is still required because it contains the package
> descriptor.  The only thing that changed is that instead of the contents
> being evaluated as code, they are read in and processed manually.
> Without that file, you will notice that `package-load-descriptor'
> wouldn't add the package to `package-alist', which in turn means that
> `package--activate-all' wouldn't activate it.
>
> > On Mon, 20 Mar 2023 at 20:32, Philip Kaludercic <philipk@posteo.net>
> wrote:
> >
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> >> From: dalanicolai <dalanicolai@gmail.com>
> >> >> Date: Mon, 20 Mar 2023 17:21:04 +0100
> >> >>
> >> >> Can I ask why 'define-package' was marked obsolete?
> >> >
> >> > It never did anything useful.  Its original implementation just
> >> > signaled an error.
> >>
> >> I just looked up the definition from when package.el was merged[0], and
> it
> >> did stuff, mainly modifying `package-alist'.
> >>
> >> [0]
> >>
> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/package.el?id=44198b6ee97bcb0ac88a5cadd1bf9b62048d0156#n513
> >>
> >> --
> >> Philip Kaludercic
> >>
>

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

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

* Re: Why 'define-package' marked obsolete?
  2023-03-21 17:09         ` dalanicolai
@ 2023-03-21 17:15           ` Philip Kaludercic
  2023-03-22 21:27             ` dalanicolai
  0 siblings, 1 reply; 9+ messages in thread
From: Philip Kaludercic @ 2023-03-21 17:15 UTC (permalink / raw)
  To: dalanicolai; +Cc: Eli Zaretskii, emacs-devel

dalanicolai <dalanicolai@gmail.com> writes:

> Thanks for the explanation...
>
>
>> No, the -pkg.el file is generated by ELPA using the information from the
>> main file.  There is no need to write it yourself, in fact it is a waste
>> effort since it will be overwritten anyway.  Package-vc does the same
>> btw.
>>
>
> I was trying to create a multi-file package, but before submitting it to
> elpa-devel, I was testing locally if I did things correctly. So I defined a
> 'local archive' in a directory, then uploaded the .tar file to that
> directory/archive, and then checked if installing worked. When doing
> this, it seemed necessary to create the -pkg.el file manually.

The best way to test it would be to check out elpa.git from
https://git.savannah.gnu.org/cgit/emacs/elpa.git and follow the manual
in there.

But unless you did something unusual, I would expect it to work (and if
it doesn't, someone here will be able to say why and how to fix it).

> Anyway, I understand things better now.
>
> Thanks again!
>
> On Tue, 21 Mar 2023 at 10:35, Philip Kaludercic <philipk@posteo.net> wrote:
>
>> dalanicolai <dalanicolai@gmail.com> writes:
>>
>> > Ah okay, I see.
>> >
>> > So I assume that this means that as a function 'define-package' was
>> > redundant, but we should still include a 'define-package' in the
>> > -pkg.el file of a multi file package?
>>
>> No, the -pkg.el file is generated by ELPA using the information from the
>> main file.  There is no need to write it yourself, in fact it is a waste
>> effort since it will be overwritten anyway.  Package-vc does the same
>> btw.
>>
>> > The initial comment of 'package.el' mentions that the -pkg.el file
>> > should consist of 'a call to' define-package. I would say this
>> > formulation is somewhat confusing/misleading then?
>>
>> You are right, that comment is outdated and should be revised.
>>
>> > Or is the -pkg.el file just outdated? And did I miss the news about it?
>>
>> No, the file is still required because it contains the package
>> descriptor.  The only thing that changed is that instead of the contents
>> being evaluated as code, they are read in and processed manually.
>> Without that file, you will notice that `package-load-descriptor'
>> wouldn't add the package to `package-alist', which in turn means that
>> `package--activate-all' wouldn't activate it.
>>
>> > On Mon, 20 Mar 2023 at 20:32, Philip Kaludercic <philipk@posteo.net>
>> wrote:
>> >
>> >> Eli Zaretskii <eliz@gnu.org> writes:
>> >>
>> >> >> From: dalanicolai <dalanicolai@gmail.com>
>> >> >> Date: Mon, 20 Mar 2023 17:21:04 +0100
>> >> >>
>> >> >> Can I ask why 'define-package' was marked obsolete?
>> >> >
>> >> > It never did anything useful.  Its original implementation just
>> >> > signaled an error.
>> >>
>> >> I just looked up the definition from when package.el was merged[0], and
>> it
>> >> did stuff, mainly modifying `package-alist'.
>> >>
>> >> [0]
>> >>
>> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/package.el?id=44198b6ee97bcb0ac88a5cadd1bf9b62048d0156#n513
>> >>
>> >> --
>> >> Philip Kaludercic
>> >>
>>

-- 
Philip Kaludercic



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

* Re: Why 'define-package' marked obsolete?
  2023-03-21 17:15           ` Philip Kaludercic
@ 2023-03-22 21:27             ` dalanicolai
  0 siblings, 0 replies; 9+ messages in thread
From: dalanicolai @ 2023-03-22 21:27 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Eli Zaretskii, emacs-devel

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

I have now looked at that manual, but I am not sure if I fully understand
it.
But I will find out when trying again to create the multi-file package soon.

Thanks again for now!

On Tue, 21 Mar 2023 at 18:15, Philip Kaludercic <philipk@posteo.net> wrote:

> dalanicolai <dalanicolai@gmail.com> writes:
>
> > Thanks for the explanation...
> >
> >
> >> No, the -pkg.el file is generated by ELPA using the information from the
> >> main file.  There is no need to write it yourself, in fact it is a waste
> >> effort since it will be overwritten anyway.  Package-vc does the same
> >> btw.
> >>
> >
> > I was trying to create a multi-file package, but before submitting it to
> > elpa-devel, I was testing locally if I did things correctly. So I
> defined a
> > 'local archive' in a directory, then uploaded the .tar file to that
> > directory/archive, and then checked if installing worked. When doing
> > this, it seemed necessary to create the -pkg.el file manually.
>
> The best way to test it would be to check out elpa.git from
> https://git.savannah.gnu.org/cgit/emacs/elpa.git and follow the manual
> in there.
>
> But unless you did something unusual, I would expect it to work (and if
> it doesn't, someone here will be able to say why and how to fix it).
>
> > Anyway, I understand things better now.
> >
> > Thanks again!
> >
> > On Tue, 21 Mar 2023 at 10:35, Philip Kaludercic <philipk@posteo.net>
> wrote:
> >
> >> dalanicolai <dalanicolai@gmail.com> writes:
> >>
> >> > Ah okay, I see.
> >> >
> >> > So I assume that this means that as a function 'define-package' was
> >> > redundant, but we should still include a 'define-package' in the
> >> > -pkg.el file of a multi file package?
> >>
> >> No, the -pkg.el file is generated by ELPA using the information from the
> >> main file.  There is no need to write it yourself, in fact it is a waste
> >> effort since it will be overwritten anyway.  Package-vc does the same
> >> btw.
> >>
> >> > The initial comment of 'package.el' mentions that the -pkg.el file
> >> > should consist of 'a call to' define-package. I would say this
> >> > formulation is somewhat confusing/misleading then?
> >>
> >> You are right, that comment is outdated and should be revised.
> >>
> >> > Or is the -pkg.el file just outdated? And did I miss the news about
> it?
> >>
> >> No, the file is still required because it contains the package
> >> descriptor.  The only thing that changed is that instead of the contents
> >> being evaluated as code, they are read in and processed manually.
> >> Without that file, you will notice that `package-load-descriptor'
> >> wouldn't add the package to `package-alist', which in turn means that
> >> `package--activate-all' wouldn't activate it.
> >>
> >> > On Mon, 20 Mar 2023 at 20:32, Philip Kaludercic <philipk@posteo.net>
> >> wrote:
> >> >
> >> >> Eli Zaretskii <eliz@gnu.org> writes:
> >> >>
> >> >> >> From: dalanicolai <dalanicolai@gmail.com>
> >> >> >> Date: Mon, 20 Mar 2023 17:21:04 +0100
> >> >> >>
> >> >> >> Can I ask why 'define-package' was marked obsolete?
> >> >> >
> >> >> > It never did anything useful.  Its original implementation just
> >> >> > signaled an error.
> >> >>
> >> >> I just looked up the definition from when package.el was merged[0],
> and
> >> it
> >> >> did stuff, mainly modifying `package-alist'.
> >> >>
> >> >> [0]
> >> >>
> >>
> https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/emacs-lisp/package.el?id=44198b6ee97bcb0ac88a5cadd1bf9b62048d0156#n513
> >> >>
> >> >> --
> >> >> Philip Kaludercic
> >> >>
> >>
>
> --
> Philip Kaludercic
>

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

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

end of thread, other threads:[~2023-03-22 21:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20 16:21 Why 'define-package' marked obsolete? dalanicolai
2023-03-20 16:58 ` Philip Kaludercic
2023-03-20 17:15 ` Eli Zaretskii
2023-03-20 19:32   ` Philip Kaludercic
2023-03-21  9:10     ` dalanicolai
2023-03-21  9:36       ` Philip Kaludercic
2023-03-21 17:09         ` dalanicolai
2023-03-21 17:15           ` Philip Kaludercic
2023-03-22 21:27             ` dalanicolai

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