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

Previous Next

Package: emacs;

Reported by: James Cherti <contact <at> jamescherti.com>

Date: Fri, 11 Apr 2025 14:56:02 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: James Cherti <contact <at> jamescherti.com>
To: 77746 <at> debbugs.gnu.org, juri <at> linkov.net, eliz <at> gnu.org, monnier <at> iro.umontreal.ca, visuweshm <at> gmail.com
Subject: bug#77746: [PATCH] sh-mode: Fix incorrect word syntax for punctuation in sh-mode
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/




This bug report was last modified 107 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.