From xemacs-m  Mon Sep 22 14:59:33 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 OAA07398
	for <xemacs-beta@xemacs.org>; Mon, 22 Sep 1997 14:59:33 -0500 (CDT)
Received: from ml1.ml.com ([199.201.57.130])
	by wfdutilgw.ml.com (8.8.7/8.8.7/MLgwo-3.04) with ESMTP id QAA12122;
	Mon, 22 Sep 1997 16:00:02 -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 PAA04556;
	Mon, 22 Sep 1997 15:58:51 -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 PAA04891; Mon, 22 Sep 1997 15:58:51 -0400
Received: by spssunp.spspme.ml.com (SMI-8.6/SMI-4.1)
	id PAA27087; Mon, 22 Sep 1997 15:58:50 -0400
To: Jan Vroonhof <vroonhof@math.ethz.ch>
Cc: XEmacs Beta List <xemacs-beta@xemacs.org>
Subject: [patch] lazy-shot.el
X-Face: D>:hrrB{l6#\wU;)0R:OHSTA@ayd.Oq?s@Rrc;[+z0m+<-U"$G-J6L)F2QY`qK~uPu!s1(6{\#uy!Ag/D)?'L[}xErXvxoPn8T_hKi{M]/(`BF{e}X7;hby`p\.E$rJ}Aff#BT,rdDIw\y
X-Y-Zippy: Yow!  Now we can become alcoholics!
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/signed; protocol="application/pgp-signature";
 boundary="pgp-sign-Multipart_Mon_Sep_22_15:58:44_1997-1"; micalg=pgp-md5
Content-Transfer-Encoding: 7bit
From: Colin Rafferty <craffert@ml.com>
Date: 22 Sep 1997 15:58:50 -0400
Message-ID: <ocrzpp5p1c5.fsf@ml.com>
Lines: 110
X-Mailer: Gnus v5.5/XEmacs 20.3(beta23) - "Sarajevo"

--pgp-sign-Multipart_Mon_Sep_22_15:58:44_1997-1
Content-Type: multipart/mixed;
 boundary="Multipart_Mon_Sep_22_15:58:44_1997-1"
Content-Transfer-Encoding: 7bit

--Multipart_Mon_Sep_22_15:58:44_1997-1
Content-Type: text/plain; charset=US-ASCII

Now that I have started using it, I have found a bug.

The function `lazy-shot-shot-function' does its work in the current
buffer rather than the one on which the extent exists.  Since I am not
familiar at all with the C code, I decided to fix this in the Lisp using 
`with-current-buffer'.

Should a one-shot function be called with the buffer of the extent the
current buffer?  I think so, but as I said, I have no idea how the C
code works.


--Multipart_Mon_Sep_22_15:58:44_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="lisp/ChangeLog"
Content-Transfer-Encoding: 8bit

1997-09-22  Colin Rafferty  <craffert@ml.com>

	* modes/lazy-shot.el (lazy-shot-shot-function): Made it do its
		  work in the correct buffer.  Also, changed obsolete
		  function call to non-obsolete version.


--Multipart_Mon_Sep_22_15:58:44_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="lazy-shot.patch"
Content-Transfer-Encoding: 8bit

*** lisp/modes/lazy-shot.el~	Mon Sep 22 09:50:13 1997
--- lisp/modes/lazy-shot.el	Mon Sep 22 15:47:45 1997
***************
*** 77,97 ****
     "Lazy lock the extent when it has become visisble"
     (let ((start (extent-start-position extent))
           (end   (extent-end-position extent))
! 	 (buffer (extent-buffer extent)))
       (delete-extent extent)
!      (save-excursion 
!        ;; This magic should really go into font-lock-fonity-region
!        (goto-char start)
!        (unless (bolp)
! 	 (beginning-of-line)
! 	 (setq start (point)))
!        (goto-char end)
!        (unless (bolp)
! 	 (forward-line)
! 	 (setq end (point)))
!        (message "Lazy-shot fontifying from %s to %s in %s" start end buffer)
!        (save-match-data
! 	   (font-lock-fontify-region start end)))))
  
  (defun lazy-shot-install-extent (spos epos &optional buffer)
    "Make an extent that will lazy-shot if it is displayed"
--- 77,98 ----
     "Lazy lock the extent when it has become visisble"
     (let ((start (extent-start-position extent))
           (end   (extent-end-position extent))
! 	 (buffer (extent-object extent)))
       (delete-extent extent)
!      (with-current-buffer buffer
!        (save-excursion 
! 	 ;; This magic should really go into font-lock-fonity-region
! 	 (goto-char start)
! 	 (unless (bolp)
! 	   (beginning-of-line)
! 	   (setq start (point)))
! 	 (goto-char end)
! 	 (unless (bolp)
! 	   (forward-line)
! 	   (setq end (point)))
! 	 (message "Lazy-shot fontifying from %s to %s in %s" start end buffer)
! 	 (save-match-data
! 	   (font-lock-fontify-region start end))))))
  
  (defun lazy-shot-install-extent (spos epos &optional buffer)
    "Make an extent that will lazy-shot if it is displayed"

--Multipart_Mon_Sep_22_15:58:44_1997-1
Content-Type: text/plain; charset=US-ASCII

-- 
Colin

--Multipart_Mon_Sep_22_15:58:44_1997-1--

--pgp-sign-Multipart_Mon_Sep_22_15:58:44_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

iQCVAwUBNCbN96CXWENFE/FpAQFK/AQAl/dYnwpfiDLR2zPggYEx4zAoFmmtDZhC
N//BIUa1V55KeOShrjhe5V62MBuNw94EXwC4Uigoa0xWAB+xDpz/Fjz3anljHOg6
68byozo1D34RvXc5j9/mWXo39+pDIIsiQfG9jSxYOnweA57nCodQLqRkqmcFq8k4
9ltau2ptYzc=
=rYag
-----END PGP MESSAGE-----

--pgp-sign-Multipart_Mon_Sep_22_15:58:44_1997-1--

