* test/lisp/progmodes/eglot-tests.el
(eglot-test-project-wide-diagnostics-rust-analyzer):
Bind project-vc-non-essential-cache-timeout to 0 so that the
result of project-current is refreshed (bug#80387).
This restores the original behavior of 'overlays_in'. Changes in
this behavior had been made for cases of narrowing, but this
resulted in a regression with uses of 'remove-overlays'.
* src/buffer.c (overlays_in): Change all occurrences of ZV to Z.
* test/src/buffer-tests.el (test-overlays-in-2)
(test-remove-overlays): Adjust expected results to accommodate
changes in 'overlays_in'.
* test/src/fns-tests.el (ft-weak-equal-table): With wide-ints, the test
unexpecetly passed probably because some stray reference to '(key 0) was
on the stack. With a helper thread, the test works as expected.
* lisp/align.el (align-region): Use markers to ensure the regions
stay accurate after overlapping aligning modifications. (Bug#80316)
* test/lisp/align-tests.el (align-c-multi-section): New test.
* test/lisp/vc/vc-git-tests.el (vc-git-test-branch-remotes):
The 'unset' subcommand to 'git config' was introduced in git 2.46; use
the '--unset' option instead.
It can be enabled with -DUSE_EPHEMERON_POOL.
This variant uses the ephemeron pool and hence sovles the key-in-value
problem.
This version stores key/values pairs a vector-of-pairs instead of a
pair-of-vectors. The same vector-of-pairs type is used for weak and
non-weak. This avoids the code duplication used by the pair-of-vector
version; though it adds a bit of overhead to the non-weak code path.
* src/lisp.h: (struct vector_pair [!USE_EPHEMERON_POOL]): New type.
(struct pair_vector [USE_EPHEMERON_POOL]):New type.
(hash_table_kv): New typedef used to both version.
(hash_table_kv_create, hash_table_kv_free, hash_table_kv_key)
(hash_table_kv_value, hash_table_kv_set_key, hash_table_kv_set_value)
(hash_table_kv_null): New helpers
(struct Lisp_Hash_Table): Use a single field kv of type hash_table_kv
instead of two fields.
(HASH_KEY, HASH_VALUE, WEAK_HASH_KEY, WEAK_HASH_VALUE, DOHASH)
(DOHASH_WEAK, set_hash_key_slot, set_hash_value_slot)
(set_weak_hash_key_slot, set_weak_hash_value_slot): Adapt to
hash_table_kv.
(DOHASH [USE_EPHEMERON_POOL]): New version.
* src/igc.h (enum igc_obj_type): Add IGC_OBJ_PAIR_VECTOR,
IGC_OBJ_WEAK_KEY_PAIR_VECTOR, IGC_OBJ_WEAK_VALUE_PAIR_VECTOR,
IGC_OBJ_WEAK_OR_PAIR_VECTOR.
(igc_alloc_pair_vector): New prototype.
* src/igc.c (obj_type_names, set_header, dflt_scan_obj, thread_ap):
Handle new tpes.
(struct igc_thread, create_ephemeron_ap, create_thread_aps)
(igc_thread_remove): Add allocation point for ephemeron pool.
(struct igc, make_pool_aeph, make_igc): Add ephemeron pool.
(as_igc_header, fix_pair_vector, decode_ptr, encode_ptr)
(increment_ndeleted, splat_pair, fix_weak_key_pair, fix_weak_value_pair)
(fix_weak_or_pair, fix_weak_and_pair, scan_pair_vector)
(fix_weak_key_pair_vector, fix_weak_value_pair_vector)
(fix_weak_or_pair_vector, fix_weak_and_pair_vector): New helpers.
(fix_hash_table, fix_weak_hash_table_strong_part)
(fix_weak_hash_table_weak_part): Adapt to hash_table_kv.
(igc_alloc_pair_vector): New function.
* src/fns.c (maybe_resize_hash_table): Call maybe_resize_hash_table.
(Fgethash): Add assertion for HASH_UNUSED_ENTRY_KEY.
(Fhash_table_count): Take deleted entries into account.
(hash_table_kv_init, hash_table_kv_create)
(hash_table_kv_resize, hash_table_kv_free): New helpers.
(hash_table_kv_ndeleted, hash_table_ndeleted)
(hash_table_count, reclaim_deleted_entries)
(maybe_reclaim_deleted_entries): New helpers.
(make_hash_table, copy_hash_table, hash_table_thaw, hash_table_rehash)
(allocate_weak_hash_table_parts, make_weak_hash_table)
(maybe_resize_weak_hash_table): Adapt to hash_table_kv.
* src/alloc.c (cleanup_vector): Adapt to hash_table_kv.
* src/pdumper.c (hash_table_contents, hash_table_freeze)
(dump_hash_table): Adapt to hash_table_kv.
(dump_hash_table_kv_slot, dump_hash_table_kv, dump_hash_table_kv_part):
New helpers.
* src/print.c (print_object): Use Fhash_table_count instead
of the h->count field.
* test/src/fns-tests.el (ft--check-entries): Check hash-table-count.
(ft-weak-fixnums2, ft--test-weak-fixnums2): New test.
(ft--test-ephemeron-table): Better check for hash-table-count.
This function will truncate a string on a pixelwise basis in a
work buffer and using a binary search rather than brute force.
* lisp/emacs-lisp/subr-x.el (work-buffer--prepare-pixelwise):
New defun helper function.
(string-pixel-width): Use the helper function.
(truncate-string-pixelwise): New defun.
* test/lisp/misc-tests.el (misc-test-truncate-string-pixelwise):
(misc-test-truncate-string-pixelwise-unicode): New test.
* doc/lispref/display.texi (Size of Displayed Text): Document
the function.
* etc/NEWS: Announce the function.
* lisp/vc/vc-git.el (vc-git--branch-remotes): New function.
(vc-git-trunk-or-topic-p): Use it.
* test/lisp/vc/vc-git-tests.el (vc-git-test-branch-remotes): New
test.
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-tests-repos): New variable.
(package-vc-tests-create-repository): Add argument `repos-dir'.
(package-vc-tests-make-temp-dir): Create a temporary directory
with prefix.
(package-vc-with-tests-environment): Use
`package-vc-tests-make-temp-dir' to create a temporary directory
for package test. Use `package-vc-tests-repos' to cache test
package repository.
(package-vc-tests-preserve-pkg-artifacts-p): Detect when to
preserve package temporary files.
(package-vc-tests-environment-tear-down): Use
`package-vc-tests-preserve-pkg-artifacts-p'. Use plural there
are more than one buffer. Report temporary directory with test
repository.
(package-vc-tests-add-ert-run-tests-listener): Wrap listener in
args with custom functionality for `package-vc-tests'. On tests
run start reset `package-vc-tests-repos' cache. On tests run
end delete temporary directories.
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-tests-packages): Add argument `full'. When `full'
is non-nil, then return full entries.
(package-vc-test-deftest): Use `pkg-arg' for the name of
argument `in-body'. Call `skip-when' and `skip-unless' before
`packgage-vc-tests-with-installed'.
Suggested by Stefan Monnier.
* lisp/emacs-lisp/pcase.el (pcase--macroexpand): Simplify.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-pred-equiv): New test.
* etc/NEWS: Announce the change.
* src/dispextern.h (struct glyph_row): Add
'extra_line_spacing_above' member.
(struct it): Add 'extra_line_spacing_above' member.
* src/frame.h (struct frame): Add 'extra_line_spacing_above'
member. Update comment for 'extra_line_spacing.'
* src/buffer.c (syms_of_buffer): Update the docstring of
'line-spacing' to describe the cons cell usage.
* src/buffer.h (struct buffer): Update comment for
'extra_line_spacing'.
* src/frame.c (gui_set_line_spacing): Handle cons cell value for
'line-spacing'. Calculate and set 'extra_line_spacing_above'
for both integer and float pairs.
* src/xdisp.c (init_iterator): Initialize 'extra_line_spacing_above'
from buffer or frame 'line-spacing', handling cons cells for both
integer and float values.
(gui_produce_glyphs): Use 'extra_line_spacing_above' to distribute
spacing between ascent and descent. Update 'max_extra_line_spacing'
calculation.
(resize_mini_window): Take line spacing into account when resizing the
mini window. Pass height of a single line to 'grow_mini_window' and
'shrink_mini_window'.
* src/window.c (grow_mini_window, shrink_mini_window): Add unit
argument which defines height of a single line.
* src/window.h (grow_mini_window, shrink_mini_window): Adjust function
prototypes accordingly with unit argument.
* lisp/subr.el (total-line-spacing): New function to calculate total
spacing from a number or cons cell.
(posn-col-row): Use total-line-spacing.
* lisp/simple.el (default-line-height): Use 'total-line-spacing'.
* lisp/textmodes/picture.el (picture-mouse-set-point): Use
'total-line-spacing'.
* lisp/window.el (window-default-line-height): Use
'total-line-spacing'.
(window--resize-mini-window): Take 'line-spacing' into account.
* test/lisp/subr-tests.el (total-line-spacing): New test.
* test/src/buffer-tests.el (test-line-spacing): New test.
* doc/emacs/display.texi (Display Custom): Document that
'line-spacing' can be a cons cell.
(Line Height): Document the new cons cell format for 'line-spacing'
to allow vertical centering.
Co-authored-by: Przemysław Alexander Kamiński <alexander@kaminski.se>
Co-authored-by: Daniel Mendler <mail@daniel-mendler.de>
* test/Makefile.in: Distinguish between parallel and not-parallel
tests. Mark lisp/autorevert-tests.log, lisp/filenotify-tests.log
and lisp/net/tramp-tests.log to run not-parrallel. (Bug#80164)
* test/README: Some of the tests do not run parallel when
expensive tests are activated.
* test/infra/gitlab-ci.yml (.job-template): Use "make -j".
Makefile knows how to handle parallel runs properly.
* lisp/progmodes/json-ts-mode.el (json-ts--get-path-at-node)
(json-ts--path-to-jq, json-ts--path-to-python): New functions.
(json-ts-jq-path-at-point): New command for getting JSON path at point.
* test/lisp/progmodes/json-ts-mode-tests.el: New file.
Add tests for the utility command.
* etc/NEWS: Announce new command 'json-ts-jq-path-at-point' (bug#80190).
* lisp/net/tramp-adb.el:
* lisp/net/tramp-androidsu.el:
* lisp/net/tramp-integration.el:
* lisp/net/tramp-smb.el: Do not delay
`connection-local-set-profiles' until after loading `shell'.
* lisp/net/tramp-integration.el: Add the local profile for all
hosts listed in `tramp-local-host-names'.
* lisp/net/tramp.el (tramp-local-host-names): New defvar.
(tramp-local-host-regexp): Use it.
* test/lisp/net/tramp-tests.el (tramp-test03-file-name-defaults):
Adapt test.
* test/lisp/textmodes/ispell-tests/ispell-tests.el
(ispell/ispell-accept-buffer-local-defs/simple): Don't treat
Aspell as Ispell even if it pretends to be. (Bug#80165)
Previously, if 'calc-string-maximum-character' wasn't a valid
character 'math-vector-is-string' would throw an error in the
comparison, leading to an incomplete display of the stack and a
cryptic error message. Instead, have 'math-vector-is-string'
return nil, which effectively disables the display of strings.
Refines feature introduced in bug#78528.
* doc/misc/calc.texi (Customizing Calc): Update description of
behavior for invalid 'calc-string-maximum-character'.
* lisp/calc/calccomp.el (math-vector-is-string): Return nil when
'calc-string-maximum-character' doesn't represent a character.
* test/lisp/calc/calc-tests.el (calc-math-vector-is-string): Correct
and simplify tests.
* doc/misc/dbus.texi (Top): Add "Inhibitor Locks" submenu.
Remove trailing period from chapter and section titles.
(Inhibitor Locks): New node.
* etc/NEWS: New D-Bus functions to support systemd inhibitor locks.
Presentational fixes and improvements.
* src/dbusbind.c (xd_registered_inhibitor_locks): New variable.
(Fdbus_make_inhibitor_lock, Fdbus_close_inhibitor_lock)
(Fdbus_registered_inhibitor_locks): New DEFUNs. (Bug#79963)
(syms_of_dbusbind_for_pdumper): Initialize
`xd_registered_inhibitor_locks'.
(syms_of_dbusbind): Declare subroutines
`Sdbus_make_inhibitor_lock', `Sdbus_close_inhibitor_lock' and
`Sdbus_registered_inhibitor_locks'. Declare symbol `Qdbus_call_method'.
staticpro `xd_registered_inhibitor_locks'.
* test/lisp/net/dbus-tests.el (dbus--test-systemd-service)
(dbus--test-systemd-path, dbus--test-systemd-manager-interface):
New defconsts.
(dbus-test10-inhibitor-locks): New test.
* doc/misc/dbus.texi (Signals): All registered signal handlers are
called.
(Synchronous Methods, Signals, Monitoring Messages): Add function
result in examples.
* src/dbusbind.c (xd_store_event): New function.
(xd_read_message_1): Use it. Call all registered handlers per
signal. (Bug#80168)
* test/lisp/net/dbus-tests.el (dbus--test-signal-handler): Adapt defun.
(dbus--test-signal-handler1, dbus--test-signal-handler2): New defuns.
(dbus-test05-register-signal-several-handlers): New test.
(dbus-test04-register-method)
(dbus-test04-call-method-authorizable)
(dbus-test05-register-signal)
(dbus-test05-register-signal-with-nils)
(dbus-test06-register-property-emits-signal): Adapt tests.
* lisp/emacs-lisp/cl-generic.el (cl--generic-make-function):
Preserve advertised-calling-convention info.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization):
Require `byte-opt` to fix the test when the compiler is not loaded yet.
* lisp/progmodes/elisp-mode.el: Fix some >80column problems.
(elisp--xref-format-extra)
(elisp--xref-format): Make them constant, now that we don't have
the purespace. Also, use %S since some of the elements
don't necessarily have names and even if they do, we'd want to
escape any funny characters in them to avoid ambiguities.
(elisp--xref-find-definitions): Fix uses of
`elisp--xref-format-extra` accordingly.
Improve heuristic to distinguish proper `cl-defgeneric` from
implicit ones.
(elisp-eldoc-docstring-length-limit)
(elisp-eldoc-funcall-with-docstring-length): Remove redundant `:group`.
* lisp/cedet/mode-local.el (xref-mode-local-overload): Pass the
override symbol rather than its name through `elisp--xref-format-extra`.
* test/lisp/progmodes/elisp-mode-tests.el (find-defs-constructor):
Adjust test to new text.