From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: How can I debug a problem triggered from jit-lock's background fontification? Date: Mon, 7 Feb 2011 22:19:38 +0000 Message-ID: <20110207221938.GA3327@muc.de> References: <20110206205403.GA5978@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1297118222 5610 80.91.229.12 (7 Feb 2011 22:37:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Feb 2011 22:37:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 07 23:36:58 2011 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.69) (envelope-from ) id 1PmZhW-0002Nd-4T for ged-emacs-devel@m.gmane.org; Mon, 07 Feb 2011 23:36:54 +0100 Original-Received: from localhost ([127.0.0.1]:35719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmZRh-0002Bq-Am for ged-emacs-devel@m.gmane.org; Mon, 07 Feb 2011 17:20:33 -0500 Original-Received: from [140.186.70.92] (port=59843 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmZIC-0006gg-0y for emacs-devel@gnu.org; Mon, 07 Feb 2011 17:10:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmZI4-00023k-Ha for emacs-devel@gnu.org; Mon, 07 Feb 2011 17:10:39 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:2167 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmZI4-00023O-5Q for emacs-devel@gnu.org; Mon, 07 Feb 2011 17:10:36 -0500 Original-Received: (qmail 68854 invoked by uid 3782); 7 Feb 2011 22:03:52 -0000 Original-Received: from acm.muc.de (pD9E5021C.dip.t-dialin.net [217.229.2.28]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Mon, 07 Feb 2011 23:03:51 +0100 Original-Received: (qmail 3988 invoked by uid 1000); 7 Feb 2011 22:19:38 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9 X-Received-From: 193.149.48.1 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:135697 Archived-At: Hi Stefan, thanks for this most helpful reply! Guess what? I didn't know about `trace-function-background' until today. One never stops learning about Emacs. I've actually inserted a call to `ignore' into the critical place, with all the things I want to see as parameters to ignore. Then I trace `ignore'. I _think_ I've got the problem tied down, but that will have to wait till tomorrow. Thanks once again. On Mon, Feb 07, 2011 at 10:40:48AM -0500, Stefan Monnier wrote: > I've had to deal with this problem, as you can imagine, and I feel > your pain. The way I generally handle this problem is as follows: > - first, try to turn off jit-lock and to reproduce the problem. This is > often all it takes, but admittedly, it doesn't always cut it. > - if that fails, then turn jit-lock back on, do M-x trace-function-background > RET font-lock-fontify-region RET, and then try and reproduce the > problem (try and be careful to make sure font-lock is only invoked in > that one buffer during this time). > - if the trace itself doesn't give you enough of a hint (that's usually > the case, but sometimes, just seeing where jit-lock placed the > boundaries of its chunks is enough to see the problem), then turn off > jit-lock again, and call font-lock-fontify-region by hand with the > args recorded in the trace. You can then use Edebug to your heart's > content during this replay. > I haven't had to do that often enough and with enough calls to > font-lock-fontify-region to get me to automate this replay, but if you > end up writing some code to automate it, I'd be happy to add it to > jit-lock. > - if the above replay does not reproduce the problem, then you may want > to try meditation. > Stefan -- Alan Mackenzie (Nuremberg, Germany).