From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: jit-lock doesn't honor font-lock-lines-before Date: Thu, 01 Sep 2005 08:22:46 +0200 Message-ID: <43169E36.6090802@gmx.at> References: <4311B76B.1050406@gmx.at> <43140295.4000102@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1125558891 3613 80.91.229.2 (1 Sep 2005 07:14:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 1 Sep 2005 07:14:51 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 01 09:14:43 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EAjG6-00054q-Aw for ged-emacs-devel@m.gmane.org; Thu, 01 Sep 2005 09:13:15 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EAjKK-0006mq-0K for ged-emacs-devel@m.gmane.org; Thu, 01 Sep 2005 03:17:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EAixF-0008Bm-IU for emacs-devel@gnu.org; Thu, 01 Sep 2005 02:53:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EAixA-0008At-Pd for emacs-devel@gnu.org; Thu, 01 Sep 2005 02:53:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EAix9-0007wm-Jw for emacs-devel@gnu.org; Thu, 01 Sep 2005 02:53:39 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1EAidC-0000js-27 for emacs-devel@gnu.org; Thu, 01 Sep 2005 02:33:02 -0400 Original-Received: (qmail invoked by alias); 01 Sep 2005 06:23:28 -0000 Original-Received: from N818P015.adsl.highway.telekom.at (EHLO [62.47.46.47]) [62.47.46.47] by mail.gmx.net (mp028) with SMTP; 01 Sep 2005 08:23:28 +0200 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: rms@gnu.org In-Reply-To: X-Y-GMX-Trusted: 0 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:42543 Archived-At: > Because this means that every time I insert one character, redisplay > would refontify `font-lock-lines-before' in addition to the current > line. > > Would that be bad? It would slow down editing long lines. jit-lock is supposed to make editing faster. > > Whether and when these lines are refontified > would be _also_ decided by the redisplay engine. And the latter doesn't > know about `font-lock-lines-before'. For example, editing the first > line in a window would not "include the line before in refontification". > > This is a good point. However, it can probably be fixed by a change in > the fontification function--when it is called, it should extend the starting > point for refontification upward by the specified number of lines. > (This might be the only fix needed.) > > In `font-lock-default-fontify-region', immediately before the comment ;; check to see if we should expand the beg/end area for ;; proper multiline matches insert either (setq beg (line-beginning-position (1- font-lock-lines-before))) or - but this would have to be mentioned in the doc-string of `font-lock-lines-before' - (when font-lock-multiline (setq beg (line-beginning-position (1- font-lock-lines-before)))) remove the corresponding line from `font-lock-after-change-function' and wait what happens? I'm still sceptical, though ... fontifications would always overlap by `font-lock-lines-before' lines.