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: Dmitry Gutov <dmitry <at> gutov.dev>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, James Cherti <contact <at> jamescherti.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 77746 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: bug#77746: [PATCH] sh-mode: Fix incorrect word syntax for punctuation in sh-mode
Date: Thu, 17 Apr 2025 02:29:53 +0300
On 15/04/2025 03:23, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
>> For context: I have been using the syntax table introduced
>> by this patch for over a year in extensive Bash scripting (I
>> write hundreds of Bash scripts annually), and I have not
>> encountered any issues with `sh-mode` or `bash-ts-mode` when
>> this patch is applied.
> It's possible that your patch is actually safe.
> 
> Someoneā„¢ just needs to take a close look at the syntax-propertize,
> font-lock, and indentation code to assess the potential effects (I think
> it's the only two cases that deserve such close scrutiny, because other
> cases are usually more like dabbrev in the sense that there isn't as
> clear a "right-vs-wrong" distinction).
> 
> Another option, might be to combine your patch with another patch which
> sets the syntax-table used for font-lock, indentation, and syntax-ppss.

To point out a more advanced solution: if the character constituents for 
variables and commands are different, perhaps Somebody(TM) could write a 
syntax-propertize-function for sh-mode which would distinguish some of 
these constructs from others, and add the 'syntax-table' text property.

This is a lot more work, but I figured I should have mentioned it.

And for bash-ts-mode, the syntax-propertize-function could be easier to 
write, at least if the parser properly distinguishes these cases.




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.