emacs-devel
[Top][All Lists]
Advanced

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

Re: Why 'define-package' marked obsolete?


From: dalanicolai
Subject: Re: Why 'define-package' marked obsolete?
Date: Tue, 21 Mar 2023 18:09:51 +0100

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

reply via email to

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