Mats Lidell <matsl(a)xemacs.org> writes:
>>>>> Aidan wrote:
 Aidan> C-x 4 F lazy-lock-pre-idle-fontify-windows RET , then copy the
 Aidan> function into *scratch*, and put in a (message ) just after the
 Aidan> "(while t " that says which frame is being fontified and
 Aidan> whether the current buffer is the initial (current-buffer).
 After doing that I went down the callstack and changed
 (defun lazy-lock-maybe-fontify-frame (frame)
   ;; Fontify the given frame if we need to.  We first check the
   ;; appropriate frame-modified-tick to avoid changing global state.
   ;(dp "fontify-frame %s" frame)
   (let ((tick (frame-modified-tick frame))
 	(buf (current-buffer))  <--
 	(buf-name (buffer-name))) <--
     ;(dp tick)
     (unless (eq tick (gethash frame lazy-lock-frame-modiff-cache))
       (puthash frame tick lazy-lock-frame-modiff-cache)
       ;; We have to select the frame due to a bug in walk-windows in XEmacs
       ;; 21.4.
       (with-selected-frame frame
 	(walk-windows #'lazy-lock-fontify-window 'no-minibuf frame))
       (if (not (eq (current-buffer) buf)) (debug-print (concat
"Lazy-lock-maybe:" (frame-name) " Expected buf = " buf-name " but
got " (buffer-name)))) <--
       )))
 By inserting the lines marked with '<--' and using debug-print instead
 of message. So now I can see things like:
 Lazy-lock-maybe:XEmacs Expected buf = <BUFFER-NAME> but got
<NOT-SAME-BUFFER-NAME> 
Hi Mats,
why don't you post a sample log if you don't mind.
Including a timestamp would provide useful information too.
I use this to report loading of my init file:
(defun apa-loading-message (where)
  "Print message including filename, user-defined string, and time
  during loading.
The message is of the form:
Loading of FILE WHERE
at TIME-STRING TIME TIME-ZONE"
  (if load-in-progress
      (message "Loading of %s %s\nat %s %+.4d (%s)"
               load-file-name
               where
               (current-time-string)
               (/
                (nth 0
                     (current-time-zone))
                36)
               (nth 1
                    (current-time-zone)))))
 Conclusion: After walk-windows the buffer is changed. Now what!?
 Yours 
-- 
Adrian Aichner
 mailto:adrianï¼ xemacs.org
 
http://www.xemacs.org/