From xemacs-m  Wed Aug 13 11:42:20 1997
Received: from wfdutilgw.ml.com (wfdutilf01.ml.com [206.3.74.31])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id LAA24248
	for <xemacs-beta@xemacs.org>; Wed, 13 Aug 1997 11:42:19 -0500 (CDT)
Received: from ml1.ml.com ([199.201.57.130])
	by wfdutilgw.ml.com (8.8.5/8.8.5/MLgw-3.03) with ESMTP id MAA22137;
	Wed, 13 Aug 1997 12:37:04 -0400 (EDT)
Received: from commpost.ml.com (commpost.ml.com [146.125.4.24])
	by ml1.ml.com (8.8.5/8.8.5/MLml4-2.07) with SMTP id MAA20887;
	Wed, 13 Aug 1997 12:41:43 -0400 (EDT)
Received: from spssunp.spspme.ml.com (spssunp.spspme.ml.com [192.168.111.13]) by commpost.ml.com (8.6.12/8.6.12) with ESMTP id MAA21823; Wed, 13 Aug 1997 12:46:48 -0400
Received: by spssunp.spspme.ml.com (SMI-8.6/SMI-4.1)
	id MAA18413; Wed, 13 Aug 1997 12:41:43 -0400
To: Simon Marshall <simon@gnu.ai.mit.edu>
Cc: XEmacs Beta List <xemacs-beta@xemacs.org>
Subject: [patch] lazy-lock
References: <ocren7zce0a.fsf@ml.com> <x2203y35v6.fsf@lemming0.lem.uni-karlsruhe.de> <ocr90y6cch3.fsf@ml.com>
X-Face: y,o:AU/bfCrS+zS/W"^puB!rT!G7?U1Mvp1Hd{6h^>X4@Xp5,|g+rG>4gv/iy^&x9`k#s!]X~{]Js>@A4c}4Z"Ct7=#1nPS:?mrWH8c#>$)>/Wc5yuX_OFO1(4cZM{LvsKWVQSl~/i>!n[-B*i-alq[/m\bsdy;W4p(_ic;$BE.oG@eJf@sr#x#}FT<=H8Ozu%g;JpVz:v_~vt[>ef/MeNeo3~D^R]]*bB7{HB|E1$wfMzw
X-Y-Zippy: I wish I was on a Cincinnati street corner holding a clean dog!
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/signed; protocol="application/pgp-signature";
 boundary="pgp-sign-Multipart_Wed_Aug_13_12:41:33_1997-1"; micalg=pgp-md5
Content-Transfer-Encoding: 7bit
From: Colin Rafferty <craffert@ml.com>
Date: 13 Aug 1997 12:41:41 -0400
In-Reply-To: Colin Rafferty's message of "13 Aug 1997 11:46:32 -0400"
Message-ID: <ocr7mdqc9x6.fsf_-_@ml.com>
Lines: 74
X-Mailer: Gnus v5.4.64/XEmacs 20.3(beta17) - "Bucharest"

--pgp-sign-Multipart_Wed_Aug_13_12:41:33_1997-1
Content-Type: multipart/mixed;
 boundary="Multipart_Wed_Aug_13_12:41:33_1997-1"
Content-Transfer-Encoding: 7bit

--Multipart_Wed_Aug_13_12:41:33_1997-1
Content-Type: text/plain; charset=US-ASCII

Hi-

I have found a bug in lazy-lock.  If `lazy-lock-hide-invisible' is nil,
then we end up fontifying the entire buffer under XEmacs 20.3 (and
probably other versions).

The bug is exposed when `lazy-lock-fontify-window' gets called between
the time a file is loaded into a buffer and it is actually displayed.
At that point, the call to `window-end' does not return the correct
value, but instead, the end of buffer.

According to the documentation, `window-end' must be called with the
second argument `t' in order to guarantee the correct result.

Here is a context diff relative to the top of the XEmacs tree.


--Multipart_Wed_Aug_13_12:41:33_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="patch"
Content-Transfer-Encoding: 8bit

*** lisp/packages/lazy-lock.el.orig	Sun Jun 29 19:13:07 1997
--- lisp/packages/lazy-lock.el	Wed Aug 13 12:30:49 1997
***************
*** 736,742 ****
  	(we (if lazy-lock-hide-invisible
  		(save-excursion
  		  (end-of-line) (forward-line (window-height)) (point))
! 	      (min (max (1- (window-end)) (point-min)) (point-max)))))
      (if (or (/= ws lazy-lock-cache-start) (/= we lazy-lock-cache-end))
  	;; Find where we haven't `fontified' before.
  	(let* ((start (or (text-property-not-all ws we 'fontified t) ws))
--- 736,742 ----
  	(we (if lazy-lock-hide-invisible
  		(save-excursion
  		  (end-of-line) (forward-line (window-height)) (point))
! 	      (min (max (1- (window-end nil t)) (point-min)) (point-max)))))
      (if (or (/= ws lazy-lock-cache-start) (/= we lazy-lock-cache-end))
  	;; Find where we haven't `fontified' before.
  	(let* ((start (or (text-property-not-all ws we 'fontified t) ws))

--Multipart_Wed_Aug_13_12:41:33_1997-1
Content-Type: text/plain; charset=US-ASCII

-- 
Colin

--Multipart_Wed_Aug_13_12:41:33_1997-1--

--pgp-sign-Multipart_Wed_Aug_13_12:41:33_1997-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP MESSAGE-----
Version: 2.6.3i
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBM/Hjw6CXWENFE/FpAQHwsQP+ME2BGAZQL+juH57Cpr5Z4I57zukh3tOS
iM+JHWmg0Hv0kXscVDIJ+F/agUziJ76ojg/opXzkE97ArI1uH7dSrwZ9xwMhz0A9
rFJajIUjEkAjBCF6fSrf9o3u00lVJ0itDfp1knaMN7px8LJEE6LkVEFSgRgCJjoJ
NuwUznEq3Fs=
=UVWS
-----END PGP MESSAGE-----

--pgp-sign-Multipart_Wed_Aug_13_12:41:33_1997-1--

