[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How debug font lock mode settings and/or view existing font lock mod
From: |
Anselm Helbig |
Subject: |
Re: How debug font lock mode settings and/or view existing font lock mode settings? |
Date: |
Tue, 21 Apr 2009 14:39:01 +0200 |
User-agent: |
SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.7 Emacs/22.3 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
Hi!
> I created my own minor mode that highlights characters beyond column
> 78.
> It works most of the time but sometimes fails like in java mode.
>
> Is it possible to dump the font lock mode settings in a separate
> buffer when it doesn't work to see what is going on?
Well, that should be easy, you either do
M-: font-lock-defaults<RET>
or just put the string "font-lock-defaults" in your java code (most
probably in a comment) and evaluate it there - C-x C-e to see the
result in the echo area and in the *Messages* buffer, C-u C-x C-e to
dump it right into the current buffer.
You could also write a function that writes the settings into some
other buffer,
(defun debug-font-lock ()
(let ((copy-of-font-lock-defaults font-lock-defaults))
(save-excursion
(set-buffer (get-buffer-create "*debug-font-lock*"))
(goto-char (point-max))
(insert (format "%s" copy-of-font-lock-defaults)))))
and then call
M-: (debug-font-lock)
when you're in your java buffer. There might be more elegant ways to
do this. 8-)
HTH, kind regards,
Anselm
--
Anselm Helbig
mailto:anselm.helbig+news2009@googlemail.com