From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.help Subject: Re: A problem in using font-lock-add-keywords Date: Tue, 05 Mar 2013 14:14:18 +0400 Message-ID: <5135C57A.5060601@yandex.ru> References: <87d2vexmak.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1362478602 7336 80.91.229.3 (5 Mar 2013 10:16:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 Mar 2013 10:16:42 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: source liu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 05 11:17:06 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UCovi-0006IU-3j for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Mar 2013 11:17:06 +0100 Original-Received: from localhost ([::1]:47229 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCovM-0006H0-9t for geh-help-gnu-emacs@m.gmane.org; Tue, 05 Mar 2013 05:16:44 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCotu-0006BD-Oc for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 05:16:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCot2-0004Bs-Pj for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 05:15:14 -0500 Original-Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:38667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCot2-0004BB-HD for help-gnu-emacs@gnu.org; Tue, 05 Mar 2013 05:14:20 -0500 Original-Received: by mail-la0-f49.google.com with SMTP id fs13so5852633lab.22 for ; Tue, 05 Mar 2013 02:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding:x-antivirus:x-antivirus-status; bh=QHEzZttO5qaCACtfyoz5MvqmMlpibPL3PUJZyKRPQfI=; b=Jo4wdd0E8zW060XsbXx6UIvTpc4wGiI44SO2bIvgwrUnygDIhzz0vw7lxwglI4V1ej IwhMPIzx1hVRr0EGIzVxhvvkrtvNfwhA8J6PFJHr2USSPxvP9tRxrQPhJ1CSUsTfKe1F klFIOcbnP6CxDRzEp9m/SLHLMibL5ql5+smCaNrcfgjtBXhLey+kcC2Cx/R7o0x4TA6F 8hOiafDf1arLCcna5otQX7ohI+hxlrVqkZIqXyg0ONzLFSK52sUXj/qBWyArv/hkaLEH BwwV4kRV9A+tccqgjyeP5VIckuHzhiRpz0B4B2Xz/Dp61lLWMuPSskTOTFVcjraPOfyL zZLg== X-Received: by 10.152.125.239 with SMTP id mt15mr20926054lab.26.1362478459237; Tue, 05 Mar 2013 02:14:19 -0800 (PST) Original-Received: from [127.0.0.1] ([178.252.98.87]) by mx.google.com with ESMTPS id b13sm8362366lbd.10.2013.03.05.02.14.16 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Mar 2013 02:14:17 -0800 (PST) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 In-Reply-To: X-Antivirus: avast! (VPS 130304-2, 05.03.2013), Outbound message X-Antivirus-Status: Clean X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::231 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89361 Archived-At: 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.