Commit graph

8503 commits

Author SHA1 Message Date
Stéphane Marks
a0748d9791 New function 'truncate-string-pixelwise' (bug#80244)
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.
2026-01-31 11:04:40 +02:00
Sean Whitton
93bba3797e Factor out vc-git--branch-remotes
* 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.
2026-01-30 13:35:50 +00:00
Eli Zaretskii
80551807d4 ; Fix package-vc-tests for older versions of Git
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-tests-create-repository): Fix commands for older
versions of Git.
2026-01-29 10:29:40 +02:00
Przemysław Kryger
b370a076b9 Create package-vc-tests repositories once per tests run (bug#80235)
* 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.
2026-01-28 18:44:06 +01:00
Michael Albinus
aaa505025f Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2026-01-28 12:44:30 +01:00
Michael Albinus
8c84a2ae71 New Tramp test
* test/lisp/net/tramp-tests.el (tramp-test45-force-remote-file-error):
New test.
2026-01-28 12:43:38 +01:00
Basil L. Contovounesios
89dad01763 ; Fix last change to test/src/process-tests.el. 2026-01-28 10:29:46 +01:00
Michael Albinus
d09cedc9bf ; Instrument filenotify test
* test/lisp/filenotify-tests.el (file-notify-test08-backup):
Instrument test.
2026-01-27 18:49:37 +01:00
Michael Albinus
50bb4ae1eb ; * test/src/process-tests.el: Instrument for bug#80166. 2026-01-27 18:39:47 +01:00
Przemysław Kryger
4fae092e2d Ensure skipped package-vc-tests are not installed (bug#80235)
* 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'.
2026-01-27 15:32:28 +01:00
Mattias Engdegård
fd9d685c63 Neater pcase predicate transform
Suggested by Stefan Monnier.

* lisp/emacs-lisp/pcase.el (pcase--macroexpand): Simplify.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-pred-equiv): New test.
2026-01-26 12:22:44 +01:00
Daniel Mendler
e8f26d554b Support cons cell for 'line-spacing'
* 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>
2026-01-24 13:32:44 +02:00
Jacob S. Gordon
2145519734 ; calendar-bahai: Move tests and convert to ERT
* lisp/calendar/cal-bahai.el (calendar-bahai--nawruz-reference-dates)
(calendar-bahai--twin-birthdays-reference-dates): Move to test file.
(calendar-bahai--verify-nawruz)
(calendar-bahai--verify-twin-birthdays): Remove and adapt contents in
test file.
(calendar-bahai-verify-calculations, calendar-bahai-run-tests): Remove.
* test/lisp/calendar/cal-bahai-tests.el: Add file.
(calendar-bahai--nawruz-reference-dates)
(calendar-bahai--twin-birthdays-reference-dates): Add test data.
(calendar-bahai-verify-nawruz, calendar-bahai-verify-twin-birthdays):
Create ERT tests.  (Bug#80207)
2026-01-24 13:25:14 +02:00
Michael Albinus
17c78c9920 ; Tramp code cleanup
* lisp/net/tramp-cache.el (tramp-cache-unload-hook):
* lisp/net/tramp-cmds.el (tramp-enable-method, tramp-bug):
* lisp/net/tramp-compat.el:
* test/lisp/net/tramp-tests.el
(tramp-test26-interactive-file-name-completion):
Simplify retrieving proper function symbols.
2026-01-24 10:15:29 +01:00
Michael Albinus
6762394734 Improve handling of not-parallel test runs
* 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.
2026-01-24 09:07:46 +01:00
Mattias Engdegård
cd8c85c4fd * test/Makefile.in (SLOW_TESTS): add package-vc-tests (bug#80235) 2026-01-23 16:46:34 +01:00
Michael Albinus
2696eff451 ; * test/lisp/net/dbus-tests.el: Fix typos. 2026-01-22 09:58:37 +01:00
Binbin Ye
8ea6f6da77 Add JSON path utility command to json-ts-mode
* 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).
2026-01-21 19:27:03 +02:00
Mattias Engdegård
fe2469c1c1 ; * test/lisp/net/dbus-tests.el: hush warnings on no-dbus platforms 2026-01-21 16:22:05 +01:00
Michael Albinus
8f96f5ffb5 Tag Tramp tests as :expensive-test
* test/lisp/net/tramp-tests.el (tramp-test03-file-name-defaults)
(tramp-test10-write-region-file-precious-flag)
(tramp-test10-write-region-other-file-name-handler)
(tramp-test16-file-expand-wildcards)
(tramp-test17-dired-with-wildcards)
(tramp-test17-insert-directory-one-file)
(tramp-test33-environment-variables-and-port-numbers)
(tramp-test35-remote-path, tramp-test39-make-lock-file-name)
(tramp-test39-detect-external-change, tramp-test42-utf8)
(tramp-test43-file-system-info)
(tramp-test44-file-user-group-ids, tramp-test48-session-timeout)
(tramp-test49-external-backend-function)
(tramp-test50-recursive-load): Tag them as :expensive-test.  (Bug#80164)
2026-01-20 12:30:48 +01:00
Michael Albinus
31c07d873b ; Minor Tramp cleanup
* 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.
2026-01-19 12:28:18 +01:00
Michael Albinus
caeebd6a6d Suppress parallel make for filenotify-tests and tramp-tests
* test/Makefile.in (.NOTPARALLEL): Add lisp/filenotify-tests.log
and lisp/net/tramp-tests.log.  (Bug#80164)
2026-01-19 09:34:51 +01:00
Eli Zaretskii
e14e9eb70b ; Fix one of ispell-tests
* 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)
2026-01-18 22:15:18 +02:00
Sean Whitton
6e4bceb8ce Automatically detect the VC outgoing base (bug#80006)
* lisp/vc/vc-git.el (vc-git--current-branch): Rename to ...
(vc-git-working-branch): ... this.  All uses changed.
(vc-git-trunk-or-topic-p, vc-git-topic-outgoing-base):
* lisp/vc/vc-hg.el (vc-hg--working-branch, vc-hg-working-branch)
(vc-hg-trunk-or-topic-p, vc-hg-topic-outgoing-base):
* lisp/vc/vc-hooks.el (vc--safe-branch-regexps-p):
* lisp/vc/vc.el (vc-default-working-branch)
(vc-default-trunk-or-topic-p, vc--match-branch-name-regexps)
(vc--outgoing-base, vc--outgoing-base-mergebase)
(vc--maybe-read-outgoing-base): New functions.
(vc-diff-outgoing-base): Call vc--outgoing-base-mergebase.
(vc-root-diff-outgoing-base, vc-diff-outgoing-base): Use
vc--maybe-read-outgoing-base in interactive specification.
(working-branch, trunk-or-topic-p, topic-outgoing-base): New
specifications for backend functions.
(vc-trunk-branch-regexps, vc-topic-branch-regexps): New
variables.
* .dir-locals.el: Commented entries for the new variables.
* test/lisp/vc/vc-tests/vc-test-misc.el
(vc-test-match-branch-name-regexps): New test.
* doc/emacs/vc1-xtra.texi (Outstanding Changes): Document the
new functionality.
2026-01-17 17:17:51 +00:00
Jacob S. Gordon
bd96450a09 calc: Improve handling of invalid 'calc-string-maximum-character'
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.
2026-01-17 14:48:06 +02:00
Michael Albinus
ab77b4b60c New D-Bus functions to support systemd inhibitor locks
* 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.
2026-01-17 11:40:31 +01:00
Mattias Engdegård
256210477d ; * test/lisp/progmodes/eglot-tests.el (eglot--wait-for): escape $ 2026-01-14 19:56:14 +01:00
Sean Whitton
ad14c8d084 ; * test/lisp/vc/vc-tests/vc-tests.el: Fix authorship metadata. 2026-01-14 14:33:46 +00:00
Sean Whitton
aa6e42f18b Rename VC outgoing and incoming log commands to include "-root-"
* lisp/vc/vc.el (vc-log-incoming, vc-log-outgoing): Rename ...
(vc-root-log-incoming, vc-root-log-outgoing): ... to these.  All
uses changed.  Leave behind obsolete function aliases.
* lisp/emacs-lisp/package-vc.el (package-vc-log-incoming):
Rename ...
(package-vc-root-log-incoming): ... to this.  All uses changed.
Leave behind obsolete function alias.
2026-01-14 12:48:02 +00:00
Michael Albinus
5a1ced4b24 Call all registered D-Bus signal handlers
* 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.
2026-01-14 10:41:41 +01:00
Stefan Monnier
9dcf0bc428 Fix recent test suite regression (bug#80177)
* 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.
2026-01-11 18:26:53 -05:00
F. Jason Park
f740d033ae ; Don't use cl-letf with generic function in ERC test
* test/lisp/erc/erc-tests.el (erc--update-channel-modes): Use advice
instead.  See 058bac45 "cl-generic.el: Avoid an O(N^2)
behavior".  (Bug#80175)
* test/lisp/erc/resources/erc-d/erc-d-tests.el
(erc-d-tests--start-server): Increase timeout to hopefully address
anomalous EMBA failure.  Unrelated to cited bug.
2026-01-11 05:25:03 -08:00
F. Jason Park
c84aea1c1b Use seq-doseq for iterating over strings in ERC
* lisp/erc/erc-common.el (erc--doarray): Remove unused function.
* lisp/erc/erc.el (erc--channel-mode-types, erc--process-channel-modes)
(erc--parse-user-modes): Replace `erc--doarray' with `seq-doseq'.
* test/lisp/erc/erc-tests.el (erc--doarray): Remove test.
2026-01-11 05:25:03 -08:00
João Távora
67dd97a4f7 Eglot: solve misc Elisp compatibility problems on Emacs 26.3
* lisp/progmodes/eglot.el (eglot--semtok-request)
(eglot--semtok-after-send-changes): Unbreak for 26.3.

* test/lisp/progmodes/eglot-tests.el (eglot--tests-connect): Use
  split-string.
  (eglot-test-rust-completion-exit-function): Use skip-unless.
2026-01-11 13:15:27 +00:00
João Távora
a59fafde75 Eglot: don't use text-property-search-forward unavailable on 26.3
* lisp/progmodes/eglot.el (eglot--format-markup)
(eglot--semtok-font-lock-2): Rewrite.

* test/lisp/progmodes/eglot-tests.el (eglot--semtok-wait): Rewrite.
2026-01-11 13:15:27 +00:00
Michael Albinus
1bc8e61df4 Don't use "make -j" when running tests
* test/infra/gitlab-ci.yml (.job-template):
* test/README: Don't use "make -j".
2026-01-11 10:21:12 +01:00
João Távora
68de337f26 Eglot: improve diagnostics tests
* test/lisp/progmodes/eglot-tests.el
(eglot-test-basic-diagnostics): Robustify.
(eglot-test-basic-pull-diagnostics)
(eglot-test-basic-stream-diagnostics): New tests.
2026-01-11 03:42:01 +00:00
João Távora
189e39c52a Eglot: improve automated test machinery
* test/lisp/progmodes/eglot-tests.el
(eglot--wait-for): Fix thinkos and improve.
(eglot--tests-connect): Take TIMEOUT and SERVER kwargs.
(eglot-test-eclipse-connect)
(eglot-test-slow-sync-connection-wait)
(eglot-test-slow-sync-connection-intime): Update
eglot--tests-connect call.
2026-01-11 03:42:01 +00:00
Michael Albinus
d9cc684d10 * test/README: Specify, how to invoke "make". (Bug#80112) 2026-01-09 09:09:04 +01:00
Stefan Monnier
b5b7504c73 (package-test-install-single): Fix test failure
* test/lisp/emacs-lisp/package-tests.el (package-test-install-single):
We signal an error only for interactive calls now.
2026-01-07 10:58:27 -05:00
Stephen Gildea
ba6e702bff time-stamp-helper-string-used: New test
* test/lisp/time-stamp-tests.el (time-stamp-helper-string-used):
New test.
2026-01-05 15:23:01 -08:00
Manuel Giraud
06d3d97e74 ; Fix simple logic in OpenBSD's random test
* test/src/fns-tests.el (fns-tests-random): Do not test on OpenBSD
since either equal or not equal is a valid result here.  (Bug#80125)
2026-01-04 11:25:50 +02:00
Eli Zaretskii
4f2a8d81f8 ; * test/manual/etags/README: Update the procedure for CTAGS.good_update. 2026-01-03 11:30:45 +02:00
Eli Zaretskii
e5a6b2e262 ; Update CTAGS.good_update in etags tests for copyright year change. 2026-01-03 11:26:56 +02:00
Mattias Engdegård
791024dc8c Make string-trim faster
* lisp/subr.el (string-trim): Avoid intermediate substring allocation.
* test/lisp/subr-tests.el (subr-string-trim-left):
(subr-string-trim-right): Move here from subr-x-tests.el.
(subr-string-trim): New test.
2026-01-02 19:09:54 +01:00
João Távora
c6483b4c89 ; Eglot: unbreak tests after semtok face rename
* test/lisp/progmodes/eglot-tests.el (eglot-test-semtok-basic)
(eglot-test-semtok-refontify): Fix tests.
2026-01-02 09:25:36 +00:00
Sean Whitton
094e5f0928 ; Update ETAGS/CTAGS tests for copyright year change.
CTAGS.good_update not yet updated.
2026-01-01 13:23:21 +00:00
Sean Whitton
c31f6adc31 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
Philip Kaludercic
4771cd2e58
; Fix test resulting from 5744519e
* lisp/emacs-lisp/package.el (package-install): Delete dead code
resulting from previous change.
* test/lisp/emacs-lisp/package-tests.el
(package-test-install-single): Adjust code to expect
'user-error'
2026-01-01 13:47:41 +01:00
Dmitry Gutov
6c832af157 Allow project-vc-ignores to be applied in more cases
Discussed in
https://lists.gnu.org/archive/html/emacs-devel/2025-12/msg00903.html.

* lisp/progmodes/project.el (project-files) <vc>: Look up the
value of 'project-vc-ignores' inside DIR rather than project root.
This allows this variable to be applied in external dirs as well.
(project-ignores) <vc>: Do likewise.
(project--value-in-dir): Ensure that DIR has a trailing slash.
The caller might pass the value without slash if produced
differently.

* test/lisp/progmodes/project-tests.el
(project-vc-ignores-in-external-directory): New test.
(project-vc-supports-files-in-subdirectory): Update the test,
considering the subtle change in behavior: the directory DIR
directly includes a .dir-locals.el which sets project-vc-ignores,
which wasn't previously applied because it wasn't set in the root.
2026-01-01 04:13:30 +02:00