Expand the directory name passed to the
'package-vc-install-from-checkout' function so that paths like
"/path/to/pkg/./" are converted to "/path/to/pkg/". This
ensures that the package name defaults to "pkg" instead of ".".
* lisp/emacs-lisp/package-vc.el
(package-vc-install-from-checkout): Expand the provided
directory name. (Bug#78855)
Co-developed-by: Roi Martin <jroi.martin@gmail.com>
* lisp/vc/smerge-mode.el (smerge-refine-shadow-cursor): New variable
and face.
(smerge-refine-regions): Add `cursor-sensor-functions` property
to the covering overlays.
(smerge--refine-at-right-margin-p, smerge--refine-shadow-cursor):
New functions.
(smerge--refine-other-pos): New function, extracted from
`smerge-refine-exchange-point`.
(smerge-refine-exchange-point): Use it.
(smerge--refine-highlight-change): Add thin
highlighted space for insertion/deletion positions.
* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--detect):
Run functions for `moved` events. Demote errors.
(cursor-sensor-mode): Adjust docstring accordingly.
* doc/lispref/text.texi (Special Properties) <cursor-sensor-functions>:
Mention the new `moved` direction.
Add package-menu mode-line which displays information about:
total number of packages installed, total number of packages
from all the packages archive, total number of packages to
upgrade and total number of new packages available.
Highlight packages marked for installation or deletion.
* lisp/emacs-lisp/package.el (package-menu-mode): Add package-menu
mode-line format to 'mode-line-misc-info'.
(package-mark-install-line, package-mark-delete-line): New faces.
(package-menu--overlay-line, package-menu--remove-overlay)
(package-menu--set-mode-line-format): New functions.
(package-menu-mark-delete, package-menu-mark-install)
(package-menu-mark-unmark, package-menu-backup-unmark)
(package-menu-mark-obsolete-for-deletion): Tweak for set/unset the
overlays.
(package-menu-mode-line-format, package-menu-mode-line-info): New
buffer-local variables.
(list-packages): Add 'package-menu--set-mode-line-format' to
'package--post-download-archives-hook'.
* etc/NEWS: Announce changes.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
Quote the function name in '(macro . function-name), since we eval
it later.
* test/lisp/emacs-lisp/bytecomp-tests.el
(test-eager-load-macro-expand-defalias): New test.
(Bug#78792)
The old behavior was for (cl-random -1.0e+INF) to return NaN in about
one in eight million calls, and -1.0e+INF otherwise. Other unusual
arguments were handled inconsistently as well.
* lisp/emacs-lisp/cl-extra.el (cl-random): Handle positive finite
arguments consistently, error for nonpositive or infinite arguments.
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-random): New
test.
There seem to be no remaining callers of this function, which has not
been working for a while.
* lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): Don't
mention "-list-p" predicate.
(eieio-defclass-autoload): Don't autoload predicate.
(eieio-defclass-internal): Remove code to generate list-p predicate.
This fixes a regression from Emacs 29, and is the second attempt after
the later reverted 8b0f5b0597.
* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition):
Make it work for functions that aren't compiled.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--f):
(bytecomp-tests--warn-arity-noncompiled-callee): Add test.
* test/src/comp-resources/comp-test-funcs.el (comp-test-76573-1-f): New
function.
* lisp/emacs-lisp/comp-cstr.el (comp-supertypes): Don't error if 'type'
is unknown.
Before refontifying a region, remove any text properties we care about
so that we don't end up with stray properties. Additionally, make sure
to remove all the properties when deactivating the mode.
* lisp/emacs-lisp/subr-x.el (add-remove--display-text-property): New
function, extracted from...
(add-display-text-property): ... here.
(remove-display-text-property): New function.
* lisp/visual-wrap.el (visual-wrap--remove-properties): New function...
(visual-wrap-prefix-function, visual-wrap-prefix-mode): ... call it.
* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-remove-display-text-property): New test.
* test/lisp/visual-wrap-tests.el
(visual-wrap-tests/wrap-prefix-stickiness, visual-wrap-tests/cleanup):
New tests.
* doc/lispref/display.texi (Display Property): Document
'remove-display-text-property'.
* etc/NEWS: Announce 'remove-display-text-property' (bug#76018).
Specifically, use the term "display specification" more consistently to
distinguish from "display property", which is the full value of the
'display' text property.
* src/xdisp.c (find_display_property): Rename PROP to SPEC.
(Fget_display_property): Rename PROP to SPEC and improve docstring.
* lisp/emacs-lisp/subr-x.el (add-display-text-property): Rename PROP to
SPEC and improve docstring.
* doc/lispref/display.texi (Display Property): Reword documentation to
more-consistently refer to display specifications.
When calling 'add-display-text-property' on a region of text that
already contains PROP, we first delete the old display specification
from the region. If the region's 'display' property is a list of
display specifications, we need to avoid destructively modifying the
list; other regions of text could be using the same list object. (For a
'display' property that's a vector or a single display spec, this
doesn't matter since we first make a new list in the code.)
In addition, be more careful when working with a display property like
((margin ...) ...). This is a single display specification, not a list
of display specs.
* lisp/emacs-lisp/subr-x.el (add-display-text-property): Don't delete
in-place for list values. Handle (margin ...) display specification
type correctly.
* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-add-display-text-property): Update test.
This is a regression from Emacs 29.
* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition):
Make it work for functions that aren't compiled.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--f):
(bytecomp-tests--warn-arity-noncompiled-callee): Add test.
* lisp/emacs-lisp/cl-extra.el (cl--derived-type-generalizers):
Check that the type is valid and fully defined.
* lisp/emacs-lisp/cl-lib.el (cl-generic-generalizers) <derived-type>:
Don't delegate to another method just because the type is invalid.
* lisp/emacs-lisp/cl-preloaded.el (cl--define-derived-type):
Minor simplification, and improvement to an error message.
* lisp/emacs-lisp/cl-lib.el (cl-generic-generalizers): Tweak the
bootstrap hack to avoid a problem when dumping `bootstrap-emacs` when
`cl-lib.el` has already been compiled.
* lisp/emacs-lisp/cl-macs.el (list): Move out of `static-if` test.
Always define a `cl-deftype-satisfies` predicate (if possible), so
we only need `cl-typep` to "interpret" a type specifier when we use
a compound type but never for the atomic types (e.g. never
in `cl-types-of`).
* lisp/emacs-lisp/cl-macs.el (cl-typep): Test `cl-deftype-satisfies` first.
Don't handle `real` here any more.
(base-char, character, command, keyword, natnum, real): Define with
`c-deftype`.
(cl-deftype): Precompute the predicate for the atomic derived type,
if applicable.
* lisp/emacs-lisp/cl-preloaded.el (cl--define-derived-type):
Add argument for the precomputed predicate function.
* lisp/emacs-lisp/cl-extra.el (cl-types-of): Use `cl-deftype-satisfies`
instead of `cl-type-p`.
In order to make it easier to change that in the future, let
`cl--define-derived-type` take care of storing the derived
type's function into `cl-deftype-handler`.
* lisp/emacs-lisp/cl-preloaded.el (cl--define-derived-type):
Change calling convention. Set `cl-deftype-handler`.
* lisp/emacs-lisp/cl-macs.el (cl-deftype): Don't set `cl-deftype-handler`,
instead pass the function to `cl--define-derived-type`.
`cl-defstruct` also defines a type and is also in CL, so
"cl-type" is not precise enough to talk about those types
defined with `cl-deftype`. Use the term "derived type" to be
more clear, as is done in the HyperSpec.
* doc/misc/cl.texi (Derived types): Move `cl-deftype` to this
new subsection. Document the use of derived types as method specializers.
* lisp/emacs-lisp/cl-extra.el (cl--types-of-memo): Rename from
`cl--type-unique`.
(cl--derived-type-dispatch-list): Rename from `cl--type-dispatch-list`.
(cl--derived-type-generalizer): Rename from `cl--type-generalizer`.
(cl--derived-type-generalizers): Rename from `cl--type-generalizers`.
* lisp/emacs-lisp/cl-lib.el (cl-generic-generalizers) <derived-types>:
Rename from <cl-types-of>. Catch but don't hide errors when a derived
type cannot be used as an atomic type specifier.
* lisp/emacs-lisp/cl-preloaded.el (cl--derived-type-list): Rename from
`cl--type-list`.
(cl-derived-type-class): Rename from `cl-type-class`.
(cl--derived-type-class-make): Rename from `cl--type-class-make`.
(cl--define-derived-type): Rename from `cl--type-deftype`.
* lisp/emacs-lisp/cl-extra.el (cl--type-unique, cl-types-of)
(cl--type-dispatch-list, cl--type-generalizer): Move to `cl-extra.el`.
(cl--type-generalizers): New function extracted from "cl-types-of"
method of `cl-generic-generalizers`.
* lisp/emacs-lisp/cl-lib.el (cl-generic-generalizers): New method to
dispatch on derived types. Use `cl--type-generalizers`.
* lisp/emacs-lisp/cl-macs.el (cl-deftype): Move from `cl-types.el`
and rename from `cl-deftype2`.
(extended-char): Tweak definition to fix bootstrapping issues.
* lisp/emacs-lisp/cl-preloaded.el (cl--type-list, cl-type-class)
(cl--type-deftype): Move from `cl-types.el`.
* lisp/emacs-lisp/oclosure.el (oclosure): Don't abuse `cl-deftype` to
register the predicate function.
* test/lisp/emacs-lisp/cl-extra-tests.el: Move tests from
`cl-type-tests.el`.
Mostly, get rid of `cl--type-flag` and rely only on the presence/absence
of the type on `cl--types-list` to "flag" erroring-types.
Also, don't try and catch errors during dispatch.
* lisp/emacs-lisp/cl-types.el (cl--type-dispatch-list): Move to the
relevant section.
(cl--type-parents): Inline into sole caller.
(cl--type-deftype): Add `arglist` argument.
Don't signal an error if the type already existed but wasn't in
`cl--type-list` since that's normal and we can fix it.
Don't touch `cl--type-flag` any more.
Don't add to `cl--type-list` if it can't be used without arguments.
(cl-deftype2): Adjust call accordingly.
(cl--type-error): Inline into sole caller.
(cl-types-of): Be more careful to preserve ordering of types
before passing them to `merge-ordered-lists`.
Add `types` argument for use by dispatch.
Don't bother skipping the `root-type` since that's a built-in type,
so it should never happen anyway.
Don't catch errors if called from dispatch.
Don't bother with `cl--type-flag`.
(cl--type-generalizer): Use new arg of `cl-types-of` instead of
let-binding `cl--type-list`, in case `cl-types-of` ends up (auto)loading
a file or some such thing which needs to use/modify `cl--type-list`.
(cl--type-undefine): Move to end of file.
* test/lisp/emacs-lisp/cl-types-tests.el (cl-types-test): Remove DAG
test since we don't detect such errors any more.
Relax ordering test when the order is not guaranteed
by parent-relationships.
* lisp/emacs-lisp/cl-types.el (cl--type-list): Doc string.
(cl--type-dispatch-list): New variable.
(cl--type-parents): Make it a plain defun.
(cl--type-children, cl--type-dag): Remove.
(cl--type-undefine): Remove duplicate test for `cl--type-p'. Use
`cl--class-children'. Clear `cl--type-flag' instead of
`cl--type-error'. Also remove type from the dispatch list.
(cl--type-deftype): Doc string. Remove useless safeguard of
data on error. Fix some error messages. Clear `cl--type-flag'
when a type is (re)defined. Just push new types on
`cl--type-list'.
(cl--type-error): Set `cl--type-flag' to the symbol `error' and
remove type in error from the dispatch list.
(cl-types-of): Doc string. Remove useless check for
`cl-type-class-p'. Skip types which we are sure will not match.
Simplify creation of the DAG.
(cl--type-generalizer): In the tagcode-function, check only types
that can be dispatched.
(cl-generic-generalizers): Populate the dispatch list.
* lisp/emacs-lisp/package.el (package-unpack): Re-create the
directory structure of the source directory and copy the files
in the right place.
(package-dir-info): Try to find package info in files closer to
the specified package source root.
(Bug#78017)
* lisp/emacs-lisp/ert.el (ert-test--erts-test): Fix 'Skip'
behavior in erts files, so only the test case where it is
specified is skipped.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-erts-skip-one)
(ert-test-erts-skip-last): Add test cases.