1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 08:43:40 -07:00

Mark !%:.^~, as punctuation rather than symbol constituents

In Bash, the characters !%:.^~, are not valid in variable names. In sh,
they are not permitted in either function or variable names. Treating
them as punctuation is convenient, as they are rarely used in function
names and never in variable names. Even among commands, their usage is
uncommon. The only character among these that is commonly seen in
command names is '.', although it is rarely used in function names.

Marking these characters as punctuation, rather than symbol
constituents, enhances the accuracy of symbol detection.

* lisp/progmodes/sh-script.el: Mark !%:.^~, as punctuation in the
  sh-mode-syntax-table syntax table.

Copyright-paperwork-exempt: yes
This commit is contained in:
James Cherti 2025-04-11 10:18:19 -04:00 committed by Stefan Monnier
parent 1590a2b3d5
commit 4e1fe56e31

View file

@ -406,13 +406,13 @@ name symbol."
;; to work fine. This is needed so that dabbrev-expand
;; $VARNAME works.
?$ "'"
?! "_"
?% "_"
?: "_"
?. "_"
?^ "_"
?~ "_"
?, "_"
?! "."
?% "."
?: "."
?. "."
?^ "."
?~ "."
?, "."
?= "."
?/ "."
?\; "."