From xemacs-m  Fri Sep 12 06:02:48 1997
Received: from frege.math.ethz.ch (root@frege-d-math-north-g-west.math.ethz.ch [129.132.145.3])
	by xemacs.org (8.8.5/8.8.5) with SMTP id GAA11765
	for <xemacs-beta@xemacs.org>; Fri, 12 Sep 1997 06:02:47 -0500 (CDT)
Received: from midget (vroonhof@midget [129.132.145.4]) by frege.math.ethz.ch (8.6.12/Main-STAT-mailer) with ESMTP id NAA09709 for <xemacs-beta@xemacs.org>; Fri, 12 Sep 1997 13:02:49 +0200
Received: (vroonhof@localhost) by midget (SMI-8.6/D-MATH-client) id NAA02290; Fri, 12 Sep 1997 13:02:48 +0200
To: xemacs-beta@xemacs.org
Subject: Re: `lazyshot.el': bugfix and comments/questions.
References: <199709120745.AAA17290@bittersweet.inetarena.com>
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=US-ASCII
From: Jan Vroonhof <vroonhof@math.ethz.ch>
Date: 12 Sep 1997 13:02:48 +0200
In-Reply-To: "Karl M. Hegbloom"'s message of Fri, 12 Sep 1997 00:45:52 -0700
Message-ID: <bywwkm4wx3.fsf@midget.math.ethz.ch>
Lines: 86
X-Mailer: Gnus v5.4.55/XEmacs 19.15

"Karl M. Hegbloom" <karlheg@inetarena.com> writes:

>  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.

Thanks for checking this out. Do you notice any flashing?

> +;;(defcustom 
> +(defvar
> +lazy-lock-step-size (* 1 1024)
>
I am not sure whether it is good to let users fiddle with this.
Anyway Lazy-shot.el is an extract of my hacks in lazy-lock 2 and
there the autoloads and stuff are there. However may be it is better
to have a clean start with a rtue new lazy-shot.el file anyway.

> +;; These changes HAVE to be made so it doesn't skip lines.  Try
> +;; loading src/Makefile.in.in and page downing a few times.


Yeah, I noticed that lazy-lock  does this too. However isn't this
really a bug in  font-lock-fontify-region? (At least it could be
documented). May we should just add the code you added there.

> +   (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)

(forward-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

Isn't it better to rewrite this so that we only do one save-excursion?


> +         ;; 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))

The former should work too. However we need an internal
set-extent-one-shot-function anyway because we need to mark the extent
for redisplay so I just exported it to the lisp level too. It is just
a stylistic question. May be a few lisp experts can comment on this.

> +;;; Help!  I don't know how to do this... <punt>

I didn't now either. Your version looks OK. I was thinking of may be
putting the one-shot extents in a buffer local list.
The reason this may be needed is that the real lazy-lock also does
idle time locking therefore it needs to find currently "unlocked"
extents. I am not sure how fast walking through all the extents the
way you do below is. 

> +(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)

This is already done in (lazy-lock-mode 0)

> +  ;; anything else?)

