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.
* lisp/emacs-lisp/comp-run.el
(native-comp-async-on-battery-power): New option.
(battery-status-function): Declare.
(native--compile-skip-on-battery-p): New function.
(comp--run-async-workers): Call it.
* etc/NEWS: Announce the new option.
* lisp/emacs-lisp/package-vc.el (package-vc--main-file)
(package-vc--unpack-1): Provide a fallback value if the package
specification has no :lisp-dir.
* lisp/emacs-lisp/package.el (package-unpack, package-dir-info):
Check the marked files if in a Dired buffer, and otherwise
fallback on the previous behaviour or if there was no selection.
(package-install-from-buffer): Document the feature.
* etc/NEWS: Mention the change.
(Bug#78017)
* lisp/emacs-lisp/package-vc.el (package-vc--main-file): Use
`expand-file-name' to support :lisp-dir entries outside of the
elpa directory.
(package-vc--unpack-1): Same as above.
(package-vc-install-from-checkout): Instead of creating a
symlink to the requested directory, create an empty directory
and use autoload indirections, analogously to checkouts with
Lisp code in a subdirectory.
(Bug#78017)
* lisp/register.el (frame-register, kmacro-register): Remove bogus deftypes.
(register--type) <oclosure>: Fix kmacro method and generalize it to
any OClosure.
(register--type) <frameset-register>: Fix method and move it to ...
* lisp/frameset.el (register--type) <frameset-register>: ... here,
where `frameset-register` is defined.
* lisp/emacs-lisp/cl-types.el (cl--type-parents): Make it a proper function.
(cl--type-children): Use `cl--class-children` and make it a `defsubst`.
(cl--type-dag): η-reduce and make it a `defsubst`.
(cl--type-undefine): Also reset `cl--type-error`.
(cl--type-deftype): Modify `cl--type-list` atomically so we never need
to restore it upon error. Don't test bogus parent here.
(cl-deftype2): Test bogus parent here instead. Also, better preserve
the declarations for the lambda.
(cl-types-of): Do less uncached work.
As presently under discussion in bug#77823, the intended new
functionality is not really about comments at all.
Remove it for now to allow us to redesign from a clean slate,
and to deal with the regression reported in bug#77823.
This reverts the following three changesets:
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 17 12:56:52 2025 -0600
New minor mode: `electric-block-comment-mode'
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 31 17:58:16 2025 -0600
Add block-comment-start and block-comment-end to supported modes
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Sun Apr 13 12:26:08 2025 -0600
Add block-comment variables to cc-mode
* lisp/emacs-lisp/eieio-base.el (make-instance) <eieio-named>:
Really skip backward compatibility when `eieio-backward-compatibility`
is nil and emit message if it's `warn`.
(eieio-persistent-make-instance): Warn when an obsolete name is used.
* lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility):
Change default to `warn`.
(eieio-defclass-internal): Warn when the *-list-p function is called
(eieio--slot-name-index): Warn when a initarg is used to access a slot.
* lisp/emacs-lisp/eieio.el (defclass): Warn when a class-slot is
accessed via the obsolete method.
(make-instance, clone) <eieio-default-superclass>: Really skip backward
compatibility when `eieio-backward-compatibility` is nil and emit
message if it's `warn`.
* lisp/emacs-lisp/cl-print.el (cl-print-expand-ellipsis): Bind
inhibit-read-only to t.
* lisp/vc/vc-dispatcher.el (require): Require cl-print at
compile time.
(vc-do-async-command): When printing command arguments that
contain multiple lines, use cl-prin1 with cl-print-string-length
bound in order to ellipse lines other than the first.
Switch the outer quotation marks to single quotation marks.