Bastien <b...@altern.org> wrote: > Nick Dokos <nicholas.do...@hp.com> writes: > > > to try to reproduce Rainer's problem, when I first construct the agenda, > > I get *both* the TODO and the no-heading message: text properties are not > > active. If I then visit the file (e.g. RET on the TODO item) and construct > > the agenda again, neither the TODO nor the no-heading message > > appears. > > I see -- it was not obvious to me you were trying without opening the > file in a buffer. With my patch, I can reproduce the error, but only > the TODO (which appears instead of being skipped, not with the > timestamp line. Yes, seems related to properties. I'll digg further. >
Not quite: the file *is* opened in a buffer (the agenda code opens all the files, I presume with find-file-noselect), but the text properties are not up to date. It's only when I explicitly visit the buffer that they get updated. E.g. if you evaluate --8<---------------cut here---------------start------------->8--- (setq buf (find-file-noselect "/path/to/test.org")) (with-current-buffer buf (setq s (buffer-substring 1 2))) --8<---------------cut here---------------end--------------->8--- the echo area shows ,---- | #("#" 0 1 (fontified nil)) `---- But if you visit the buffer with C-x b test.org RET and then evaluate the second form again, you get ,---- | #("#" 0 1 (fontified t font-lock-fontified t face font-lock-comment-face)) `---- There is a section on lazy properties in the elisp manual but I don't know how to use the mechanism described there: there are no examples in current emacs code, some half-hearted experiments failed for unknown reasons, and googling a bit found only one relevant thread in the emacs group from 2004 - quoting Stefan Monnier from that thread: #+BEGIN_QUOTE I think the lazy text properties that you refer to (i.e. variable buffer-access-fontify-functions) are a sadly perfect example of C code implemented before we knew what we needed. It's implemented, documented, and 100% unused. #+END_QUOTE AFAICT, nothing has been done in this area since then. Nick PS. Here's the trivial test.org again for completeness: --8<---------------cut here---------------start------------->8--- # timestamp: <2013-01-24 Thu> * TODO foo # SCHEDULED: <2013-01-24 Thu> --8<---------------cut here---------------end--------------->8---