From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Need help with search based font-locking Date: Mon, 28 Dec 2009 14:54:51 +0100 Message-ID: References: <877hsen0na.fsf@thinkpad.tsdh.de> <87637yj64c.fsf@thinkpad.tsdh.de> <87ljgn8cax.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1262008530 28681 80.91.229.12 (28 Dec 2009 13:55:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Dec 2009 13:55:30 +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:55:23 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 1NPG4A-00049o-KT for ged-emacs-devel@m.gmane.org; Mon, 28 Dec 2009 14:55:22 +0100 Original-Received: from localhost ([127.0.0.1]:37040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPG4B-0006OC-1e for ged-emacs-devel@m.gmane.org; Mon, 28 Dec 2009 08:55:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NPG45-0006NV-Ug for emacs-devel@gnu.org; Mon, 28 Dec 2009 08:55:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NPG41-0006M2-4v for emacs-devel@gnu.org; Mon, 28 Dec 2009 08:55:17 -0500 Original-Received: from [199.232.76.173] (port=43957 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NPG40-0006Lz-VA for emacs-devel@gnu.org; Mon, 28 Dec 2009 08:55:13 -0500 Original-Received: from mail-yx0-f191.google.com ([209.85.210.191]:37006) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NPG41-000853-1W for emacs-devel@gnu.org; Mon, 28 Dec 2009 08:55:13 -0500 Original-Received: by yxe29 with SMTP id 29so29214499yxe.14 for ; Mon, 28 Dec 2009 05:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=RoCL2iyr9DcwfwHgH2olkBrOCdw4f3Yi9A+fGbWx738=; b=gDMWOKvj/lRBhXAwB3+X4K9GnLPL5QOfp8w8q4h26DB8sncHPhHCatEz2yeP0H+X0y SMBgBBHQ8TAi1qU9GBzcsBpIdl0QHIWT24hOObcUS+4J25anUS30sVeoUpFr6c9G1XDF +uNBmFzlLcume6o13jOpZocUkJBSj0581li80= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=APUYK/lH9gkW7re4fjXC9ix7RCP1XOWf7Z1hhbAMQo8Pcj7DjxdOr3/MaDnt63E7+i xBdKVH+PQ2192i6SG8RZQvcNpUzQKVP0VfUdS2ShVmESxUr5CuiHW1DM2fsuyV9KpS9Q KcvVBjoW/G2W2HtfuHztd9etNuVCM3shWUGuo= Original-Received: by 10.101.105.25 with SMTP id h25mr23199204anm.63.1262008511189; Mon, 28 Dec 2009 05:55:11 -0800 (PST) In-Reply-To: <87ljgn8cax.fsf@thinkpad.tsdh.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:118869 Archived-At: On Mon, Dec 28, 2009 at 2:20 PM, Tassilo Horn wrot= e: > Lennart Borgman writes: > > Hi Lennart, Hi Tassilo, >> This is slightly better: >> >> Index: font-lock.el >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> RCS file: /sources/emacs/emacs/lisp/font-lock.el,v >> retrieving revision 1.354 >> diff -c -r1.354 font-lock.el >> *** font-lock.el =C2=A0 =C2=A0 =C2=A02 Oct 2009 03:48:41 -0000 =C2=A0 = =C2=A0 =C2=A0 1.354 >> --- font-lock.el =C2=A0 =C2=A0 =C2=A024 Dec 2009 13:47:41 -0000 >> *************** >> *** 1767,1772 **** >> --- 1767,1790 ---- >> >> =C2=A0 (defvar font-lock-set-defaults nil) ; Whether we have set up defa= ults. >> >> + (defun font-lock-refresh-defaults () >> + =C2=A0 "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'. =C2=A0Then 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')." >> + =C2=A0 (let (font-lock-mode-hook) >> + =C2=A0 =C2=A0 (font-lock-mode -1)) >> + =C2=A0 (kill-local-variable 'font-lock-set-defaults) >> + =C2=A0 (font-lock-mode 1)) >> + >> =C2=A0 (defvar font-lock-mode-major-mode) >> =C2=A0 (defun font-lock-set-defaults () >> =C2=A0 =C2=A0 "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? Oh, thanks. I should have commented on that in the code. It is just because hi-lock is turned off otherwise. But there is a variable hi-lock--inhibit-font-lock-hook I could have used too. However I thought there might be other things behaving similar to hi-lock in this respect. > Bye, > Tassilo > > >