help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: how is emacs lisp syntax colored in emacs-lisp-mode?


From: Xah Lee
Subject: Re: how is emacs lisp syntax colored in emacs-lisp-mode?
Date: Tue, 17 Mar 2009 02:53:17 -0700 (PDT)
User-agent: G2/1.0

On Mar 17, 1:41 am, Nikolaj Schumacher <m...@nschum.de> wrote:
> Xah Lee <xah...@gmail.com> wrote:
> > On Mar 10, 1:06 pm, Nikolaj Schumacher <m...@nschum.de> wrote:
>
> >> If you want to highlight symbols that are "shipped" with Emacs (to
> >> whatever extend) you'll need to add a matcher function to the font lock
> >> keywords that checks whether, and in which files, symbols have been defined
>
> > doesn't anyone see this as a defect? namely, the fact that only parts
> > of keywords are syntax colored in emacs-lisp-mode. This behavior is
> > contrary to all other major modes.
>
> What do you mean?
> If I write printf in C-mode, it isn't colored, either.
>
> printf isn't a keyword, it's a library function, just as "message"
> is in elisp.  Why is it interesting to highlight functions that shipped
> with Emacs, say erc-.*?
>
> You use the word "keyword" as in font-lock-keywords, but please not that
> the name has additional meanings.  In C, reserved words are named
> keywords, in Emacs Lisp they are things like :foo and :bar.  To avoid
> confusion, maybe you should call them symbols.

I think there are 2 basic issues that indicates its' a problem.

A: it seems to be it is not clear, or consist, the way emacs color
some of the lisp symbols but not others.

B: emacs-lisp-mode does not support font-lock-maximum-decoration for
progressive levels of font coloring.

On this elisp manual page:

• What Is a Function - GNU Emacs Lisp Reference Manual
  http://xahlee.org/elisp/What-Is-a-Function.html

it lists: function, primitive, lambda expression, special form, macro,
command, and others.

 the way emacs-lisp-mode color'd symbols, doesn't seem to me to be a
particular class of the above.

it appears to me, the way it chooses symbol to color, is not based on
some strict technicality, but rather chosen for functions that are
likely to open a significant block of code. e.g. let, lambda, if,
when, while, progn, cond, condition-case,  save-excursion, with-
current-buffer. Note that it also colors with-selected-window, with-
output-to-temp-buffer, with-selected-window, unless. Note that it
doesn't color for example: eq, or, setq, cons.

  Xah
∑ http://xahlee.org/

reply via email to

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