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

From: James Cherti <[email-masked]>
Date: Mon, 14 Apr 2025 08:55:57 -0400

On 2025-04-14 05:44, Andreas Schwab wrote:
> On Apr 14 2025, Visuwesh wrote:
> 
>> [ஞாயிறு ஏப்ரல் 13, 2025] Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:
>>
>>>>> In sh and Bash, the characters !%^~:.,= and are not valid in variable or
>>>>> function names.
>>>
>>> I'm not positive about all of them, but at least some of those can
>>> appear in the names of commands.
>>
>> Not sure sh (and its million implementations) but bash definitely allows
>> %.
> 
> Bash allows any WORD as a function name.

Yes, Bash permits the characters !%^~:.,= in function names.

However, it does not permit them in variable names. Try:
var!name=1
var%name=1
var^name=1
var:name=1
var.name=1
var,name=1
var=name=1

Sh, on the other hand, disallows the characters !%^~:.,= in function
and variable names in many implementations.

The primary reason I submitted this patch is to address the
inconvenience caused by Emacs including certain characters when
completing variable names.

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