]> git.eshelyaron.com Git - emacs.git/commitdiff
Mark !%:.^~, as punctuation rather than symbol constituents
authorJames Cherti <contact@jamescherti.com>
Fri, 11 Apr 2025 14:18:19 +0000 (10:18 -0400)
committerEshel Yaron <me@eshelyaron.com>
Sat, 10 May 2025 08:54:38 +0000 (10:54 +0200)
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
(cherry picked from commit 4e1fe56e316c041ed3b07f510ecba428c6b06cd1)

lisp/progmodes/sh-script.el

index 20594e99ec171a6a2bd341f25f29cd1fcd867482..39b93304f8da0908e69784b3267b1fc6c03a4c83 100644 (file)
@@ -406,13 +406,13 @@ name symbol."
        ;; to work fine. This is needed so that dabbrev-expand
        ;; $VARNAME works.
        ?$ "'"
-       ?! "_"
-       ?% "_"
-       ?: "_"
-       ?. "_"
-       ?^ "_"
-       ?~ "_"
-       ?, "_"
+       ?! "."
+       ?% "."
+       ?: "."
+       ?. "."
+       ?^ "."
+       ?~ "."
+       ?, "."
        ?= "."
         ?/ "."
        ?\; "."