From mboxrd@z Thu Jan 1 00:00:00 1970 From: david@adboyd.com (J. David Boyd) Subject: Re: How to track down "No heading for this item in buffer or region."? Date: Fri, 25 Jan 2013 11:11:21 -0500 Message-ID: <871ud9w8d2.fsf@adboyd.com> 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> <4630.1359091242@alphaville> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:32778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tylsb-0002Vc-Cj for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 11:11:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TylsU-00080a-6f for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 11:11:49 -0500 Received: from plane.gmane.org ([80.91.229.3]:60114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TylsU-00080J-0K for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 11:11:42 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Tylsh-0001eh-Fg for emacs-orgmode@gnu.org; Fri, 25 Jan 2013 17:11:55 +0100 Received: from 72.185.97.240 ([72.185.97.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Jan 2013 17:11:55 +0100 Received: from david by 72.185.97.240 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Jan 2013 17:11:55 +0100 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: emacs-orgmode@gnu.org Nick Dokos writes: > 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 > > (setq buf (find-file-noselect "/path/to/test.org")) > (with-current-buffer buf > (setq s (buffer-substring 1 2))) > > 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: > > # timestamp: <2013-01-24 Thu> > > * TODO foo > # SCHEDULED: <2013-01-24 Thu> There was a message in here a while back about something like this. I can't find it at the moment, but the author talked about org mode hooks that aren't being run when a file is loaded or moved to from the agenda, only when explicitly loaded. He had a work around for that, but I don't recall that either.... Sorry for no more help than this