Commit graph

8783 commits

Author SHA1 Message Date
Philip Kaludercic
30f1e7c1e9 Extract last source package release from local VCS data
* lisp/emacs-lisp/package-vc.el (package-vc-archive-spec-alist):
Unmention :release-rev
(package-vc-desc->spec): Fall back on other archives if a
specification is missing.
(package-vc-main-file): Add new function, copying the behaviour of
elpa-admin.el.
(package-vc-generate-description-file): Use 'package-vc-main-file'.
(package-vc-unpack): Handle special value ':last-release'.
(package-vc-release-rev): Add new function using 'last-change'.
(package-vc-install): Pass ':last-release' as REV instead of a
release.
* lisp/vc/vc-git.el (vc-git-last-change): Add Git 'last-change'
implementation.
* lisp/vc/vc.el (vc-default-last-change): Add default 'last-change'
implementation.

This attempts to replicate the behaviour of elpa-admin.el's
"elpaa--get-last-release-commit".
2022-10-30 14:04:52 +01:00
Philip Kaludercic
a52cec7b6b
Explicitly handle :vc-backend in a package specification
* lisp/emacs-lisp/package-vc.el (package-vc-archive-spec-alist):
Document the feature.
(package-vc-unpack): Check for :vc-backend in both PKG-SPEC and the
archive specification data.
2022-10-28 20:13:28 +02:00
Philip Kaludercic
4097781655
Ensure that package specifications are always fetched
* lisp/emacs-lisp/package-vc.el (package-vc--archives-initialize): Add
new function, extending 'package--archives-initialize'.
(package-vc-install): Use new function.
(package-vc-link-directory): Use new function.
2022-10-28 20:10:30 +02:00
Philip Kaludercic
60b3eb0754
Allow specifying the VC backend used by 'package-vc-install'
* lisp/emacs-lisp/package-vc.el (package-vc-install): Add argument BACKEND.
2022-10-28 20:01:48 +02:00
Philip Kaludercic
a00ec87c0b
Update handling for new elpa-packages.eld format
* lisp/emacs-lisp/package-vc.el (package-vc-elpa-packages-version):
Add constant.
(package-vc-archive-data-alist): Add variable.
(package-vc--read-archive-data): Separate package specifications from
metadata.
(package-vc-unpack): Check archive metadata.
2022-10-28 19:58:05 +02:00
Philip Kaludercic
eaafc10f67
Add support for :release-rev in 'package-vc-archive-spec-alist'
* lisp/emacs-lisp/package-vc.el (package-vc-archive-spec-alist):
Update docstring.
(package-vc-install): Use :release-rev if invoked with a prefix argument.
2022-10-26 10:37:00 +02:00
Philip Kaludercic
8149fdd820
;Fix typo "pacakge" -> "package" 2022-10-23 18:46:25 +02:00
Philip Kaludercic
e31c84f4e7
Extract separate function 'package-vc-guess-backend'
* lisp/emacs-lisp/package-vc.el (package-vc-guess-backend): New
function.
(package-vc-unpack): Use it.
(package-vc-sourced-packages-list): Use it.
(package-vc-install): Use it.
2022-10-23 18:41:36 +02:00
Philip Kaludercic
a3cd8d43ae
;Fix typo "heusitic" -> "heuristic" 2022-10-23 18:38:12 +02:00
Philip Kaludercic
ca61e768d0
Use user option 'package-vc-default-backend' when cloning
* lisp/emacs-lisp/package-vc.el (package-vc-unpack): Respect
'package-vc-default-backend'.
2022-10-23 18:27:07 +02:00
Philip Kaludercic
85555ad3b7
; Require map only during compilation
As map is only used by 'pcase' during macro-expansion, it is not
necessary to load it all the time.
2022-10-23 18:20:30 +02:00
Philip Kaludercic
0e6452ccd7
; Update TODO list 2022-10-23 18:18:37 +02:00
Philip Kaludercic
2154219059
Immediately check out the right branch or revision
* lisp/emacs-lisp/package-vc.el (package-vc-unpack) Use REV to avoid
checking out the wrong branch/revision first.
* lisp/vc/vc-bzr.el: Handle REV.
* lisp/vc/vc-git.el: Handle REV.
* lisp/vc/vc-hg.el: Handle REV.
* lisp/vc/vc-svn.el: Handle REV.
* lisp/vc/vc.el: Make BACKEND optional and add REV.
2022-10-23 18:04:55 +02:00
Philip Kaludercic
a0532e148c
; Remove unnecessary "TODO"s from the package header 2022-10-23 13:15:28 +02:00
Philip Kaludercic
ab46a0df7b
; Remove unnecessary 'let' binding
* lisp/emacs-lisp/package-vc.el (pacakge-vc-desc->spec): Simplify function.
2022-10-23 13:07:48 +02:00
Philip Kaludercic
7640b0751b
Add auxiliary function to query package specifications
* lisp/emacs-lisp/package-vc.el (package-vc-query-spec): Add
inline function.
2022-10-23 13:02:25 +02:00
Philip Kaludercic
ab283bddb2
Request "elpa-packages.eld" instead of "elpa-packages"
* lisp/emacs-lisp/package-vc.el
(package-vc--read-archive-data): Apply change.
(package-vc--download-and-read-archives): Apply change.
2022-10-22 00:06:04 +02:00
Philip Kaludercic
5694278af3
Remove 'package-vc-install' alias 'package-checkout'
* lisp/emacs-lisp/package-vc.el (package-checkout): Remove it.
2022-10-21 20:39:33 +02:00
Philip Kaludercic
faeb66ae42
Have 'package-vc-link-directory' use name if given
* lisp/emacs-lisp/package-vc.el (package-vc-link-directory): Use the
NAME argument.
2022-10-20 21:45:17 +02:00
Philip Kaludercic
2dabcba148
Build documentation like elpa-admin.el
* lisp/emacs-lisp/package-vc.el (package-vc-build-documentation): Add
function to build a documentation file.
(package-vc-unpack-1): Use 'package-vc-build-documentation'.
2022-10-20 21:34:48 +02:00
Philip Kaludercic
37bfb623e4
Merge remote-tracking branch 'origin/master' into feature/package+vc 2022-10-20 20:00:32 +02:00
Andrea Corallo
56c63ca21b * Fix async native compilation (bug#58637)
* lisp/emacs-lisp/comp.el (comp--native-compile): Fix gate condition.
(comp-run-async-workers): Add assetion.
2022-10-19 22:21:03 +02:00
Philip Kaludercic
e08e9bc40f
Remove modifications to the list of ignored files in source packages
* lisp/emacs-lisp/package-vc.el (package-vc-unpack-1): Remove
'vc-ignore' calls.
2022-10-18 22:44:35 +02:00
Philip Kaludercic
5d60ea47f6
Use 'elpa-packages' files for VC metadata
* lisp/emacs-lisp/package-vc.el (package-vc-default-backend): Add new
option.
(package-vc-archive-spec-alist): Add new variable to store the
contents of 'elpa-packages' for each archive.
(pacakge-vc-desc->spec): Add function to query package specifications.
(package-vc--read-archive-data): Add a 'package-read-archive-hook'
implementation.
(package-vc--download-and-read-archives): Add a
'package-refresh-contents-hook' implementation.
(package-vc-main-file): Remove function.
(package-vc-generate-description-file): Use package specifications.
(package-vc-unpack-1): Adapt to previous changes.
(package-vc-unpack): Adapt to previous changes.
(package-vc-sourced-packages-list): Adapt to previous changes.
(package-vc-install): Adapt to previous changes.
* lisp/emacs-lisp/package.el (package-read-archive-hook): Allow
extending 'package-read-all-archive-contents' using a hook.
(package-read-all-archive-contents): Use 'package-read-archive-hook'.
(package-refresh-contents-hook): Allow extending
'package-refresh-contents' using a hook.
(package-refresh-contents): Use 'package-refresh-contents-hook'.
2022-10-18 22:35:25 +02:00
Philip Kaludercic
65fa87329c
Merge remote-tracking branch 'origin/master' into feature/package+vc 2022-10-18 21:53:25 +02:00
Stefan Monnier
c5e2566774 (byte-compile--first-symbol-with-pos): Fix bug#58601
* lisp/emacs-lisp/bytecomp.el: Require `subr-x`.
(byte-compile--first-symbol-with-pos): Avoid inf-loops on circular data.
2022-10-18 10:49:43 -04:00
Lars Ingebrigtsen
6cabef8799 Fix previous loaddefs-gen fix 2022-10-18 13:17:52 +02:00
Lars Ingebrigtsen
86581698ac Fix faulty loaddefs detection
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--emacs-batch): Fix faulty loaddefs detection.
2022-10-18 13:14:08 +02:00
Andrea Corallo
1a8015b837 * Prevent potential native compilation infinite recursions
* lisp/emacs-lisp/comp.el (comp-no-spawn): New var.
(comp-subr-trampoline-install, comp-final, comp-run-async-workers)
(comp--native-compile): Update.
2022-10-18 10:42:13 +02:00
Stefan Kangas
eff4a4f49a Improve native-compile-prune-cache messages
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Quote name of
pruned directory.
2022-10-17 15:28:25 +02:00
Stefan Kangas
40b734c500 Don't prune *.eln files in parent of eln-load-path
* lisp/emacs-lisp/comp.el (native-compile-prune-cache): Don't
prune *.eln files in parent directory of `native-comp-eln-load-path'.
* test/lisp/emacs-lisp/comp-tests.el
(test-native-compile-prune-cache/dont-delete-in-parent-of-cache):
New test.
2022-10-17 15:26:34 +02:00
Lars Ingebrigtsen
b9aff5fdb8 Fix spurious "Compilation finished" native-comp messages
* lisp/emacs-lisp/comp.el (native--compile-async): Don't start the
async compilation if we didn't add anything.  This avoids spurious
"Compilation finished" messages in the *Async* buffer when it
turned out that all the files we considered nativecomping were
skipped.
2022-10-17 14:30:54 +02:00
Lars Ingebrigtsen
5176d00611 Avoid having the async compile log saying it's compiling loaddefs
* lisp/loadup.el (featurep): Define the hash table in nativecomp
builds (but not otherwise).  A more natural place to define this
would be in comp.el, but comp.el isn't loaded yet when we load the
.elc file that updates comp--no-native-compile.  We could change
the load order and move the definition to comp.el, though.

* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Allow
inhibiting nativecomp earlier (bug#57627).

* lisp/emacs-lisp/comp.el (native-compile-async-skip-p): Use the data.
2022-10-17 10:48:20 +02:00
Philip Kaludercic
39c9b6751e
Only clone packages if necessary
* lisp/emacs-lisp/package-vc.el (package-vc-unpack): Check if
directory exists before cloning.
2022-10-17 00:13:06 +02:00
Stefan Monnier
13d6e8fa54 cl-generic: Fix advertised-calling-convention declarations
* lisp/emacs-lisp/cl-generic.el (cl-generic-define-method):
Preserve the `advertised-calling-convention`, if any (bug#58563).

* lisp/subr.el (declare): Warn when we hit this.

* lisp/emacs-lisp/byte-run.el (get-advertised-calling-convention): New fun.
* lisp/progmodes/elisp-mode.el (elisp-get-fnsym-args-string):
* lisp/help-fns.el (help-fns--signature):
* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition): Use it.

* test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--acc): New fun.
(cl-generic-tests--advertised-calling-convention-bug58563): New test.
2022-10-16 12:01:47 -04:00
Philip Kaludercic
b4e833b2f8
Attempt to infer the package subject if missing
* lisp/emacs-lisp/package-vc.el (package-vc-main-file): Add function.
(package-vc-generate-description-file): Infer the subject.
2022-10-16 17:18:06 +02:00
Philip Kaludercic
5134eb02cf
Mark source packages as always updatable
* lisp/emacs-lisp/package.el (package--updateable-packages): Add check
for source packages.
2022-10-16 13:40:24 +02:00
Philip Kaludercic
3f7e746b51
Delete 'package-contact-maintainer'
* doc/emacs/package.texi: Remove mention.
* etc/NEWS: Remove mention.
* lisp/emacs-lisp/package.el: Remove the command.
2022-10-16 13:40:08 +02:00
Philip Kaludercic
01e45efcd4
Merge branch 'master' into feature/package+vc 2022-10-15 17:38:30 +02:00
Philip Kaludercic
5fc064f14c
Handle ;;;###theme-autoload comments in etc/themes
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--emacs-batch):
Extract the autoloads and have them loaded along with loaddefs.el.
* etc/NEWS: Mention the new feature.  (Bug#57639)
2022-10-15 17:22:48 +02:00
Philip Kaludercic
da2e6da722
Tag themes with properties
* doc/emacs/custom.texi (Custom Themes): Document 'theme-choose-variant'.
* doc/lispref/customize.texi (Custom Themes): Document the new
optional argument to 'deftheme'.
(Autoload): Mention that 'deftheme' is not copied verbatim.
* etc/themes/adwaita-theme.el (adwaita): Add properties.
* etc/themes/deeper-blue-theme.el (deeper-blue): Add properties.
* etc/themes/dichromacy-theme.el (dichromacy): Add properties.
* etc/themes/light-blue-theme.el (light-blue): Add properties.
* etc/themes/manoj-dark-theme.el (manoj-dark): Add properties.
* etc/themes/misterioso-theme.el (misterioso): Add properties.
* etc/themes/tango-dark-theme.el (tango-dark): Add properties.
* etc/themes/tango-theme.el (tango): Add properties.
* etc/themes/tsdh-dark-theme.el (tsdh-dark): Add properties.
* etc/themes/tsdh-light-theme.el (tsdh-light): Add properties.
* etc/themes/wheatgrass-theme.el (wheatgrass): Add properties.
* etc/themes/whiteboard-theme.el (whiteboard): Add properties.
* etc/themes/wombat-theme.el (wombat): Add properties.
* etc/themes/modus-operandi-theme.el: Add properties.
* etc/themes/modus-vivendi-theme.el: Add properties.
* etc/themes/leuven-dark-theme.el (leuven-dark): Add properties.
* etc/themes/leuven-theme.el (leuven): Add properties.
* lisp/custom.el (deftheme): Allow for optional arguments to set the
property list.
(custom-declare-theme): Accept the same optional arguments as 'deftheme'.
(theme-list-variants): Add new function.
(theme-choose-variant): Add new command for switching between members
of a theme family.
(toggle-theme): Add an alias for 'theme-choose-variant'.
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Handle 'defcustom's by extracting the properties.  (Bug#57639)
2022-10-15 17:22:48 +02:00
Stefan Kangas
8300899953 Use file-size-human-readable in memory-report--format
* lisp/emacs-lisp/memory-report.el (memory-report--format): Use
file-size-human-readable.
2022-10-15 03:02:17 +02:00
Philip Kaludercic
73669f73e6
Allow specifying a package name for 'package-vc-link-directory'
* lisp/emacs-lisp/package-vc.el (package-vc-link-directory): Add argument NAME
2022-10-12 21:25:54 +02:00
Philip Kaludercic
0e3b67e3a3
* lisp/emacs-lisp/package-vc.el (package-vc-refresh): Add function. 2022-10-12 21:21:38 +02:00
Philip Kaludercic
0610e6f9f1
Rename 'package-vc-link-project' to 'package-vc-link-directory'
* lisp/emacs-lisp/package-vc.el (package-vc-link-project): Rename it.
2022-10-12 20:42:19 +02:00
Philip Kaludercic
22d768a29d
Run 'package-vc-unpack-1' after updating source packages
* lisp/emacs-lisp/package-vc.el (package-vc-update): Call
'package-vc-unpack-1'.
2022-10-12 20:26:17 +02:00
Philip Kaludercic
576593a2b2
Add new command to install a package via symbolic linking
* lisp/emacs-lisp/package-vc.el (package-vc-unpack-1): Add new function.
(package-vc-unpack): Use 'package-vc-unpack-1'.
(package-vc-link-project): Add new command.
2022-10-12 17:11:21 +02:00
Philip Kaludercic
4a25205ec1
Only use 'package-vc-repository-store' if necessary
* lisp/emacs-lisp/package-vc.el (package-vc-unpack): Check if the
upstream data indicates a custom lisp directory.
* lisp/emacs-lisp/package.el (package--delete-directory): Adapt
accordingly.
2022-10-12 14:49:35 +02:00
Andrea Corallo
3744720904 Add trampoline AOT compilation target (bug#58318)
* Makefile.in (trampolines): New target.
* lisp/Makefile.in (trampolines): Likewise.
* lisp/emacs-lisp/comp.el (comp-compile-all-trampolines): New
function.
2022-10-11 21:19:21 +02:00
Philip Kaludercic
8e6e6e6de5
Rename 'package-vc-fetch' to 'package-vc-install'
* lisp/emacs-lisp/package-vc.el (package-vc-fetch): Rename to preserve
symmetry with 'package-install'.
(package-checkout): Follow the previous rename.
2022-10-09 23:37:29 +02:00