From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: How to track down "No heading for this item in buffer or region."? Date: Fri, 25 Jan 2013 00:20:42 -0500 Message-ID: <4630.1359091242@alphaville> References: <20130124123204.GB24543@boo.workgroup> <87y5fioimf.fsf@bzg.ath.cx> <20130124162311.GE24543@boo.workgroup> <87libipeot.fsf@bzg.ath.cx> <4467.1359056138@alphaville.americas.hpqcorp.net> <8738xqpbo4.fsf@bzg.ath.cx> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tybif-0002vQ-0B for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 00:20:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TybiZ-0000oK-Ei for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 00:20:52 -0500 Received: from g1t0028.austin.hp.com ([15.216.28.35]:1605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TybiZ-0000oC-74 for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 00:20:47 -0500 In-Reply-To: Message from Bastien of "Thu, 24 Jan 2013 21:29:31 +0100." <8738xqpbo4.fsf@bzg.ath.cx> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode , Carsten Dominik Bastien wrote: > Nick Dokos 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---