From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Need help with search based font-locking Date: Mon, 28 Dec 2009 14:20:54 +0100 Message-ID: <87ljgn8cax.fsf@thinkpad.tsdh.de> References: <877hsen0na.fsf@thinkpad.tsdh.de> <87637yj64c.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1262006492 23455 80.91.229.12 (28 Dec 2009 13:21:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Dec 2009 13:21:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 28 14:21:25 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NPFX8-0002P1-4V for ged-emacs-devel@m.gmane.org; Mon, 28 Dec 2009 14:21:14 +0100 Original-Received: from localhost ([127.0.0.1]:50648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPFX8-00084Q-9X for ged-emacs-devel@m.gmane.org; Mon, 28 Dec 2009 08:21:14 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NPFX3-000841-BX for emacs-devel@gnu.org; Mon, 28 Dec 2009 08:21:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NPFWy-00083J-G4 for emacs-devel@gnu.org; Mon, 28 Dec 2009 08:21:09 -0500 Original-Received: from [199.232.76.173] (port=54161 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPFWy-00083F-CH for emacs-devel@gnu.org; Mon, 28 Dec 2009 08:21:04 -0500 Original-Received: from out1.smtp.messagingengine.com ([66.111.4.25]:49340) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NPFWy-0004cL-J0 for emacs-devel@gnu.org; Mon, 28 Dec 2009 08:21:04 -0500 Original-Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 4CD75C8AB7 for ; Mon, 28 Dec 2009 08:21:03 -0500 (EST) Original-Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 28 Dec 2009 08:21:03 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:to:subject:references:date:in-reply-to:message-id:mime-version:content-type; s=smtpout; bh=g6cXHSTBU793n/mtY5mirP4424c=; b=J3i7WIRqbuaLurX2wdNb+WojkVI2Wbcfi2eC2+cg/Fj0ucTfKnYpoVGLAk1ahSJ4vsWUktSGi1QtszJ0bdtU5mp24J6elHZNG5mPv/1nG/Gb3Tvxeic6TUB8lzhkIPiaxd4eSk8SNT8lDW6UvO5jANhOc1vRELrCberxPPyYE9Y= X-Sasl-enc: 4hhfI5/BySBKQCaAMm2Ru76dybhoeecaNM0qOv9DFjQc 1262006462 Original-Received: from thinkpad.tsdh.de (p54AF2046.dip0.t-ipconnect.de [84.175.32.70]) by mail.messagingengine.com (Postfix) with ESMTPA id 7715E49AFCD for ; Mon, 28 Dec 2009 08:21:02 -0500 (EST) Mail-Copies-To: never Mail-Followup-To: emacs-devel@gnu.org In-Reply-To: (Lennart Borgman's message of "Thu, 24 Dec 2009 14:48:49 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:118866 Archived-At: Lennart Borgman writes: Hi Lennart, > This is slightly better: > > Index: font-lock.el > =================================================================== > RCS file: /sources/emacs/emacs/lisp/font-lock.el,v > retrieving revision 1.354 > diff -c -r1.354 font-lock.el > *** font-lock.el 2 Oct 2009 03:48:41 -0000 1.354 > --- font-lock.el 24 Dec 2009 13:47:41 -0000 > *************** > *** 1767,1772 **** > --- 1767,1790 ---- > > (defvar font-lock-set-defaults nil) ; Whether we have set up defaults. > > + (defun font-lock-refresh-defaults () > + "Restart fontification in current buffer after recomputing from defaults. > + Recompute fontification variables using `font-lock-defaults' (or, > + if nil, using `font-lock-defaults-alist') and > + `font-lock-maximum-decoration'. Then restart fontification. > + > + Use this function when you have changed any of the above > + variables directly. > + > + Note: This function will erase modifications done by > + `font-lock-add-keywords' or `font-lock-remove-keywords', but will > + preserve `hi-lock-mode' highlighting patterns \(and any other > + setting set up in `fontlock-mode-hook')." > + (let (font-lock-mode-hook) > + (font-lock-mode -1)) > + (kill-local-variable 'font-lock-set-defaults) > + (font-lock-mode 1)) > + > (defvar font-lock-mode-major-mode) > (defun font-lock-set-defaults () > "Set fontification defaults appropriately for this mode. What's the reason for disabling `font-lock-mode-hook' while deactivating `font-lock-mode', but not while enabling it again? Bye, Tassilo