emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Use font-lock-support-mode rather than calling lazy-lock-mode"


From: ishikawa
Subject: "Use font-lock-support-mode rather than calling lazy-lock-mode"
Date: Mon, 20 Nov 2006 16:01:06 +0900
User-agent: Thunderbird 1.5.0.8 (X11/20061025)

Hi,

I tried emacs pretest version 22.0.90 by downloading it from
alpha.gnu.org ftp site.

OS: GNU/Linux 2.6.18 on an i686 CPU notebook PC.

It works just fine except for one annoying thing.

I get the following warning many times.
"Use font-lock-support-mode rather than calling lazy-lock-mode"

Obviously lazy-lock features is now being preceded by jit-lock
features in the 22.0.90 release.
To plod the users of old lazy-lock features, lazy-lock
now has this code inside a function, called lazy-lock-mode,
to print the warning message.

e.g.:
obsolete/lazy-lock.el:

(defun lazy-lock-mode (&optional arg)
       ...
    (cond ((and now-on (not font-lock-mode))
           ;; Turned on `lazy-lock-mode' rather than `font-lock-mode'.
           (message "Use font-lock-support-mode rather than calling 
lazy-lock-mode")
           (sit-for 2))

Now, I tried in vain to figure out where the lazy-lock-mode is
possibly set in *my own library files. and/or impoted from emacs archive*.

(Having a variable, *not* function, of the same name "lazy-lock-mode"
confused me greatly in this to-be-obsoleted code, but I digress.)

Anyway, it was not clear to me where the function was invoked.
After reading the code for a while, I did the following modification
and now the warning went away. Basically, I disabled setting a global flag
variable, lazy-lock-mode, not to be set via turn-on-lazy-lock.

diff -cibw lazy-lock.el~ lazy-lock.el
*** lazy-lock.el~       2006-02-08 07:37:35.000000000 +0900
--- lazy-lock.el        2006-11-20 12:00:41.000000000 +0900
***************
*** 540,546 ****
  ;;;###autoload
  (defun turn-on-lazy-lock ()
    "Unconditionally turn on Lazy Lock mode."
!   (lazy-lock-mode t))

  (defun lazy-lock-install ()
    (let ((min-size (font-lock-value-in-major-mode lazy-lock-minimum-size))
--- 540,546 ----
  ;;;###autoload
  (defun turn-on-lazy-lock ()
    "Unconditionally turn on Lazy Lock mode."
!   (jit-lock-mode t))

  (defun lazy-lock-install ()
    (let ((min-size (font-lock-value-in-major-mode lazy-lock-minimum-size))
address@hidden

So my conclusion is that some code snippets somewhere in the files loaded during
the startup of emacs (+ .emacs initializtion) using my load path
call(s) turn-on-lazy-lock function to set lazy-lock-mode to non-nil.

But then again, I am not sure where turn-on-lazy-lock is called exactly.
(This checking process can go on many times.)
So I am wondering. Is there a way to print the
calling function of turn-on-lazy-lock
a la the following code snippet? (Or is there a debug feature with which
I can place a breakpoint on turn-on-lazy-lock and take a look at
the stack trace?)

(defun turn-on-lazy-lock ()
       ... obtain the caller function name if possible ...
           (message "turn-on-lazy-lock called from %s" function-name)
           (sit-for 2))










reply via email to

[Prev in Thread] Current Thread [Next in Thread]