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


Message #95 received at 77746 <at> debbugs.gnu.org (full text, mbox):

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




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.