From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: master feb654b460: Add new package.el commands for recompilation Date: Thu, 23 Jun 2022 11:53:06 -0400 Message-ID: References: <165538015737.18417.15587779043841057948@vcs2.savannah.gnu.org> <20220616114917.A93A0C051C9@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c34f1805e21f731a" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12382"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel , Lars Ingebrigtsen To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 23 17:54:58 2022 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 1o4PAY-00030P-0S for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Jun 2022 17:54:58 +0200 Original-Received: from localhost ([::1]:50182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4PAW-0007cc-Jq for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Jun 2022 11:54:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46076) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4P92-0004yB-Uf for emacs-devel@gnu.org; Thu, 23 Jun 2022 11:53:24 -0400 Original-Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]:38629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4P91-00050I-6j for emacs-devel@gnu.org; Thu, 23 Jun 2022 11:53:24 -0400 Original-Received: by mail-oi1-x231.google.com with SMTP id w193so5032179oie.5 for ; Thu, 23 Jun 2022 08:53:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5GLIw1zWbjgjx/4X+OTB8T+wztI4SlwuXhZeQHKSoZE=; b=WY+2xDPiBVg6JI/2oU6tKyCu2uObFGpy0XK0fVUxoTjoub4Z+P48gL9NTc57LYNpPL Xgv2xcPfopg5p0Q+cCt37tjwa2dDO/v1aXx5Gl0JQMHz1lq3OVuOwX53Zwsv2l2uuhIU fZld9ShHksglLoTfg6AOx/qM2/sGf/VlVGLp7eR1mD0pOHmMEP/9cMwGSvjXA1jFNxEu dMKrpuZU+5FopLA3/24kpsj+9QrLLryXU4TtJHblJghGx+5rmMFtWaVacNEHiur0etNN bpY3PfTYPqn8iZfkUg1ouuRbiGcwla84DpcCK4V9ak6eX9Y3PGqQGagzlECNaVdc4bDG h/HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5GLIw1zWbjgjx/4X+OTB8T+wztI4SlwuXhZeQHKSoZE=; b=5zruzwDPEmpzjTcMLZA+4hd+pTGeRfdqAy+3LRe1cO6534dpxl5vbIlkugEpQQ1bsc klwzEcm567NBw1gv3SbWroIdc4pg8pk19q5jkOfbr3IsjIsYNktvFAuOIVhULYFw/ZWi QRe31Tntuxi6RKRiZPrFuK3nZ6uwvb8MTRuOGXcpTv+vO67NZ5c7KtxGF2QUUiuNWhOd WFK6tYyhw1ACUHowLpPrXoIEWWTpyusbFabP4zticHwU+Qcxoe4iNzAZaQixOIT0diGj KllV9ra8aQph22a6UMHN2BFEA/gA+wIcajuUhn57M6lFMwom8g6XCE2Z44gj5l3IYOg+ Kilw== X-Gm-Message-State: AJIora8ppualJdEMaPqv3gEJ6QSfkAhm+/obtDbLJAOjiqY9IjKlf3MR W5shAimJINh4Cx63ugiYV1OHzpRj9LfPNLY490r/92l+ X-Google-Smtp-Source: AGRyM1sJvIJ5dXsdRYhUuJEbOTDLZhYg1P/Z1+KXU6QU2vbgE2rDcYxHtDkTCYIJCyC+0dWV9TFHMth5JpBVnlgWfR0= X-Received: by 2002:a05:6808:1a96:b0:333:289e:713d with SMTP id bm22-20020a0568081a9600b00333289e713dmr2679448oib.247.1655999597595; Thu, 23 Jun 2022 08:53:17 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::231; envelope-from=owinebar@gmail.com; helo=mail-oi1-x231.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, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:291539 Archived-At: --000000000000c34f1805e21f731a Content-Type: text/plain; charset="UTF-8" On Thu, Jun 16, 2022 at 8:29 AM Stefan Monnier wrote: > > +;;;###autoload > > +(defun package-recompile (pkg) > > + "Byte-compile package PKG again. > > +PKG should be either a symbol, the package name, or a `package-desc' > > +object." > > + (interactive (list (intern (completing-read > > + "Recompile package: " > > + (mapcar #'symbol-name > > + (mapcar #'car package-alist)))))) > > + (let ((pkg-desc (if (package-desc-p pkg) > > + pkg > > + (cadr (assq pkg package-alist))))) > > + ;; Delete the old .elc files to ensure that we don't inadvertently > > + ;; load them (in case they contain byte code/macros that are now > > + ;; invalid). > > + (dolist (elc (directory-files (package-desc-dir pkg-desc) t > "\\.elc\\'")) > > + (delete-file elc)) > > + (package--compile pkg-desc))) > > Thanks, Lars. But note that there are packages with ELisp files in > subdirectories (Hyperbole and Proof-General come to mind, tho I'm sure > there are others) so we should work a bit harder than the above > `directory-files`. > > The realgud family of packages employs a (single-file) package load-relative to manage a fairly large number of elisp files, including munging the feature symbol. Looking at my 1000+ package sample, I see the following appear to have more mundane occurrences of elisp file in subdirectories: - all-the-icons - auctex - axiom-environment - ecb - elisp-benchmarks - elpy (.yas-setup.el) - ert-runner - irony (tests) - julia-snail - parser-generator (tests) - requirejs (.yas-compiled-snippets.el) - slime - sly - taxy (examples) - yasnippet-snippets (.yas-setup.el) --000000000000c34f1805e21f731a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jun 16, 2022 at 8:29 AM Stefan Mo= nnier <monnier@iro.umontreal= .ca> wrote:
> +;;;###autoload
> +(defun package-recompile (pkg)
> +=C2=A0 "Byte-compile package PKG again.
> +PKG should be either a symbol, the package name, or a `package-desc&#= 39;
> +object."
> +=C2=A0 (interactive (list (intern (completing-read
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Recompile package: "
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mapcar #'symbol-name
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (mapcar #&#= 39;car package-alist))))))
> +=C2=A0 (let ((pkg-desc (if (package-desc-p pkg)
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 pkg
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (cadr (assq pkg package-alist)))))
> +=C2=A0 =C2=A0 ;; Delete the old .elc files to ensure that we don'= t inadvertently
> +=C2=A0 =C2=A0 ;; load them (in case they contain byte code/macros tha= t are now
> +=C2=A0 =C2=A0 ;; invalid).
> +=C2=A0 =C2=A0 (dolist (elc (directory-files (package-desc-dir pkg-des= c) t "\\.elc\\'"))
> +=C2=A0 =C2=A0 =C2=A0 (delete-file elc))
> +=C2=A0 =C2=A0 (package--compile pkg-desc)))

Thanks, Lars.=C2=A0 But note that there are packages with ELisp files in subdirectories (Hyperbole and Proof-General come to mind, tho I'm sure<= br> there are others) so we should work a bit harder than the above
`directory-files`.

The realgud family of packages = employs a (single-file) package load-relative to manage
a fairly = large number of elisp files, including munging the feature symbol.

=C2=A0Looking at my 1000+ package sample, I see the follow= ing appear to have more
mundane occurrences=C2=A0of elisp file in= subdirectories:
  • all-the-icons
  • a= uctex
  • axiom-environment
  • ecb
  • elisp-benchmarks
  • elpy (.yas-setup.el)
  • ert-runner
  • irony (tests)
  • jul= ia-snail
  • parser-generator (tests)
  • requirejs (.yas-compiled-= snippets.el)
  • slime
  • sly
  • taxy=C2=A0(examples)
  • yasnippet-snippets (.yas-setup.el)
<= div class=3D"gmail_quote">



--000000000000c34f1805e21f731a--