[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emacs-wiki-discuss] Re: trouble using diary
From: |
Sacha Chua |
Subject: |
[emacs-wiki-discuss] Re: trouble using diary |
Date: |
Mon, 14 Jun 2004 21:11:28 +0800 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) |
Ray Fix <address@hidden> writes:
> I am having trouble using diary. I know this is most likely pilot
> error on my part but I am stumped.
I figured out why (planner-diary-entries-here) works after the page
has been loaded, but not on initial load. Here's the culprit: during
the very first call to emacs-wiki-highlight-buffer, buffer-file-name
is nil. Why? Beats me.
This is also the reason why some <lisp>(...)</lisp> didn't get marked
up before. It wasn't that font-lock-support-mode was being too clever;
it just ran into an error.
I've tested this by switching a buffer from fundamental mode to
emacs-wiki-mode. I don't know why the buffer file name disappears
during a mode switch to emacs-wiki. I used this totally fake mode to test
if buffer-file-name is accessible during a mode switch:
(define-derived-mode funky-test nil "Funky"
"Fake mode for testing if this works."
(insert (buffer-file-name)))
and that worked, so either it's in the font-locking or something else
is screwing up. AHA! Using this even stranger funky-test method:
(define-derived-mode funky-test nil "Funky"
"Fake mode for testing if this works."
(set (make-local-variable 'font-lock-fontify-buffer-function)
'funky-test-highlight-buffer))
(defun funky-test-highlight-buffer ()
(message "The filename is %s" (buffer-file-name))
I get
The filename is nil
"The filename is nil"
switching from fundamental to funky-test-mode. I only get "The
filename is ....." when I call font-lock-fontify-buffer with the
buffer already in the right place.
So this points to a somewhat deeper bug still present in Emacs CVS as
of 2004-04-04 (ack! ancient!). I'm going to update tomorrow and see
what happens.
In the meantime, please try the rewriting method.
--
Sacha Chua <address@hidden> - Ateneo CS faculty geekette
interests: emacs, gnu/linux, making computer science education fun
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C