From xemacs-m  Fri Sep 12 02:45:58 1997
Received: from bittersweet.inetarena.com (karlheg@bittersweet.inetarena.com [206.129.216.38])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id CAA11347
	for <xemacs-beta@xemacs.org>; Fri, 12 Sep 1997 02:45:56 -0500 (CDT)
Received: (from karlheg@localhost)
	by bittersweet.inetarena.com (8.8.7/8.8.7/Debian/GNU) id AAA17290;
	Fri, 12 Sep 1997 00:45:52 -0700
Date: Fri, 12 Sep 1997 00:45:52 -0700
Message-Id: <199709120745.AAA17290@bittersweet.inetarena.com>
From: "Karl M. Hegbloom" <karlheg@inetarena.com>
To: XEmacs Beta <xemacs-beta@xemacs.org>
Subject: `lazyshot.el': bugfix and comments/questions.
X-Face: /Q}=yl}1_v7nP)xXo5XjG8+tl@=uVu7o5u6)f]zN?+<hB!K.m9:[|*p34jVN`O;:XZXVSy>/\R>qDt(t8w!-i{(y0"`jFw^uk8inzO9wXabd'CdjUWfC\GHi:6nO*YC89#-qD>Q4r%9!V"<RYJ=7D#$";q=zML5'!=wvXk^$`6FT=5CMofQX)WUKt0p:OKl.mFOXx/D
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: multipart/mixed;
 boundary="Multipart_Fri_Sep_12_00:45:51_1997-1"
Content-Transfer-Encoding: 7bit

--Multipart_Fri_Sep_12_00:45:51_1997-1
Content-Type: text/plain; charset=US-ASCII


 This isn't meant to be a real patch, except for the fixes in
`lazy-lock-shot-function' which make it not skip lighting lines where
the point lands midline at the end of the one-shot extents.
Otherwise, it's working well.

 I have several questions that I've put into comments in this diff.

--- lazyshot.el.orig	Fri Sep 12 00:42:27 1997
+++ lazyshot.el	Fri Sep 12 00:41:12 1997
@@ -2,10 +2,17 @@
 
 (defvar lazy-lock-mode nil)
 
+;;(defcustom 
+(defvar
+lazy-lock-step-size (* 1 1024)
+  "Size of the extents that trigger highlighting when displayed.
+Please test diffent sizes."
+)
+;;  :group '?  where do these belong?
+;;  )
 
-(defvar lazy-lock-step-size (* 1 1024)) ;; Please test diffent sizes
-
-
+;;; Should this autoload go here?
+;;;###autoload
 (defun lazy-lock-mode (&optional arg)
   "Toggle Lazy Lock mode.
 With arg, turn Lazy Lock mode on if and only if arg is positive."
@@ -28,23 +35,38 @@
   "Unconditionally turn on Lazy Lock mode."
   (lazy-lock-mode t))
 
-
+;; These changes HAVE to be made so it doesn't skip lines.  Try
+;; loading src/Makefile.in.in and page downing a few times.
 (defun lazy-lock-shot-function (extent)
    "Lazy lock the extent when it has become visisble"
-   (let ((start (extent-start-position extent))
-         (end   (extent-end-position extent))
+   (let ((start (save-excursion
+                  (progn
+                    (goto-char (extent-start-position extent))
+                    (beginning-of-line)
+                    (point))))
+         (end   (save-excursion
+                  (progn
+                    (goto-char (extent-end-position extent))
+                    (beginning-of-line)
+                    (point))))
 	 (buffer (extent-buffer extent))
 	 font-lock-f)
-     (delete-extent extent)     
+     (delete-extent extent)
      (message "Lazy-shot fontifying from %s to %s in %s" start end buffer)
      (save-excursion
       (save-match-data
        (font-lock-fontify-region start end)))))
 
 (defun lazy-lock-install-extent (spos epos &optional buffer)
-  "Make an extent that will lazy-lock if it is displayed"
+  "Make an extent that will lazy-lock if it is displayed."
      (let ((extent (make-extent spos epos buffer)))
        (when extent
+         ;; Why can't it just be:
+         ;;(set-extent-property extent
+         ;;                     'one-shot-function
+         ;;                     'lazy-lock-shot-function)
+         ;; or
+         ;; (setf (extent-property extent) 'thing value)
          (set-extent-one-shot-function extent
                        'lazy-lock-shot-function))
        extent))
@@ -64,6 +86,20 @@
   (setq font-lock-fontified t)
   (lazy-lock-install-extents font-lock-fontified))
 
+;;; Help!  I don't know how to do this... <punt>
+(defun lazy-lock-unstall ()
+  (map-extents #'(lambda (ext)
+                   (when (eq 'lazy-lock-shot-function
+                             (extent-property ext 'one-shot-function))
+                     ;; and why isn't this extent-delete, for M-Tab
+                     ;; `completion'?  It seems inconsistent and
+                     ;; dyslexic way this.
+                     (delete-extent ext))))
+  (setq lazy-lock-mode nil)
+  ;; anything else?)
+
+
+(add-minor-mode 'lazy-lock-mode lazyshot-modeline-string)
 
 (provide 'lazy-lock)
 

--Multipart_Fri_Sep_12_00:45:51_1997-1
Content-Type: text/plain; charset=US-ASCII

mailto:karlheg@inetarena.com (Karl M. Hegbloom)
http://www.inetarena.com/~karlheg
Portland, OR  USA
Debian GNU 1.3.1+hamm  Linux pre-2.0.31-9+select+QNX  AMD K5 PR-133

--Multipart_Fri_Sep_12_00:45:51_1997-1--

