From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.devel Subject: Re: Why 'define-package' marked obsolete? Date: Tue, 21 Mar 2023 18:09:51 +0100 Message-ID: References: <83zg87739o.fsf@gnu.org> <87jzzbp6bn.fsf@posteo.net> <87355y78fs.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000039db5a05f76c1d9c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37079"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 21 18:11:05 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pefVp-0009TK-0L for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Mar 2023 18:11:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pefUy-0002jN-BI; Tue, 21 Mar 2023 13:10:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pefUu-0002hs-SR for emacs-devel@gnu.org; Tue, 21 Mar 2023 13:10:08 -0400 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pefUs-0000Df-9O; Tue, 21 Mar 2023 13:10:08 -0400 Original-Received: by mail-wr1-x42d.google.com with SMTP id v25so11003374wra.12; Tue, 21 Mar 2023 10:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679418602; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=D+UoC0azKfqtj3fPM1ujpqOx9Uht6leg0KjnGVuaCM4=; b=c/OvKj4JnCzsPKpaM4AB/yMs5b6/nBYDni5lJ7yg5SkK5U541y3nHkvLijF+hGRp+S 44+2cGpTLBWy8W89fks6D4i1OnYEDOdLwpa/HQj9usQ/RkiJ4KqllNz9qz2L7I2Ggik/ vsJwLMGywA+Loo/hoPARQ3p27dW4Ivr4PWXsodgbMR5Ifxj7rzmW027H3ct/TBRSK0oI WPxS22kF9Vysa2pTNdxgBoGFD3t2RHH/+lHnFEa21hkP5k55ziKaIt9zsx8yZQa4zhZu zeyJalPHK7+YNzVnR0e+sQE+Cw5tHU270zXrg75dFs21jdEuBI4LhkaZGdKsl9SqdR+3 69Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679418602; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=D+UoC0azKfqtj3fPM1ujpqOx9Uht6leg0KjnGVuaCM4=; b=jHGYuWsKQbv8hCpnUdle61ivjPu4nlOleGGupikWsY6JGd/byVefHQt5ddKuxfPgwe +4KwnfJFi88AhDCmSSEiEucjmQEgf2WHRcdzvgOIuDT6CoZ6SWm2Dj2BURJiRHr7T0xf dbmr6cF/YjJZclBhZ1L/wntItapCVhpwUozDbEMpyGaPGoJDyQQQfJMF8/APs4Vk1UD1 hL1a8/eO7Tc0jH7JQcyKbHgHeNX2hsx3SF+0ye8LWCPecL/i8F0CgnzgBh2JrbDSUFao K9JMVctyFh4Hd0zSPPw+fDQDz4hgfzH105QrhZjkWQFeKS6sQRrCffKkgiYOdLYGQ75e 8BpQ== X-Gm-Message-State: AO0yUKVCROeUrt+k3BEu9FIVhYJg/GdRo+AzQM3NnwYWsImUDQHF2kyN DnwcmhGXCOw6JaTCiT0q+Q6xJmwmG9ikoa+vPyE= X-Google-Smtp-Source: AK7set9Kr49Hb7ahAY/E/nCVRNJ1ARh9JTkBItVyYGNZZH8udJyPKXRk4Yl1Tha6bAh0k2Dcf3fPD1wjlwbXw6zQ/T0= X-Received: by 2002:a5d:6641:0:b0:2d0:58f9:a69 with SMTP id f1-20020a5d6641000000b002d058f90a69mr702740wrw.4.1679418602411; Tue, 21 Mar 2023 10:10:02 -0700 (PDT) In-Reply-To: <87355y78fs.fsf@posteo.net> Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=dalanicolai@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304673 Archived-At: --00000000000039db5a05f76c1d9c Content-Type: text/plain; charset="UTF-8" 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 wrote: > dalanicolai 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 > wrote: > > > >> Eli Zaretskii writes: > >> > >> >> From: dalanicolai > >> >> 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 > >> > --00000000000039db5a05f76c1d9c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the explanation...
=C2=A0
No, the -pkg.el f= ile is generated by ELPA using the information from the
main file.=C2=A0 There is no need to write it yourself, in fact it is a was= te
effort since it will be overwritten anyway.=C2=A0 Package-vc does the same<= br> btw.

<= div>I was trying to create a multi-file package, but before submitting it t= o
elpa-devel, I was testing locally if I did things correctly. So= I defined a
'local archive' in a directory, then uploade= d the .tar file to that
directory/archive, and then checked if in= stalling worked. When doing
this, it seemed necessary to create t= he -pkg.el file manually.

Anyway, I understand thi= ngs 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 t= he
> -pkg.el file of a multi file package?

No, the -pkg.el file is generated by ELPA using the information from the main file.=C2=A0 There is no need to write it yourself, in fact it is a was= te
effort since it will be overwritten anyway.=C2=A0 Package-vc does the same<= br> 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.=C2=A0 The only thing that changed is that instead of the conten= ts
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 th= at
`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 obsolet= e?
>> >
>> > It never did anything useful.=C2=A0 Its original implementati= on 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=3D44198b6ee97bcb0ac88a5cadd1bf9b6204= 8d0156#n513
>>
>> --
>> Philip Kaludercic
>>
--00000000000039db5a05f76c1d9c--