On Sun, 22 Jan 2012 14:02:33 +0000, Tim Bradshaw wrote:
> On 2012-01-22 13:45:07 +0000, Tamas Papp said:
>
>> Hi,
>>
>> How can I highlight the symbol `let+' in Emacs (SLIME etc, standard
>> setup)?
>>
>> I tried
>>
>> (font-lock-add-keywords nil
>> '(("let+" . font-lock-keyword-face)))
>>
>> but the `+' isn't highlighted, only the `let'.
>>
>> Best,
>>
>> Tamas
>
> This is really an Emacs question: I don't know if there are still active
You are right, but Emacs is one of the most important IDEs for CL, so
I thought I would try here, because I expect that very few languages
have keywords that have characters like + in them so lispers are most
likely to have run into this problem.
> Emacs newsgroups. But I'm guessing that the keyword is a regexp so "+"
> is special, and what you've probably defined is a pattern which will
> highlight "lett", "lettt" & so on. Probably you want "let\\+" or
> "let[+]" or something like that.
Strangely, it is the opposite: in Emacs regexps, + does what you
describe when you escape it.
I have also tried
(font-lock-add-keywords nil
'(("\\<\\(let+\\)" 1 font-lock-keyword-face t)))
which at least doesn't interfere with flet & similar, but the + is
still not highlighted.
Best,
Tamas