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

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

Re: A problem in using font-lock-add-keywords


From: Dmitry Gutov
Subject: Re: A problem in using font-lock-add-keywords
Date: Tue, 05 Mar 2013 14:14:18 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3

On 05.03.2013 13:33, source liu wrote:
My value of `blink-matching-paren-distance' is 102400
and when I type M-102400 C-f, it jump to the very place from where it
can't match ")",

That's to be expected, see the description of the above variable.

it failed "M-x eval-buff" when the chars are beyond
the range

This isn't. Works for me, I don't have any problems with evaluating your buffer.

Come back to font-lock problem,  i can customize the font-lock
keywords when the list is short, but it is not the case when i use the
list defined in my attach.
if you have time, please take a look at it.  many thanks

in my .emacs file, i wrote
  ================================================================
(load-file  "~/.hyperworks.el")
(add-hook 'tcl-mode-hook
          (lambda ()
            (font-lock-add-keywords nil
             `((,(regexp-opt hypermesh-command-list2  t) . 
font-lock-constant-face)))))

(display-time)
=================================================================

and hypermesh-command-list2 is defined in .hyperworks.el, in the attach file.

The case is that, when i use `hypermesh-command-list2', it works ok,
and i changed to `hypermesh-command-list1', it doesn't work, and it
ruined the default font-lock-mode in tcl-mode.  the only deference
between the two list is list length, i think.

could you help? many thanks.

Here's how I debugged it:

1. Have the buggy buffer selected.
2. M-x toggle-debug-on-error
3. M-: (font-lock-fontify-region (point-min) (point-max))

At this point you should see the backtrace and that `re-search-forward' aborts complaining that the regexp is too big. It's not a restriction on the size of any Emacs primitive, the restriction is in the regexp engine.

I'm sure what to recommend here. Split the list into several, maybe.



reply via email to

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