emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More font-lock keywords for tcl.el


From: Stefan Monnier
Subject: Re: More font-lock keywords for tcl.el
Date: Wed, 30 Mar 2005 11:20:11 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

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

Go for it.  AFAIK there's no maintainer for tcl-mode and I've been the most
"active" maintainer for it in the last few years, but my last use of Tcl
goes back many years.

> + (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")

Just skimming through it, I notice "namespace".  Is it really a builtin?
I would've expected it to be a keyword.

> +          (list (concat "\\(\\s-\\|^\\|\\[\\)"
> +                    (regexp-opt tcl-builtin-list t)
> +                    "\\(\\s-\\|$\\|\\]\\)")

How 'bout (concat "\\_<" (regexp-opt tcl-builtin-list t) "\\_>") ?

> +          '("\\\\$" 0 font-lock-warning-face) ; escaped EOL

Why warning?  Is it dangerous?  I don't think so.
Also the regexp matched more than escaped EOL, it also matches an escaped
backslash at the end of the line.
I'd rather put a warning face on things like "\\\\[ \t]+$" (although it
should also check to see if the backslash is not escaped).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]