Commit graph

8826 commits

Author SHA1 Message Date
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
5fa2f11679 Merge branch 'feature/package+vc' 2022-11-04 18:57:45 +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
Juanma Barranquero
4fa8f57cc6 ; * lisp/emacs-lisp/oclosure.el: Fix typos. 2022-11-04 08:41:43 +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
Eli Zaretskii
dffc34a2d4 Fix 'text-property-search-backward' with 1-char long properties
* lisp/emacs-lisp/text-property-search.el
(text-property--find-end-backward): Don't miss the end of
text-property value at point.  This fixes searches backward when
the property is on a single character position.  (Bug#58937)
2022-11-03 11:25:50 +02:00
Philip Kaludercic
7705b66ed3 ; Update TODO section 2022-11-02 17:16:39 +01:00
Philip Kaludercic
57708df032 ; Handle case that was forgotten in the last commit 2022-11-02 13:58:14 +01:00
Philip Kaludercic
b5dfd1dfe1 Track file name in 'package--downloads-in-progress'
* lisp/emacs-lisp/package.el (package--download-one-archive): Move
'cl-pushnew' call from 'package--download-one-archive' and cons file
name onto the archive.
(package--download-one-archive): Cons the file name onto the archive.
(package--download-and-read-archives): Remove 'cl-pushnew' call.
2022-11-02 11:56:42 +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
Stefan Kangas
b250f89e63 * lisp/emacs-lisp/multisession.el: Add Commentary. (Bug#58845) 2022-10-31 15:28:36 +01:00
Philip Kaludercic
17b017d55c ; Avoid loading package-vc in 'package-load-descriptor'
* lisp/emacs-lisp/package.el (package-load-descriptor): Remove the
:commit check.

The property is mostly unused anyway, and this unnecessarily slows
down initialisation if a package is installed from source.
2022-10-31 10:51:40 +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
2a4f37fe52 Merge remote-tracking branch 'origin/master' into feature/package+vc 2022-10-30 18:45:37 +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
Basil L. Contovounesios
1d62c96423 ; Silence warning in last hierarchy.el change. 2022-10-30 00:44:44 +03:00
Eli Zaretskii
df7ca69920 Set 'native-comp-debug' to zero on MS-Windows
* lisp/emacs-lisp/comp.el (native-comp-debug): Don't emit debug
symbols on MS-Windows.  The default was originally made 1 because
without that, C backtraces on Windows would not show
natively-compiled functions correctly, or would even stop short of
reaching the topmost call frame.  But that turned out to be due to
a bug in GDB, which was meanwhile fixed in GDB 12.  So we can now
reset the value back to zero, and gain smaller *.eln files on
MS-Windows.
2022-10-29 18:59:04 +03:00
Alan Mackenzie
31e7b9c073 Fix the subr-arity returned by native compiled functions with lots of args
This fixes bug #58739.  Make subr-arity return, e.g., (12 . 12) rather than
(12 . many) for a function with a fixed number of arguments more than 8.

* lisp/emacs-lisp/comp.el (comp-prepare-args-for-top-level): Only return a cdr
of 'many when there are &rest arguments.

* src/eval.c (eval_sub): Also check for a fixed number of args over 8 when
using the nargs + *args calling convention.
(funcall_subr): Also check numargs <= 8 before using the fixed args calling
convention.  Include the case numargs > 8 in the aMany calling convention.

* src/lisp.h (DEFUN): Amend the comment about MANY.
2022-10-29 13:21:39 +00: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
Stefan Monnier
d79cdcd4ff cconv.el: Fix regression in cconv-tests-interactive-closure-bug51695
The new code to make interpreted closures safe-for-space introduced
a regression in `cconv-tests-interactive-closure-bug51695`, only seen
when using TEST_LOAD_EL.
A few other issues were found and fixed along the way.

* lisp/emacs-lisp/cconv.el (cconv-fv): Change calling convention and
focus on finding the free variables.
(cconv-make-interpreted-closure): New function.

* lisp/loadup.el: Use `compiled-function-p` rather than
`byte-code-function-p` so we also use safe-for-space interpreted
closures when we build with native compilation.
(internal-make-interpreted-closure-function):
Use `cconv-make-interpreted-closure`.

* src/eval.c (syms_of_eval): Rename `internal-filter-closure-env-function`
to `internal-make-interpreted-closure-function`.
(Ffunction): Let that new var build the actual closure.

* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-closure-bug51695): Test specifically the
interpreted case.
2022-10-28 11:33:24 -04:00
Stefan Monnier
c0f7a276cf * lisp/emacs-lisp/re-builder.el: Cosmetic changes
(reb-valid-string): Declare it risky so the mode-line will obey its
text-properties.
(reb-lisp-syntax-p): No need to make it `defsubst`.
(reb-target-value): New function to replace the
`reb-target-binding` macro.  Adjust all callers.
(reb-auto-update): Give a more informative error message than just
"invalid" and give it a warning face.
(reb-update-regexp): Always update `reb-regexp-src` (it's harmless),
rather than only when it's necessary (reduces the need for advice in pcre.el).
2022-10-28 09:36:40 -04:00
Wamm K. D
c6ec08e49a Allow Hierarchy to delay computation of children
This adds an option to allow callers to specify that computing
the children of the hierarchy should be delayed to when the
user calls for them, by utilizing the tree-widget :expander
property.
* lisp/emacs-lisp/hierarchy.el (hierarchy-add-tree)
(hierarchy-add-trees): Add parameter 'delay-children-p'.
* lisp/emacs-lisp/hierarchy.el
(hierarchy--create-delayed-tree-widget): Add function.
* lisp/emacs-lisp/hierarchy.el (hierarchy-convert-to-tree-widget):
Utilize ':expander' if delaying children.  (Bug#55900)

* test/lisp/emacs-lisp/hierarchy-tests.el: Add tests for
delayed-children functionality.
2022-10-27 20:12:24 +03:00
Stefan Kangas
db2ed9f333 ; Fix several symbol name typos 2022-10-26 23:04:23 +02:00
Basil L. Contovounesios
38bcad5451 Pacify recent unused/ignored lexvar warnings
Lexvars with special names like 'ignored' or 'unused' are no longer
treated specially.

* lisp/ansi-color.el (ansi-color-process-output):
* lisp/cus-edit.el (customize-apropos-options):
* lisp/cus-theme.el (customize-create-theme):
* lisp/dired-aux.el (dired-hide-all):
* lisp/emacs-lisp/crm.el (crm--choose-completion-string):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-revert):
* lisp/ido.el (ido-choose-completion-string):
* lisp/international/mule-diag.el (describe-font-internal):
* lisp/mail/sendmail.el (sendmail-user-agent-compose):
* lisp/progmodes/fortran.el (fortran-uncomment-region):
* lisp/progmodes/prolog.el (prolog-inferior-guess-flavor):
* lisp/progmodes/ruby-mode.el (ruby-indent-line, ruby-indent-exp):
* lisp/url/url.el (url-mm-callback):
* lisp/xwidget.el (xwidget-webkit-history-reload): Prepend an
underscore to unused function parameter names.
* lisp/emacs-lisp/cconv.el (cconv--dummy-var): Remove unused
constant.
* lisp/files.el (hack-local-variables-filter): Remove unused lexvar.
2022-10-26 16:35:59 +03: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
Andrea Corallo
5ad5b797f7 Set `comp-no-spawn' earlier using -no-comp-spawn
* src/emacs.c (standard_args): Add '-no-comp-spawn' cmd line option.
* lisp/startup.el (command-line): Parse '-no-comp-spawn' cmd line
option.
* lisp/emacs-lisp/comp.el (comp-run-async-workers, comp-final):
Use '-no-comp-spawn'.
2022-10-26 08:30:09 +02:00
Stefan Monnier
1b1ffe0789 (Ffunction): Make interpreted closures safe for space
Interpreted closures currently just grab a reference to the complete
lexical environment, so (lambda (x) (+ x y)) can end up looking like

    (closure ((foo ...) (y 7) (bar ...) ...)
             (x) (+ x y))

where the foo/bar/... bindings are not only useless but can prevent
the GC from collecting that memory (i.e. it's a representation that is
not "safe for space") and it can also make that closure "unwritable"
(or more specifically, it can cause the closure's print
representation to be u`read`able).

Compiled closures don't suffer from this problem because `cconv.el`
actually looks at the code and only stores in the compiled closure
those variables which are actually used.

So, we fix this discrepancy by letting the existing code in `cconv.el` tell
`Ffunction` which variables are actually used by the body of the
function such that it can filter out the irrelevant elements and
return a closure of the form:

    (closure ((y 7)) (x) (+ x y))

* lisp/loadup.el: Preload `cconv` and set
`internal-filter-closure-env-function` once we have a usable `cconv-fv`.

* lisp/emacs-lisp/bytecomp.el (byte-compile-preprocess): Adjust to new
calling convention of `cconv-closure-convert`.
(byte-compile-not-lexical-var-p): Delete function, moved to `cconv.el`.
(byte-compile-bind): Use `cconv--not-lexical-var-p`.

* lisp/emacs-lisp/cconv.el (cconv--dynbound-variables): New var.
(cconv-closure-convert): New arg `dynbound-vars`
(cconv--warn-unused-msg): Remove special case for `ignored`,
so we don't get confused when a function uses an argument called
`ignored`, e.g. holding a list of things that it should ignore.
(cconv--not-lexical-var-p): New function, moved from `bytecomp.el`.
Don't special case keywords and `nil` and `t` since they are already
`special-variable-p`.
(cconv--analyze-function): Use `cconv--not-lexical-var-p`.
(cconv--dynbindings): New dynbound var.
(cconv-analyze-form): Use `cconv--not-lexical-var-p`.
Remember in `cconv--dynbindings` the vars for which we used
dynamic scoping.
(cconv-analyze-form): Use `cconv--dynbound-variables` rather than
`byte-compile-bound-variables`.
(cconv-fv): New function.

* src/eval.c (Fsetq, eval_sub): Remove optimization designed when
`lexical-binding == nil` was the common case.
(Ffunction): Use `internal-filter-closure-env-function` when available.
(eval_sub, Ffuncall): Improve error info for `excessive_lisp_nesting`.
(internal-filter-closure-env-function): New defvar.
2022-10-25 14:24:54 -04:00
Juri Linkov
c06b5961ee * lisp/tab-bar.el: Use customizable button icons (bug#51309, bug#51648)
* lisp/tab-bar.el (tab-bar--load-buttons): Use 'define-icon' to
define icons for tab-bar-new, tab-bar-close, tab-bar-menu-bar.
Also set tab-bar-new-button, tab-bar-close-button, tab-bar-menu-bar-button
to the specified icon-string.
(tab-bar-history-mode): Use 'define-icon' to
define icons for tab-bar-back, tab-bar-forward.
Also set tab-bar-back-button, tab-bar-forward-button
to the specified icon-string.

* lisp/emacs-lisp/icons.el (icons--create)<image>: Allow to easy
add new image props by using 'apply' on them.  Add :margin.
2022-10-24 10:33:41 +03: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