* Re: master feb654b460: Add new package.el commands for recompilation
[not found] ` <20220616114917.A93A0C051C9@vcs2.savannah.gnu.org>
@ 2022-06-16 12:22 ` Stefan Monnier
2022-06-16 12:26 ` Lars Ingebrigtsen
2022-06-23 15:53 ` Lynn Winebarger
0 siblings, 2 replies; 3+ messages in thread
From: Stefan Monnier @ 2022-06-16 12:22 UTC (permalink / raw)
To: emacs-devel; +Cc: Lars Ingebrigtsen
> +;;;###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`.
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: master feb654b460: Add new package.el commands for recompilation
2022-06-16 12:22 ` master feb654b460: Add new package.el commands for recompilation Stefan Monnier
@ 2022-06-16 12:26 ` Lars Ingebrigtsen
2022-06-23 15:53 ` Lynn Winebarger
1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-16 12:26 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 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`.
Not a whole lot harder.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: master feb654b460: Add new package.el commands for recompilation
2022-06-16 12:22 ` master feb654b460: Add new package.el commands for recompilation Stefan Monnier
2022-06-16 12:26 ` Lars Ingebrigtsen
@ 2022-06-23 15:53 ` Lynn Winebarger
1 sibling, 0 replies; 3+ messages in thread
From: Lynn Winebarger @ 2022-06-23 15:53 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel, Lars Ingebrigtsen
[-- Attachment #1: Type: text/plain, Size: 1822 bytes --]
On Thu, Jun 16, 2022 at 8:29 AM Stefan Monnier <monnier@iro.umontreal.ca>
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)
[-- Attachment #2: Type: text/html, Size: 2659 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-23 15:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <165538015737.18417.15587779043841057948@vcs2.savannah.gnu.org>
[not found] ` <20220616114917.A93A0C051C9@vcs2.savannah.gnu.org>
2022-06-16 12:22 ` master feb654b460: Add new package.el commands for recompilation Stefan Monnier
2022-06-16 12:26 ` Lars Ingebrigtsen
2022-06-23 15:53 ` Lynn Winebarger
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.