Commit graph

194 commits

Author SHA1 Message Date
Philip Kaludercic
348f7d263c Move package spec documentation to 'package-vc-selected-packages'
* lisp/emacs-lisp/package-vc.el (package-vc-selected-packages): Add
documentation.
(package-vc--archive-spec-alist): Remove documentation.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
2b93d0e6f1 Fix type error in package-vc prompt function
* lisp/emacs-lisp/package-vc.el (package-vc--read-package-name):  Pass
(not allow-url) as REQUIRE-MATCH, not as INITIAL-INPUT.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
c53c5f3884 Rename 'package-vc-refresh' to 'package-vc-rebuild'
* doc/emacs/package.texi (Fetching Package Sources): Update documentation.
* lisp/emacs-lisp/package-vc.el (package-vc-refresh): Rename from.
(package-vc-rebuild): Rename to.

This intends to clarify the intention and avoid confusion with
'package-refresh-contents'.  Thanks to Rudolf Adamkovič for the
suggestion.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
2ec02024ab Track 'default-directory' while updating source packages
* lisp/emacs-lisp/package-vc.el (package-vc-update): Add the source
directory to the identifier list, in case the remaining
'vc-do-command' arguments are all read-time constants.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
d67b66f8ab Respect :lisp-dir in package specs by loading a sub-directory
* lisp/emacs-lisp/package-vc.el (package-vc-repository-store): Remove
obsolete variable.
(package-vc--unpack-1): Respect :lisp-dir.
(package-vc--unpack): Add :lisp-dir to the package description if
necessary.
* lisp/emacs-lisp/package.el (package--delete-directory): Check if a
directory is a symbolic link.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
9f4a433b27 Fix generation of documentation for source packages
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Call "makeinfo" before "install-info"
2022-11-17 20:37:28 +01:00
Philip Kaludercic
13d051b443 Remove references to internal symbols from public docstrings
* lisp/emacs-lisp/package-vc.el (package-vc-repository-store):
Unmention 'package-vc--unpack'.
(package-vc-install): Unmention 'package-vc--guess-backend' in favour
of 'package-vc-heuristic-alist'.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
b0200a37e4 Expand 'package-vc--unpack-1' documentation
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): Explain what
the function does.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
f939859fe4 Clarify 'package-vc--build-documentation' docstring
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Rewrite the first line.

As suggested by Eli Zaretskii.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
32758c6da0 Fix the docstring for 'package-vc--version'
* lisp/emacs-lisp/package-vc.el (package-vc--version): Replace
docstring.

It seems like this was just copied over from 'package-vc-commit', for
no good reason.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
83ff0de4ce Fix 'package-vc-selected-packages' documentation
* lisp/emacs-lisp/package-vc.el (package-vc-selected-packages): Remove
reference to non-existent function and add an explanation that the
value won't override an existing source package installation.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
3ff8310cc3 Mark 'package-vc-update' as interactive
* lisp/emacs-lisp/package-vc.el (package-vc--sourced-packages-list):
Remove function in favour of 'package-vc--read-package-name'.
(package-vc--read-package-name):
Extract out common functionality.
(package-vc--read-package-desc): Add auxiliary function based on
'package-vc--read-package-name'.
(package-vc-update): Add interactive spec using
'package-vc--read-package-desc'.
(package-vc-install): Use 'package-vc--read-package-desc'.
(package-vc-checkout): Use 'package-vc--read-package-desc'.
(package-vc--read-pkg): Remove in favour of 'package-vc--read-package-desc'.
(package-vc-refresh): Use 'package-vc--read-package-desc'.
(package-vc-prepare-patch): Use 'package-vc--read-package-desc'.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
aadf07f5b8 Autoload 'package-vc-install-selected-packages'
* lisp/emacs-lisp/package-vc.el (package-vc-ensure-packages): Add an
autoload cookie.
(package-vc-selected-packages): Set
:initialize to 'custom-initialize-default'.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
e1ce202ad1 Mark 'package-vc-install-selected-packages' as interactive
* lisp/emacs-lisp/package-vc.el (package-vc-ensure-packages): Add an
interactive spec.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
9d3c6205ae Rename '-ensure-packages' to -install-selected-packages'
* doc/emacs/package.texi (Fetching Package Sources): Rename instances.
* lisp/emacs-lisp/package-vc.el (package-vc-ensure-packages): Rename
to 'package-vc-install-selected-packages'.
(package-vc-selected-packages): Call renamed function.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
a4e4ceb47a Handle strings as keys in 'package-vc-ensure-packages'
* lisp/emacs-lisp/package-vc.el (package-vc-ensure-packages): Inter
sting keys while processing 'package-vc-selected-packages'.

As requested by Rudolf Adamkovič.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
e55be31d55 ; Fix interactive spec for 'package-vc-refresh'
* lisp/emacs-lisp/package-vc.el (package-vc-refresh):

