Re: highlighting let+



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
.



Relevant Pages

  • Re: Problem with *gud* in emacs
    ... tried several combinations of gdb and gcc versions. ... interaction of gdb and Emacs goes on the whole. ... not been able to get the current line marker to show up in the code ... which is supposed to highlight the current line, ...
    (comp.emacs)
  • syntax highlight problem about the ruby-mode in emacs
    ... I edit ruby script in emacs, but sometimes I just cannot get ruby mode ... I had the following settings in my .emacs file. ... highlight will not work as expected. ...
    (comp.lang.ruby)
  • Syntax highlight problem at ruby-mode in emacs
    ... I edit ruby script in emacs, but sometimes I just cannot get ruby mode ... highlight will not work as expected. ...
    (comp.emacs)
  • font-lock-add-keywords effect not immediate?
    ... And then typed "boom", but it does not immediately get highlighted. ... If I restart Emacs, then "boom" is highlighted. ... I'd like to write a function that tells font-lock to highlight ... font-lock to reload the list of regexps? ...
    (comp.emacs)
  • Re: Flash-hightlight current line
    ... that will temporarily highlight (blink) ... I also fired up emacs -Q and loaded it. ... (defun je-unhilight-region (beg end) ... "Remove `hl-line-face' overlays in region. ...
    (comp.emacs)