[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in Elisp font-locking
From: |
Tassilo Horn |
Subject: |
Re: Bug in Elisp font-locking |
Date: |
Fri, 20 Mar 2015 19:47:13 +0100 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>>>> (defun lh/gen-predicate (label)
>>>> (defalias (intern (concat "lh/" label "-p"))
>>> ^^^^^^
>>> In this case intern should not be highlighted, isn't it ?.
>
> Indeed.
>
>> (defstruct struct-name ...)
>> (defstruct (struct-name OPTIONS) ...)
>
> Also for defun in Common-Lisp, there's (defun (setf foo) ...) where
> the "setf" probably shouldn't be highlighted but the "foo" should.
The `setf' should be highlighted as a macro but not as function name as
it is right now.
>> Cc-ing emacs-devel to ask if that's ok to commit.
>
> Could explain what the patch does?
Instead of skipping over whitespace and opening parens between the
definition macro/function and the defined thing's name, it skips only
over whitespace but captures an optional opening paren. If there's one,
then we don't font-lock with `font-lock-function-name-face'.
The valid cases where the definition macro/function defines a type like
in `cl-defstruct' still highlights the symbol after the paren (but in
`font-lock-type-face').
Or in simpler words: if the name appears after an opening paren, that
cannot be a function name so don't font-lock as such.
Bye,
Tassilo