Commit graph

174255 commits

Author SHA1 Message Date
Stephen Berman
d509a35699 Fix regression in widget-move (bug#72995)
* lisp/wid-edit.el (widget-move): Avoid advancing point only if it
is at the start of a widget at BOB.

* test/lisp/wid-edit-tests.el (widget-test-widget-move-bug72995): New test.
2024-09-14 12:42:49 +02:00
Eli Zaretskii
ef0276de82 ; * lisp/cus-edit.el (setopt): Doc fix. (Bug#73098) 2024-09-14 12:33:36 +03:00
Eli Zaretskii
b115c2d5eb ; * lisp/minibuffer.el (completion-pcm--merge-completions): Fix comments. 2024-09-14 12:26:54 +03:00
Spencer Baugh
3cda1fdc3b Correctly include fixed strings before a prefix wildcard in PCM
In 03ac16ece4 I fixed a bug with the
PCM implementation of substring completion, relating to the handling
of PCM wildcards.
However, this fix was incomplete.  This change completes the fix by
also including a fixed string if it appears before a 'prefix'
wildcard, even if 'try-completion' doesn't discover that fixed
string grows to a unique completion.
I discovered this bug while working on enhancements to PCM
completion related to 'completion-pcm-leading-wildcard'.
* lisp/minibuffer.el (completion-pcm--merge-completions): Include
fixed strings before 'prefix wildcard.  (Bug#72819)
* test/lisp/minibuffer-tests.el (completion-substring-test-5): Add a
test for this behavior.
2024-09-14 12:24:08 +03:00
Eli Zaretskii
57d93d0259 ; * lisp/treesit.el (treesit-major-mode-setup): Doc fix. 2024-09-14 12:02:56 +03:00
Eli Zaretskii
ad289f364e ; Improve documentation of 'easy-menu-define'
* doc/lispref/keymaps.texi (Easy Menu):
* lisp/emacs-lisp/easymenu.el (easy-menu-define): Document that
SYMBOL is also defined as a variable.  (Bug#73108)
2024-09-14 11:55:08 +03:00
Yuan Fu
3cad7cc8dc
Set treesit-primary-parser for c and elixir ts mode
For buffers with multiple parsers, it's important to set this variable
so font-lock invalidation works smoothly.

* lisp/progmodes/c-ts-mode.el (c-ts-mode): Set treesit-primary-parser.
* lisp/progmodes/elixir-ts-mode.el (elixir-ts-mode): Set
treesit-primary-parser.
2024-09-14 00:46:05 -07:00
Yuan Fu
2f243fb91d
; Minor doc fix in treesit.el
* lisp/treesit.el (treesit-outline-search): Mention parameters.
(treesit-major-mode-setup): Mention outline setup.
2024-09-14 00:28:23 -07:00
Yuan Fu
6a6d7925c9
Fix range handling so it works for multibyte buffer (bug#73204)
Here by multibyte buffer I mean buffer that includes non-ASCII
characters.

The problem is illustrated by this comment, which I copied from the
source:

======================================================================
(ref:bytepos-range-pitfall) Suppose we have the following buffer
content ([ ] is a unibyte char, [    ] is a multibyte char):

    [a][b][c][d][e][ f  ]

and the following ranges (denoted by braces):

    [a][b][c][d][e][ f  ]
    {       }{    }

So far so good, now user deletes a unibyte char at the beginning:

    [b][c][d][e][ f  ]
    {       }{    }

Oops, now our range cuts into the multibyte char, bad!
======================================================================

* src/treesit.c (treesit_debug_print_parser_list): Minor fix.
(treesit_sync_visible_region): Change the way we fixup ranges, instead
of using the bytepos ranges from tree-sitter, we use the cached lisp
charpos ranges.
(treesit_make_ts_ranges): New function.
(Ftreesit_parser_set_included_ranges): Refactor out the new function
treesit_make_ts_ranges.
(Ftreesit_parser_included_ranges): Rather than getting the ranges from
tree-sitter, just return the cached lisp ranges.

* src/treesit.h (Lisp_TS_Parser): Add some comment.
* test/src/treesit-tests.el (treesit-range-fixup-after-edit): New test.
2024-09-14 00:28:23 -07:00
Yuan Fu
76faf7e609
Revert "Read more on each call to treesit's buffer reader"
This reverts commit bf23382f1f.

We move around the gap, narrow regions, ralloc, etc, and don't have a
way to invalidate previously given range.  So tree-sitter can't be given
the full range.
2024-09-14 00:28:23 -07:00
Yuan Fu
c70bd0e3fe
Fix tree-sitter indent preset prev-adaptive-prefix
* lisp/treesit.el (treesit-simple-indent-presets): Use looking-at so the
call to match-string has the match data to work with.
2024-09-14 00:28:22 -07:00
Eli Zaretskii
272df33fb8 ; * CONTRIBUTE: Minor copyedits. 2024-09-14 09:52:59 +03:00
Robert Pluim
8e1187e336 Improve NEWS entries
* etc/NEWS: Fix typos, and add information about default values of new
  user options.
2024-09-13 15:42:39 +02:00
Mattias Engdegård
ca3932121a Don't fail uniquify-tests in non-version-controlled source trees
* test/lisp/uniquify-tests.el (uniquify-project-transform):
Skip test if there is no project (bug#73205).
2024-09-13 12:17:17 +02:00
Robert Pluim
79f68597ab ; * etc/ORG-NEWS: Fix typo. 2024-09-13 09:50:01 +02:00
Stefan Kangas
d66b70f360 * doc/misc/auth.texi: Minor copy edits. 2024-09-13 00:18:37 +02:00
Stefan Kangas
2c6b7b2da9 ; * admin/MAINTAINERS: Remove some entries for Artur Malabarba.
Change agreed with Artur Malabarba <arturmalabarba@gmail.com>.
2024-09-12 23:01:08 +02:00
Po Lu
11e7ae3964 Fix bug#72254
* src/pgtkselect.c (Fpgtk_get_selection_internal): If requesting
TARGETS with just one result, return it as a vector.
(bug#72254)
2024-09-12 08:23:13 +08:00
Andrea Corallo
9a1c76bf7f Bump Emacs version to 30.0.91
* nt/README.W32: Update Emacs version.
* msdos/sed2v2.inp: Likewise.
* exec/configure.ac: Likewise.
* configure.ac: Likewise.
* README: Likewise.
2024-09-11 22:14:09 +02:00
Andrea Corallo
68530860ae ; * ChangeLog.4: Update. 2024-09-11 21:52:56 +02:00
Andrea Corallo
fb1db366b9 ; * etc/AUTHORS: Update. 2024-09-11 21:49:52 +02:00
Po Lu
ee3e3a6311 ; Update version number of exec/configure.ac
* admin/admin.el (set-version): Update AC_INIT expansion in
exec/configure.ac.

* exec/configure.ac: Update version to 30.0.90.
2024-09-11 13:18:35 +08:00
Yuan Fu
c5925b6ba5
Fix heex-ts-mode indentation following previews elixir-mode change
After the previous fix in elixir-ts-mode (0fd259d166), embedded heex
code are indented like this:

1 defmodule Foo do
2   def foo(assigns) do
3     ~H"""
4 <span>
5   text
6 </span>
7     """
8   end
9 end

The indent rule finds the beginning of the parent heex node, and uses
the indentation of that line as anchor with an offset of 0.  Previously
the parent heex node (fragment) starts at EOL of line 3; after the
previous commit, it now starts at BOL of line 4.  To fix the
indentation, I changed the anchor to the beginning of the elixir
(rather than heex) node at point, which is at EOL at line 3.

* lisp/progmodes/heex-ts-mode.el (heex-ts--indent-rules): Use the elixir
node that contains the heex code as the anchor, instead of the heex root
node.
2024-09-10 20:07:20 -07:00
Andrea Corallo
c3383be5f0 ; * admin/make-tarball.txt: Improve last change. 2024-09-11 00:44:11 +02:00
Andrea Corallo
8ddb54117f ; * admin/make-tarball.txt: Remove now unnecessary configure flag. 2024-09-11 00:41:17 +02:00
Andrea Corallo
7e194d33f9 * lisp/ldefs-boot.el: Update. 2024-09-10 23:39:34 +02:00
Eli Zaretskii
9019536ea6 Fix use of Uniscribe font driver in MinGW build
This was inadvertently broken when Windows 9X support was
fixed in June 2024.
* src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper): Set
'uniscribe_available' non-zero in non-Cygwin builds.  (Bug#73159)
2024-09-10 15:14:47 +03:00
Eli Zaretskii
5c55c860db Avoid crashes in redisplay in batch-mode testing
* src/xdisp.c (try_window_id): Don't crash for "initial" frame.
(Bug#72765)
2024-09-10 14:43:52 +03:00
Michael Albinus
ba2190e1ae ; * etc/NEWS: Fix indentation. 2024-09-10 09:24:33 +02:00
Dmitry Gutov
818c0cc9a5 eglot-test-rust-completion-exit-function: Fix failure in -Q session
* test/lisp/progmodes/eglot-tests.el (eglot--call-with-fixture):
Check for buffer liveness (https://debbugs.gnu.org/72765#29).
(eglot-test-rust-completion-exit-function): Don't expect snippet
expansion to happen (no yasnippet in batch mode).
2024-09-10 04:36:34 +03:00
Mattias Engdegård
f47297782b ; * doc/lispref/searching.texi (Rx Notation): Simplify rx example 2024-09-09 15:22:32 +02:00
Eli Zaretskii
03e5698167 Clarify the semantics of 'string-pixel-width'
* doc/lispref/display.texi (Size of Displayed Text):
* lisp/emacs-lisp/subr-x.el (string-pixel-width):
* src/xdisp.c (Fwindow_text_pixel_size, Fbuffer_text_pixel_size):
Doc fixes.  (Bug#73129)
2024-09-09 14:28:12 +03:00
Eli Zaretskii
9f0603207b ; * src/treesit.c: Minor cleanups of recent changes. 2024-09-09 14:03:15 +03:00
Andrea Corallo
e0d3f74395 * src/treesit.c (treesit_debug_print_parser_list): Fix format string. 2024-09-09 09:09:48 +02:00
Yuan Fu
bed38ded73
; * src/treesit.c (treesit_debug_print_parser_list): Fix formatting. 2024-09-08 21:14:00 -07:00
Yuan Fu
18c6487dbd
; * src/treesit.c: Add a prototype so there's no warning about it. 2024-09-08 21:04:29 -07:00
Yuan Fu
bf23382f1f
Read more on each call to treesit's buffer reader
* src/treesit.c (treesit_read_buffer): Read until the gap or visible
end, instead of reading a single char.
2024-09-08 20:52:20 -07:00
Yuan Fu
3435464452
Fix the range handling in treesit.c
1. In treesit_sync_visible_region, reduce the ranges for a parser so it
doesn't go beyond the visible range.

2. To avoid possible infinite recursion, add a within_reparse field to
parsers.  Previously we were using the need_reparse field to avoid
infinite recursion, but lisp programs in a parser's after change hook
might make some buffer edit which turns need_reparse to true. To avoid
that, we now use an explicit field.  If a parser's after change function
makes a buffer edit, lisp program ends up with a desynced parse tree,
but that's better than possible infinite recursion.  Also after change
function shouldn't edit the buffer.

3. In treesit_make_ranges, use parser's visible_beg instead of buffer's
BEGV.  I mean technically whenever we make ranges, buffer's BEGV should
be equal to parser's visible_beg, but better not take that uncertainty,
also makes the code more readable.

4. In Ftreesit_parser_included_ranges, move visible region sync code
before the body of the function.

* src/treesit.c (treesit_sync_visible_region): Minimally fix ranges so
it doesn't exceed parser's visible range.
(treesit_call_after_change_functions): Update calling sigature to
treesit_make_ranges.
(treesit_ensure_parsed, make_treesit_parser): Use the new field
within_reparse.
(treesit_make_ranges): Use parser's visible_beg instead of buffer's
BEGV.
(Ftreesit_parser_included_ranges): Move visible region check before
function body.
* src/treesit.h (Lisp_TS_Parser): Add new field within_reparse.
2024-09-08 20:52:20 -07:00
Yuan Fu
3fcec09f75
Add debugging function for treesit.c
* src/treesit.c (treesit_debug_print_parser_list): New function.
2024-09-08 20:52:20 -07:00
Yuan Fu
0fd259d166
Fix elixir-ts-mode's range query
* lisp/progmodes/elixir-ts-mode.el:
(elixir-ts--treesit-range-rules): Add underscore in front of the name
capture, so Emacs won't put heex parser on it.
2024-09-08 20:52:20 -07:00
Dmitry Gutov
2329b36b1f ; project-files-relative-names: Update docstring (bug#72701) 2024-09-09 00:00:45 +03:00
Mattias Engdegård
e55e2e1c6b Make json-serialize always return a unibyte string (bug#70007)
The JSON format is defined as a byte sequence and will always be used as
such, so returning a multibyte string makes little sense.

* src/json.c (json_out_to_string): Remove.
(Fjson_serialize): Return unibyte string.
* test/src/json-tests.el (json-serialize/roundtrip)
(json-serialize/roundtrip-scalars, json-serialize/string):
Update tests.
* doc/lispref/text.texi (Parsing JSON): Document.
* etc/NEWS: Announce.
2024-09-08 20:02:34 +02:00
Eli Zaretskii
89c99891b2 ; * doc/lispref/os.texi (Suspending Emacs): Fix last change. 2024-09-07 19:41:36 +03:00
Eli Zaretskii
4f044d0d3d ; Improve documentation of 'suspend-emacs'
* doc/lispref/os.texi (Suspending Emacs):
* src/keyboard.c (Fsuspend_emacs): Document possible failures
in sending STUFFSTRING to the shell.  (Bug#73100).
2024-09-07 18:38:40 +03:00
Eli Zaretskii
b420e149b1 Fix a typo in ediff-init.el
* lisp/vc/ediff-init.el (ediff-nonempty-string-p): Fix typo.
Reported by Jurgen De Backer
<jurgen.de-backer.ext@eurocontrol.int> (bug#73042).
2024-09-07 12:41:29 +03:00
Eli Zaretskii
e1304e9b1b Fix 'chart-space-usage' on MS-Windows
* lisp/emacs-lisp/chart.el (chart--file-size)
(chart--directory-size): New functions.
(chart-space-usage): Invoke 'du' correctly on MS-Windows.  Provide
alternative implementation in Lisp when 'du' is not installed,
using 'chart--directory-size' and 'chart--file-size'.  (Bug#72919)
2024-09-07 12:17:24 +03:00
Eli Zaretskii
04c44405bf Fix alignment and documentation of vtable.el
* lisp/emacs-lisp/vtable.el (vtable--insert-header-line): Ensure
proper alignment between the columns in header-line and in the
body of the table.  (Bug#73032)

* doc/misc/vtable.texi (Making A Table): Document the defaults of
the various keyword parameters.
2024-09-07 11:27:03 +03:00
Eli Zaretskii
4d6fadb8d2 ; * lisp/which-key.el: Fix ':package-version' (bug#73072). 2024-09-06 19:02:50 +03:00
Eli Zaretskii
54071b9cef ; Improve doc strings of 'tab-bar-mode' and 'tab-line-mode'
* lisp/tab-line.el (tab-line-mode):
* lisp/tab-bar.el (tab-bar-mode): Doc fixes (bug#73049)
2024-09-05 22:09:40 +03:00
Ulrich Müller
87a8b12a0c Fix test failure in erc-networks-tests
* test/lisp/erc/erc-networks-tests.el
(erc-networks--id-sort-buffers): Make sure that buffers have
different timestamps.  (Bug#73036)
2024-09-05 10:19:45 +02:00