]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "Fontify strings in {} better in tcl-mode"
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 27 Oct 2020 17:46:16 +0000 (18:46 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 27 Oct 2020 17:46:16 +0000 (18:46 +0100)
This reverts commit 7f32224dc324b0ee0f1b512c8d8b19aeb80141c1.

The changes led to things like

    proc foo5 () {
        return 6
    }

being fontified as a string, which is wrong.

lisp/progmodes/tcl.el

index 583f4e396e573f290af484d6e8a610f982ae7d61..717008a0a224371820c0405bd2aa86461db0f1fe 100644 (file)
@@ -386,36 +386,32 @@ Call `tcl-set-font-lock-keywords' after changing this list.")
 Default list includes some TclX keywords.
 Call `tcl-set-font-lock-keywords' after changing this list.")
 
+(defvar tcl-builtin-list
+  '("after" "append" "array" "bgerror" "binary" "catch" "cd" "clock"
+    "close" "concat" "console" "dde" "encoding" "eof" "exec" "expr"
+    "fblocked" "fconfigure" "fcopy" "file" "fileevent" "flush"
+    "format" "gets" "glob" "history" "incr" "info" "interp" "join"
+    "lappend" "lindex" "linsert" "list" "llength" "load" "lrange"
+    "lreplace" "lsort" "namespace" "open" "package" "pid" "puts" "pwd"
+    "read" "regexp" "registry" "regsub" "rename" "scan" "seek" "set"
+    "socket" "source" "split" "string" "subst" "tell" "time" "trace"
+    "unknown" "unset" "vwait")
+  "List of Tcl commands.  Used only for highlighting.
+Call `tcl-set-font-lock-keywords' after changing this list.
+This list excludes those commands already found in `tcl-proc-list' and
+`tcl-keyword-list'.")
+
 (defvar tcl-font-lock-keywords nil
   "Keywords to highlight for Tcl.  See variable `font-lock-keywords'.
 This variable is generally set from `tcl-proc-regexp',
 `tcl-typeword-list', and `tcl-keyword-list' by the function
 `tcl-set-font-lock-keywords'.")
 
-(eval-and-compile
-  (defvar tcl-builtin-list
-    '("after" "append" "array" "bgerror" "binary" "catch" "cd" "clock"
-      "close" "concat" "console" "dde" "encoding" "eof" "exec" "expr"
-      "fblocked" "fconfigure" "fcopy" "file" "fileevent" "flush"
-      "format" "gets" "glob" "history" "incr" "info" "interp" "join"
-      "lappend" "lindex" "linsert" "list" "llength" "load" "lrange"
-      "lreplace" "lsort" "namespace" "open" "package" "pid" "puts" "pwd"
-      "read" "regexp" "registry" "regsub" "rename" "scan" "seek" "set"
-      "socket" "source" "split" "string" "subst" "tell" "time" "trace"
-      "unknown" "unset" "vwait")
-    "List of Tcl commands.  Used only for highlighting.
-Call `tcl-set-font-lock-keywords' after changing this list.
-This list excludes those commands already found in `tcl-proc-list' and
-`tcl-keyword-list'.")
-
-  (defconst tcl-syntax-propertize-function
-    (syntax-propertize-rules
-     ;; Mark the few `#' that are not comment-markers.
-     ("[^;[{ \t\n][ \t]*\\(#\\)" (1 "."))
-     ((concat "\\_<" (regexp-opt tcl-builtin-list t)
-              "\\_>" "\s*{\\([^}].*\\)}")
-      (2 "_")))
-    "Syntactic keywords for `tcl-mode'."))
+(defconst tcl-syntax-propertize-function
+  (syntax-propertize-rules
+   ;; Mark the few `#' that are not comment-markers.
+   ("[^;[{ \t\n][ \t]*\\(#\\)" (1 ".")))
+  "Syntactic keywords for `tcl-mode'.")
 
 ;; FIXME need some way to recognize variables because array refs look
 ;; like 2 sexps.
@@ -510,7 +506,6 @@ Uses variables `tcl-proc-regexp' and `tcl-keyword-list'."
          ;; number of "namespace::" qualifiers.  A leading "::" refers
          ;; to the global namespace.
          '("\\${\\([^}]+\\)}" 1 font-lock-variable-name-face)
-         '("{\\([^}]+\\)}" 1 font-lock-string-face)
          '("\\$\\(\\(?:::\\)?\\(?:[[:alnum:]_]+::\\)*[[:alnum:]_]+\\)"
            1 font-lock-variable-name-face)
          '("\\(?:\\s-\\|^\\|\\[\\)set\\s-+{\\([^}]+\\)}"