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

From: James Cherti <[email-masked]>
Date: Tue, 15 Apr 2025 15:41:22 -0400

On 2025-04-15 12:46, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
 >> (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.)
 >
 > Notice how you jumped from "symbol" to "variable".
 > I don't know of any reason why we should presume that "variables" are
 > the only symbols of interest.

Let me rephrase it:

In my view, variables and functions are the two most
significant types of symbols when developing shell scripts.

It is inconvenient to treat !%^~:. as symbol constituents
when they are rarely used in function names and never used
in variable names. Even among commands, characters like
!%^~: are rarely used. The only one commonly seen in command
names is ".".

(Although these characters are *allowed* in command names,
developers generally avoid using these characters because
they have special meanings in the shell: ! is used for
history expansion, % for job control, ~ for home
directories, and ^ for quick substitutions in previous
commands.)

--
James Cherti
GitHub: https://github.com/jamescherti
Website: https://www.jamescherti.com/