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.
Thuna [Wed, 12 Feb 2025 22:34:16 +0000 (23:34 +0100)]
Fix print-tests
* test/src/print-tests.el (terpri): Erase the buffer *terpri-test*
before individual runs. (Bug#72334)
(print-circle): Allow circular references with number greater than 9.
Mauro Aranda [Sat, 15 Feb 2025 12:26:46 +0000 (09:26 -0300)]
Fix comparison of current values for the key-sequence :type
* lisp/cus-edit.el (custom-variable-modified-p): Round-trip
the option value before comparing it against the widget's value.
This mostly fixes comparison against the obsolete key-sequence
widget, but could fix other corner cases, when the widget
accepts different types as values. (Bug#76156)
* test/lisp/cus-edit-tests.el (cus-edit-test-bug76156)
(cus-edit-test-bug76156-2): New test options.
(cus-edit-test-unedited-option): New test.
Add support for fontifying the following grammar-elements:
- image-declarations (image-name, image-tag & image alias)
- strings in more general terms
- string-expansion statements
- treat path-values as strings
- identifiers names for ENV and ARG statements
- argument values for ENV and ARG statements
* lisp/progmodes/dockerfile-ts-mode.el (dockerfile-ts-mode)
(dockerfile-ts-mode--font-lock-settings): Improve fontification.
(Bug#76481)
Stefan Kangas [Sat, 22 Feb 2025 16:32:31 +0000 (17:32 +0100)]
New macros incf and decf
* lisp/emacs-lisp/cl-lib.el (cl-incf, cl-decf): Move macros from here...
* lisp/emacs-lisp/gv.el (incf, decf): ...to here. Make old names into
aliases, documented as deprecated.
* lisp/obsolete/cl.el: Don't alias incf and decf.
* doc/lispref/variables.texi (Multisession Variables):
* doc/misc/cl.texi (Organization, Modify Macros, Modify Macros)
(Modify Macros, Macro Bindings, For Clauses, Property Lists)
(Structures, Efficiency Concerns, Obsolete Setf Customization): Delete
cl-incf and cl-decf documentation, moving any relevant parts to lispref.
Delete some parts that seem to primarily regard implementation details
that do not warrant inclusion in lispref. Update all examples to use
incf/decf.
Mauro Aranda [Sat, 22 Feb 2025 21:31:40 +0000 (18:31 -0300)]
Fix last commit to wid-edit.el
* lisp/wid-edit.el (widget-editable-list-entry-create): Don't
use save-excursion when indenting. Previously, it was needed
because we inserted the :entry-format string, but we don't do
that anymore. (Bug#53606)
Stefan Kangas [Sat, 22 Feb 2025 16:18:01 +0000 (17:18 +0100)]
; Delete obsolete commented out parts from cl.texi
* doc/misc/cl.texi (Modify Macros, Obsolete Setf Customization): Delete
commented out documentation that is no longer true, and documentation of
a function that was removed in Emacs 24.3.
shipmints [Thu, 13 Feb 2025 13:10:45 +0000 (08:10 -0500)]
Inhibit "Wrote" message in saveplace.el when non-interactive
* lisp/saveplace.el (save-place-alist-to-file): Tell 'write-region'
to be quiet when called non-interactively. This is in harmony with
'savehist-save'. (Bug#76267)
Visuwesh [Thu, 13 Feb 2025 11:13:06 +0000 (16:43 +0530)]
Make yank-media auto select the best mime type
* lisp/yank-media.el (yank-media-preferred-types): Add new
variable that holds the list of mime types in order of their
preference.
(yank-media-autoselect-function): Add new variable and function
to choose the most preferred media type.
(yank-media): Make 'yank-media' choose the most preferred mime
type by default.
* doc/emacs/killing.texi (Clipboard):
* doc/lispref/frames.texi (Yanking Media): Document the new
behaviour, and the new variables.
* etc/NEWS: Announce the change. (Bug#75116)
Mauro Aranda [Thu, 6 Feb 2025 11:01:08 +0000 (08:01 -0300)]
Speed up widget creation (Bug#53606)
* lisp/wid-edit.el (widget-default-create, widget-checklist-add-item)
(widget-radio-add-item, widget-editable-list-entry-create): Don't
insert format escapes into the buffer, only to delete them after.
This avoids calls to delete-char and makes widget creation about 3
times faster.
F. Jason Park [Sat, 15 Feb 2025 02:57:41 +0000 (18:57 -0800)]
Use .pem extension for client certs in ERC docs
* doc/misc/erc.texi (Connecting): Change file-name extensions to .pem in
all examples, and explain that the key and the cert can be combined into
one file.
(SASL): Use .pem extension for certs.
* lisp/erc/erc.el (erc--warn-once-before-connect): Revise doc.
(erc-tls): Use .pem extension for certs. (Bug#76278)
Stefan Kangas [Fri, 21 Feb 2025 17:48:12 +0000 (18:48 +0100)]
Delete note on Emacs 19 modes from comint.el
* lisp/comint.el: Delete note on how to convert pre-Emacs 20 modes to
use comint.el. Emacs 20 was released in 1997, so it's safe to assume
that any relevant code has been updated in the last three decades.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--indent-rules): Fix
indentation for using statements and multiline lambdas. (Bug#75883)
Patch based on bug report by Dino Chiesa <dpchiesa@hotmail.com>.
Stefan Kangas [Fri, 21 Feb 2025 16:40:12 +0000 (17:40 +0100)]
New user option checkdoc-allow-quoting-nil-and-t
* lisp/emacs-lisp/checkdoc.el (checkdoc-allow-quoting-nil-and-t):
New user option that allows turning off the warning for having nil
and t in quotes.
(checkdoc-this-string-valid-engine): Use above new option.
Michael Albinus [Fri, 21 Feb 2025 13:47:15 +0000 (14:47 +0100)]
Use a persistent directory as default directory in diff
* lisp/vc/diff.el (diff-no-select): Use `temporary-file-directory'
as default directory. Set default file permissions temporarily to
#o600. (Bug#69606)
Juri Linkov [Fri, 21 Feb 2025 07:55:54 +0000 (09:55 +0200)]
New variable 'treesit-aggregated-outline-predicate' (bug#76398)
* doc/lispref/modes.texi (Outline Minor Mode):
Add 'treesit-aggregated-outline-predicate'.
* lisp/treesit.el (treesit-aggregated-outline-predicate):
New buffer-local variable.
(treesit-outline--at-point):
Use 'treesit-aggregated-outline-predicate'.
(treesit-closest-parser-boundary): New function.
(treesit-outline-search): Use 'treesit-aggregated-outline-predicate'
and 'treesit-closest-parser-boundary'.
(treesit-outline-level): Use 'treesit-aggregated-outline-predicate'.
(treesit-major-mode-setup): Add 'treesit-aggregated-outline-predicate'.