Mauro Aranda [Wed, 26 Feb 2025 11:06:14 +0000 (08:06 -0300)]
Avoid display bugs after editable-field widgets
* lisp/wid-edit.el (widget-specify-button): Don't add an
invisible space before the button to avoid bugs that surface
with the widget-field face. The Widget library is not
the one that puts a :box attribute for the button face, and we
can't control what library users put after editable-field
widgets.
(widget-specify-field): Rather, add the invisible space here,
after the newline. That way, we protect whatever comes after
the editable-field widget. (Bug#51550)
Eshel Yaron [Wed, 26 Feb 2025 19:41:09 +0000 (20:41 +0100)]
Add 'help-echo' hint to completion preview
* lisp/completion-preview.el
(completion-preview--propertize-for-mouse): New function.
* lisp/completion-preview.el (completion-preview--update)
(completion-preview--show)
(completion-preview-partial-insert)
(completion-preview-complete)
(completion-preview-next-candidate): Use it to propertize
completion preview text with mouse-related properties,
including a new 'help-echo' hint.
* lisp/completion-preview.el (completion-preview-insert)
(completion-preview-insert-word)
(completion-preview-insert-sexp)
(completion-preview-complete)
(completion-preview-prev-candidate)
(completion-preview-next-candidate): Use 'interactive' to
associate command with 'completion-preview-active-mode'
instead of using a bespoke 'completion-predicate' property.
(completion-preview-active-p): Declare obsolete.
Stefan Kangas [Wed, 26 Feb 2025 05:37:52 +0000 (06:37 +0100)]
Make define-global-minor-mode alias obsolete
* lisp/emacs-lisp/easy-mmode.el (define-global-minor-mode): Make alias
for old name obsolete, just in time for its 20th anniversary.
* test/lisp/emacs-lisp/lisp-mode-tests.el (test-font-lock-keywords):
* lisp/progmodes/subword.el (global-subword-mode)
(global-superword-mode): Don't use above obsolete name.
* lisp/emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression)
(lisp-fdefs): Remove syntax highlighting for obsolete name.
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Add comment mentioning the obsolete status of above alias.
* doc/lispref/loading.texi (Autoload): Don't document obsolete name.
Stefan Kangas [Wed, 26 Feb 2025 03:36:51 +0000 (04:36 +0100)]
Don't enable minor modes in diff-add-log-current-defuns
* lisp/vc/diff-mode.el (diff-add-log-current-defuns): Don't run mode
hooks when enabling major mode hooks. That fails if, for example,
paredit-mode is on emacs-lisp-mode-hook and it signaled due to
unbalanced parens.
* test/lisp/emacs-lisp/rmc-tests.el
(test-rmc--add-key-description)
(test-rmc--add-key-description/with-attributes)
(test-rmc--add-key-description/non-graphical-display)
(test-read-multiple-choice, test-read-multiple-choice-help):
Skip on Android in some wise or another.
Po Lu [Wed, 26 Feb 2025 02:35:00 +0000 (10:35 +0800)]
; Improve Android testing facilities
* test/infra/android/test-controller.el (ats-eval): Don't block
other processes.
(ats-run-test): Bind ert-remote-temporary-file-directory to nil
and always print messages into the output buffer.
(ats-upload-all-tests): New function.
(ats-run-all-tests): New argument SELECTOR. Only execute
already uploaded tests.
Po Lu [Wed, 26 Feb 2025 02:33:30 +0000 (10:33 +0800)]
Enable auto-revert-tests to pass on Android
* lisp/emacs-lisp/ert-x.el
(ert-remote-temporary-file-directory): Define to null-device on
Android.
* test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file): Provide for
situations where the watch descriptor is recreated by the
polling timer after a file notification is received.
Po Lu [Wed, 26 Feb 2025 01:56:46 +0000 (09:56 +0800)]
Guarantee delivery of inotify special events
* src/inotify.c (inotifyevent_to_event): Always match events
that are not encompassed by IN_ALL_EVENTS and which the
documentation implies are always delivered to callbacks.
* test/src/inotify-tests.el (inotify-file-watch-stop-delivery):
New test.
Po Lu [Tue, 25 Feb 2025 14:34:43 +0000 (22:34 +0800)]
Implement commands for executing all tests on connected Android devices
* test/infra/android/test-controller.el (ats-upload-test):
Correct minor encoding error. Transfer solitary files without
creating a tar archive, and handle `resources' directories.
(ats-list-tests-locally, ats-list-tests): Don't list files in
`resources' directories. Insert test header locally, and
redisplay after insertion.
(ats-run-all-tests): New function.
Po Lu [Tue, 25 Feb 2025 11:12:06 +0000 (19:12 +0800)]
; Improve Android regression test execution facilities
* test/infra/android/test-controller.el
(ats-associated-process): New variable.
(ats-start-server): Set coding system to `no-conversion'.
(ats-read-connection): If this buffer is associated with a
connection, return the same.
(ats-establish-connection): New arg INTERACTIVE. Interactively,
open a Lisp interaction buffer with this connection as its
associated process.
(ats-connect): Provide this argument if called interactively.
(ats-eval): New argument RAW. Request that encoded forms not be
decoded if specified, and decode results.
(ats-remote-eval-defuns, ats-remote-eval-print-sexp)
(ats-remote-eval-for-interaction)
(ats-remote-eval-print-last-sexp, ats-remote-eval-last-sexp)
(ats-remote-eval-defun, ats-remote-eval-region-or-buffer)
(ats-lisp-interaction-mode-map, ats-lisp-interaction-mode-menu)
(ats-lisp-interaction-mode, ats-open-lisp-interaction-buffer)
(ats-emacs-test-directory, ats-upload-test)
(ats-list-tests-locally, ats-list-tests, ats-run-test): New
functions and variables.
* test/infra/android/test-driver.el (ats-eval-do-decode): New
variable.
(ats-process-filter, ats-establish-connection)
(ats-initiate-connection): Adjust correspondingly.
* lisp/net/tramp-cmds.el:
(tramp-list-remote-buffer-connections): New function.
(tramp-cleanup-bufferless-connections): New command.
(tramp-list-remote-buffers): Account for 'buffer-file-name'.
Stefan Kangas [Mon, 24 Feb 2025 23:12:00 +0000 (00:12 +0100)]
Make cl-gensym obsolete in favor of built-in gensym
* lisp/emacs-lisp/cl-macs.el (cl-gensym): Declare function
obsolete in favor of gensym, added in Emacs 26.1. The only reason
for its existence is that it allows an integer argument, but
that's not really useful, so it's better to remove this complexity.
Ref: https://lists.gnu.org/r/emacs-devel/2017-09/msg00313.html
* doc/misc/cl.texi (Symbols, Creating Symbols, Efficiency Concerns)
(Obsolete Setf Customization): Don't document above obsolete function.
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause):
* lisp/emacs-lisp/edebug.el (edebug-make-form-wrapper):
* lisp/obsolete/cl.el (cl--function-convert, lexical-let):
* lisp/obsolete/thumbs.el (thumbs-temp-file):
* lisp/progmodes/eglot.el (eglot--lambda)
(eglot--when-live-buffer, eglot--when-buffer-window)
(eglot--collecting-xrefs, eglot--glob-parse):
* lisp/progmodes/flymake.el (flymake--run-backend):
* test/lisp/emacs-lisp/package-tests.el (with-package-test):
* test/lisp/progmodes/eglot-tests.el (eglot--guessing-contact):
* test/lisp/progmodes/elisp-mode-tests.el
(elisp-shorthand-read-buffer, elisp-shorthand-read-from-string): Prefer
plain gensym to cl-gensym in files that can depend on Emacs 26.1.
* lisp/jsonrpc.el (jsonrpc-lambda, jsonrpc-request): Prefer gensym to
cl-gensym only when defined, as this file supports Emacs 25.1
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-lib-test-gensym): Simplify
test as 'should' no longer uses cl-gensym.
João Távora [Sun, 16 Feb 2025 18:27:48 +0000 (18:27 +0000)]
Eglot: use eglot-advertise-cancellation in more situations
The async requests frequently issued by ElDoc are a significant
source of request pile-up on the server side (for some servers).
With this change, Eglot will issue additional LSP
$/cancelRequest notifications for in-flight requests of certain
kinds in the pre-command hook.
This required a small change to the 'jsonrpc-async-request'
entrypoint.
This feature is experimental.
* lisp/jsonrpc.el (jsonrpc-async-request): No longer returns nil.
* lisp/progmodes/eglot.el (eglot--inflight-async-requests): New variable.
(eglot--cancel-inflight-async-requests): New function.
(eglot--async-request): New function.
(eglot--pre-command-hook): Call eglot--cancel-inflight-async-requests.
(eglot-signature-eldoc-function, eglot-hover-eldoc-function)
(eglot-highlight-eldoc-function, eglot-code-action-suggestion):
Use eglot--async-request.
Mauro Aranda [Mon, 24 Feb 2025 22:39:43 +0000 (19:39 -0300)]
Fix bad fontification of inactive widgets
* lisp/wid-edit.el (widget-specify-inactive): When a widget is
already inactive, still move the overlay to the desired
positions. Improve docstring. (Bug#69941)
* doc/misc/widget.texi (default): Document the need to call the
:deactivate function when modifying an inactive widget.
* test/lisp/wid-edit-tests.el
(widget-test-modification-of-inactive-widget): New test
Stefan Kangas [Mon, 24 Feb 2025 17:54:23 +0000 (18:54 +0100)]
Support selecting buffer in ert-with-test-buffer
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer): Add new keyword
argument :selected to make the buffer current and selected.
(ert-with-test-buffer-selected): Make obsolete and redefine in
terms of ert-with-test-buffer.
* doc/misc/ert.texi (Helper Functions): Document above new
:selected keyword argument, and remove documentation of
ert-with-test-buffer-selected.
Juri Linkov [Mon, 24 Feb 2025 17:51:13 +0000 (19:51 +0200)]
Better support for nil enable-local-variables in vc-find-revision-no-save
* lisp/vc/diff-mode.el (diff-syntax-fontify-props):
* lisp/vc/vc.el (vc-find-revision-no-save):
Use enable-local-variables as is only when it's one of these values:
:safe, :all, or nil. Otherwise, for all remaining values that query,
use :safe. Also use non-nil 'find-file' arg of 'normal-mode'.
https://lists.gnu.org/archive/html/emacs-devel/2025-02/msg00897.html
Martin Rudalics [Mon, 24 Feb 2025 09:17:10 +0000 (10:17 +0100)]
Optionally have 'display-buffer' reuse windows of indirect buffers
* lisp/window.el (window-indirect-buffer-p): New function.
(get-buffer-window-list): New argument INDIRECT.
(display-buffer-reuse-window): New alist entry 'reuse-indirect'
to reuse a window indirectly related to the BUFFER argument.
* doc/lispref/windows.texi (Buffers and Windows): Describe new
function 'window-indirect-buffer-p' and new argument INDIRECT of
'get-buffer-window-list'.
(Buffer Display Action Functions): Describe new action alist
entry 'reuse-indirect'.
* etc/NEWS: Announce new argument for 'get-buffer-window-list' and
new 'display-buffer' action alist entry 'reuse-indirect'.
Stefan Monnier [Sun, 23 Feb 2025 05:29:49 +0000 (00:29 -0500)]
(Ftranspose_regions): Fix text-properties for len1==len2
When `len1_byte == len2_byte`, the code presumed that len1==len2
as well in its handling of text-properties. Fix that case.
While at it, try and reduce code duplication by hoisting common
code out of `if`s, and throw away the optimization for `len_mid == 0`
which only saved 3 trivial function calls.
* src/editfns.c (Ftranspose_regions): Shuffle the code a bit.
* test/src/editfns-tests.el (editfns-tests--transpose-equal-but-not):
New test.
Martin Rudalics [Sun, 23 Feb 2025 10:01:20 +0000 (11:01 +0100)]
Optionally inhibit implied resizing while frame is made (Bug#76275)
* src/frame.c (frame_inhibit_resize): Handle new value 'force'
for 'frame-inhibit-implied-resize' (Bug#76275).
(frame_inhibit_implied_resize): New value 'force' to inhibit
implied resizing while a new frame is made.
* lisp/cus-start.el (frame-inhibit-implied-resize): Make new
value 'force' customizable.
* doc/lispref/frames.texi (Implied Frame Resizing): Describe new
value 'force' of 'frame-inhibit-implied-resize'.
* etc/NEWS: Announce new value 'force' of
'frame-inhibit-implied-resize'.
Michael Albinus [Sun, 23 Feb 2025 09:47:58 +0000 (10:47 +0100)]
Tramp: Improve doc of ad-hoc multi-hop file names
* doc/misc/tramp.texi (Ad-hoc multi-hops, Frequently Asked Questions):
Improve description how ad-hoc multi-hop file names can be made
persistent. (Bug#65039, Bug#76457)
Gerd Möllmann [Sun, 23 Feb 2025 04:07:55 +0000 (05:07 +0100)]
Enforce redisplay when deleting a child frame (bug#76406)
* src/term.c (tty_free_frame_resources): When deleting a child mark its
root frame to garbaged.
* src/dispnew.c (prepare_desired_root_row): Add a check for GLYPH_DEBUG.
Paul Eggert [Sun, 23 Feb 2025 06:53:52 +0000 (23:53 -0700)]
Revert “Pacify GCC in pgtkselect malloc alignment”
Problem reported by the wurfkreuz (Bug#76414).
* src/pgtkselect.c: Revert my commit ff65cc9944dc0b37986d512ee8b9817c6913db36 dated Sun Jan 26 22:15:49
2025 -0800 for now. I may come up with a better commit later.
Stefan Kangas [Sun, 23 Feb 2025 03:04:24 +0000 (04:04 +0100)]
Mark kermit.el as obsolete
While Kermit is still developed, this Emacs support library is
essentially unchanged since it was added to Emacs, which seems to have
been in 1988. It is also based on the old pre-Emacs 20 shell mode, so
it's not clear if it even works, and much less if it is relevant with
Kermit from this century.
There is also this modern alternative, from 1994, which seems far
more complete: https://www.kermitproject.org/archive.html#emacs
The bug tracker has stayed silent, so if anyone is still using it, they
will have to report a bug and ask us to unobsolete it.
* lisp/obsolete/kermit.el: Add Obsolete-since header. Add link to
alternative library at kermitproject.org.