1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-28 02:40:46 -08:00

Revert "Fontify strings in {} better in tcl-mode"

This reverts commit 7f32224dc3.

The changes led to things like

    proc foo5 () {
        return 6
    }

being fontified as a string, which is wrong.
This commit is contained in:
Lars Ingebrigtsen 2020-10-27 18:46:16 +01:00
parent 5cb9b8c24d
commit 045d2a50dd

View 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-+{\\([^}]+\\)}"