Thanks to Rudolf Adamkovič for noticing the mistake.
2022-11-17 20:37:28 +01:00
Philip Kaludercic
270020a4b4 Rephrase 'package-vc-ensure-packages' docstring
* lisp/emacs-lisp/package-vc.el (package-vc-ensure-packages): Make it
easier to read.
2022-11-05 17:44:57 +01:00
Philip Kaludercic
1557bb9d8f ; Rename 'package-vc-link-directory' to '-install-from-checkout'
* doc/emacs/package.texi (Fetching Package Sources): Rename instances
* etc/NEWS: Rename instances.
* lisp/emacs-lisp/package-vc.el (package-vc-link-directory): Rename to
'package-vc-install-from-checkout'.
2022-11-05 17:44:54 +01:00
Eli Zaretskii
22fb5397de ; Fix documentation of package-vc.el
* lisp/emacs-lisp/package-vc.el (package-vc-default-backend)
(package-vc-selected-packages, package-vc--archive-spec-alist)
(package-vc--archive-data-alist, package-vc--query-spec)
(package-vc--read-archive-data, package-vc-commit)
(package-vc--main-file, package-vc--generate-description-file)
(package-vc--build-documentation, package-vc--unpack-1)
(package-vc--guess-backend, package-vc--clone)
(package-vc--unpack, package-vc-update, package-vc--release-rev)
(package-vc-install, package-vc-checkout)
(package-vc-link-directory, package-vc-refresh)
(package-vc-prepare-patch, package-vc--archives-initialize): Doc fixes.
2022-11-05 13:11:28 +02:00
Stefan Kangas
5f0af7caec ; package-vc: Pacify byte-compiler
* lisp/emacs-lisp/package-vc.el (package-vc-selected-packages):
Declare.
2022-11-04 20:16:04 +01:00
Philip Kaludercic
f762c5bb2c * lisp/emacs-lisp/package-vc.el: Expand commentary 2022-11-04 18:54:17 +01:00
Philip Kaludercic
184f0c3e60 ; * lisp/emacs-lisp/package-vc.el (package-vc): Add missing :prefix 2022-11-04 18:19:01 +01:00
Philip Kaludercic
f17fadd01a Link to Manual from the package-vc group
* lisp/emacs-lisp/package-vc.el (package-vc): Add 'custom-manual'
link.
2022-11-04 18:17:45 +01:00
Philip Kaludercic
b5850ba3ae Document 'package-vc-selected-packages'
* doc/emacs/package.texi: Expand documentation and give example.
* etc/NEWS: Mention 'package-vc-selected-packages'.
* lisp/emacs-lisp/package-vc.el (package-vc--select-packages): Remove
function.
(package-vc-ensure-packages): Add function based on
'package-vc--select-packages'.
(package-vc-selected-packages): Call 'package-vc-ensure-packages' from
custom setter.
2022-11-04 18:05:41 +01:00
Philip Kaludercic
0efc611697 Autoload all entry functions 2022-11-03 23:15:18 +01:00
Philip Kaludercic
38efed50dc ; Mention that 'package-vc-checkout' open a directory
* lisp/emacs-lisp/package-vc.el (package-vc-checkout): Mention it in
the docstring.
2022-11-03 19:41:46 +01:00
Philip Kaludercic
f5fb7069f3 ; Explicitly mark internal functions as such 2022-11-03 19:38:34 +01:00
Philip Kaludercic
0e75099da8 * lisp/emacs-lisp/package-vc.el (package-vc-version): Use main file 2022-11-03 19:28:47 +01:00
Philip Kaludercic
ec01d9a209 Add command 'package-vc-checkout'
* doc/emacs/package.texi: Document feature.
* etc/NEWS: Mention feature.
* lisp/emacs-lisp/package-vc.el (package-vc-clone): Extract
functionality out of 'package-vc-unpack'.
(package-vc-unpack): Extract functionality out to 'package-vc-clone'.
(package-vc-checkout): Add command.
2022-11-03 19:26:21 +01:00
Philip Kaludercic
7705b66ed3 ; Update TODO section 2022-11-02 17:16:39 +01:00
Philip Kaludercic
b21f80bbb9 ; Replace 'let*' with 'let' where possible
* lisp/emacs-lisp/package-vc.el (package-vc--select-packages): Do it.
(package-vc--read-archive-data): Do it.
2022-11-02 10:15:28 +01:00
Philip Kaludercic
bbe5a1ca83 Ensure 'package-vc-update' runs 'package-vc-unpack-1' only once
* lisp/emacs-lisp/package-vc.el (package-vc-update): Use
'vc-sourced-packages-list' and other hacks.
2022-11-01 16:35:23 +01:00
Philip Kaludercic
462a66e79e ; Actually check if NAME-OR-URL is a string
* lisp/emacs-lisp/package-vc.el (package-vc-install): Use stringp as
predicate instead of binding it as a variable.
2022-10-31 10:02:03 +01:00
Philip Kaludercic
c2088c0849 Allow specifying and pinning source packages to be installed
* lisp/emacs-lisp/package-vc.el (package-vc--select-packages): Add
custom setter for 'package-vc-selected-packages'.
(package-vc-selected-packages): Add user option.
2022-10-31 10:02:03 +01:00
Philip Kaludercic
8e7bb5bb87 ; Update TODO section 2022-10-30 21:12:48 +01:00
Philip Kaludercic
d33998ed3b Have 'last-change' accept a line number instead of a range
* lisp/emacs-lisp/package-vc.el (package-vc-release-rev): Use new
signature.
* lisp/vc/vc-git.el (vc-git-last-change): Update signature
* lisp/vc/vc.el (vc-default-last-change): Update signature and use
'annotate-command'.
2022-10-30 16:52:08 +01:00
Philip Kaludercic
bb86ed20e1 Display a message after installing source packages
* lisp/emacs-lisp/package-vc.el (package-vc-unpack-1): Print message
and return t.
2022-10-30 14:57:11 +01:00
Philip Kaludercic
ec3f102b8c Prefer "Package-Version" over "Version" if available
* lisp/emacs-lisp/package-vc.el (package-vc-release-rev): Search for
both in sequence.
2022-10-30 14:43:10 +01:00
Philip Kaludercic
8b49d553b6 ; Avoid a type error on malformed "elpa-packages.eld" input
* lisp/emacs-lisp/package-vc.el: Use 'eq' instead of '='
2022-10-30 14:07:56 +01:00
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