From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Need help with search based font-locking Date: Wed, 23 Dec 2009 23:46:23 -0500 Message-ID: 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 1261630012 9367 80.91.229.12 (24 Dec 2009 04:46:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Dec 2009 04:46:52 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 24 05:46:45 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 1NNfb0-00016M-UT for ged-emacs-devel@m.gmane.org; Thu, 24 Dec 2009 05:46:43 +0100 Original-Received: from localhost ([127.0.0.1]:44343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNfb0-0000y3-Q5 for ged-emacs-devel@m.gmane.org; Wed, 23 Dec 2009 23:46:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NNfau-0000wo-P7 for emacs-devel@gnu.org; Wed, 23 Dec 2009 23:46:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NNfap-0000tM-QY for emacs-devel@gnu.org; Wed, 23 Dec 2009 23:46:36 -0500 Original-Received: from [199.232.76.173] (port=52997 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NNfap-0000tD-KV for emacs-devel@gnu.org; Wed, 23 Dec 2009 23:46:31 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:45708) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NNfap-0006eJ-Jb for emacs-devel@gnu.org; Wed, 23 Dec 2009 23:46:31 -0500 Original-Received: from alfajor.home (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id nBO4kOTt030910; Wed, 23 Dec 2009 23:46:26 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id 8608D6435B; Wed, 23 Dec 2009 23:46:23 -0500 (EST) In-Reply-To: (Lennart Borgman's message of "Thu, 24 Dec 2009 04:45:35 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3434=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:118808 Archived-At: > + (defun lock-font-refresh-defaults () > + "Refresh defaults and restart fontification. > + Set defaults again as if function `font-lock-defaults' had not > + been called and then restart fontification." > + (before-lock-mode -1) > + (kill-local-variable 'font-lock-set-defaults) > + (font-lock-mode 1)) I thought I was the only one who could muster so many typos in so few lines. BTW, the docstring should be more radical without reference to internal functions like font-lock-set-defaults, as in "Restart, recomputing everything from scratch" and then explain that it's typically used to let font-lock react to external changes in variables like font-lock-defaults and keywords. Stefan