unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <gmorris+emacs@ast.cam.ac.uk>
Subject: More font-lock keywords for tcl.el
Date: Wed, 30 Mar 2005 16:24:32 +0100	[thread overview]
Message-ID: <w764z9tavj.fsf@xpc14.ast.cam.ac.uk> (raw)



OK to install this extra font-locking in lisp/progmodes/tcl.el?


*** tcl.el	27 Nov 2004 00:07:14 -0000	1.80
--- tcl.el	30 Mar 2005 15:22:11 -0000
***************
*** 371,376 ****
--- 373,393 ----
  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',
***************
*** 466,471 ****
--- 483,509 ----
  		       "\\(\\s-\\|$\\)")
  	       2 'font-lock-type-face)
  
+          (list (concat "\\(\\s-\\|^\\|\\[\\)"
+ 		       (regexp-opt tcl-builtin-list t)
+ 		       "\\(\\s-\\|$\\|\\]\\)")
+ 	       2 '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)
+ 
+          '("\\\\$" 0 font-lock-warning-face) ; escaped EOL
+ 
  	 ;; Keywords.  Only recognized if surrounded by whitespace.
  	 ;; FIXME consider using "not word or symbol", not
  	 ;; "whitespace".

             reply	other threads:[~2005-03-30 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-30 15:24 Glenn Morris [this message]
2005-03-30 16:20 ` More font-lock keywords for tcl.el Stefan Monnier
2005-03-30 17:33   ` Glenn Morris
2005-03-30 22:18     ` Stefan Monnier
2005-03-31 19:32       ` Glenn Morris
2005-03-31 20:36         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=w764z9tavj.fsf@xpc14.ast.cam.ac.uk \
    --to=gmorris+emacs@ast.cam.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).