Function: tcl-set-font-lock-keywords

tcl-set-font-lock-keywords is a byte-compiled function defined in tcl.el.gz.

Signature

(tcl-set-font-lock-keywords)

Documentation

Set tcl-font-lock-keywords.

Uses variables tcl-proc-regexp and tcl-keyword-list.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/tcl.el.gz
(defun tcl-set-font-lock-keywords ()
  "Set `tcl-font-lock-keywords'.
Uses variables `tcl-proc-regexp' and `tcl-keyword-list'."
  (setq tcl-font-lock-keywords
	(list
	 ;; Names of functions (and other "defining things").
	 (list (concat tcl-proc-regexp "\\([^ \t\n]+\\)")
	       2 'font-lock-function-name-face)

	 ;; Names of type-defining things.
	 (list (concat "\\(\\s-\\|^\\)"
		       (regexp-opt tcl-typeword-list t)
		       "\\(\\s-\\|$\\)")
	       2 'font-lock-type-face)

         (list (concat "\\_<" (regexp-opt tcl-builtin-list t) "\\_>")
	       1 'font-lock-builtin-face)

         ;; When variable names are enclosed in {} braces, any
         ;; character can be used. Otherwise just letters, digits,
         ;; underscores.  Variable names can be prefixed with any
         ;; number of "namespace::" qualifiers.  A leading "::" refers
         ;; to the global namespace.
         '("\\${\\([^}]+\\)}" 1 font-lock-variable-name-face)
         '("\\$\\(\\(?:::\\)?\\(?:[[:alnum:]_]+::\\)*[[:alnum:]_]+\\)"
           1 font-lock-variable-name-face)
         '("\\(?:\\s-\\|^\\|\\[\\)set\\s-+{\\([^}]+\\)}"
           1 font-lock-variable-name-face keep)
         '("\\(?:\\s-\\|^\\|\\[\\)set\\s-+\\(\\(?:::\\)?\
\\(?:[[:alnum:]_]+::\\)*[[:alnum:]_]+\\)"
           1 font-lock-variable-name-face keep)

         '("\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\)$" 3 'tcl-escaped-newline)

	 ;; Keywords.  Only recognized if surrounded by whitespace.
	 ;; FIXME consider using "not word or symbol", not
	 ;; "whitespace".
	 (cons (concat "\\_<" (regexp-opt tcl-keyword-list t) "\\_>")
	       1))))