Subject: bug#77746: [PATCH] sh-mode: Fix incorrect word syntax for punctuation in sh-mode

From: Eli Zaretskii <[email-masked]>
Date: Tue, 15 Apr 2025 21:25:13 +0300

> Date: Tue, 15 Apr 2025 12:22:08 -0400
> Cc: [email-masked], [email-masked]
> From: James Cherti <[email-masked]>
> 
> On 2025-04-15 11:24, Eli Zaretskii wrote:
>  >> From: Stefan Monnier <[email-masked]>
>  >> Cc: James Cherti <[email-masked]>,  [email-masked],
>  >>    [email-masked]
>  >> Date: Tue, 15 Apr 2025 11:17:02 -0400
>  >>
>  >>>> The issue occurs in both sh-mode and bash-ts-mode.
>  >>> I'm surprised that bash-ts-mode should use syntax tables, instead of
>  >>> relying on the results of parsing by tree-sitter.
>  >>
>  >> It's not front-and-center in his bug report, but what he means by
>  >> "completion" seems to be mostly dabbrev completion, which doesn't make
>  >> use of tree-sitter.
>  >
>  > He also mentioned font-lock.
> 
> Yes, this patch fixes dabbrev, functions such as
> (highlight-symbol-at-point), and any other function that
> relies on thing-at-point for symbol detection.
> 
> (The core issue is inaccurate symbol detection. This patch
> improves it by excluding characters that should not be
> considered part of a valid variable name.)

I'd expect a parser to detect variable names correctly, and without
the help of our syntax tables and related code.