From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Bug when cycling Date: Thu, 28 Nov 2013 12:15:39 +0100 Message-ID: <8738mgrd44.fsf@bzg.ath.cx> References: <87wqjusq5b.fsf@bzg.ath.cx> <87y549gkm7.fsf@bzg.ath.cx> <87txewu7kd.fsf@gmail.com> <871u20n6lv.fsf@bzg.ath.cx> <87li08u6v6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlzZU-0005id-KZ for emacs-orgmode@gnu.org; Thu, 28 Nov 2013 06:15:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VlzZQ-0003zC-0V for emacs-orgmode@gnu.org; Thu, 28 Nov 2013 06:15:48 -0500 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:41301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VlzZP-0003z6-Q8 for emacs-orgmode@gnu.org; Thu, 28 Nov 2013 06:15:43 -0500 Received: by mail-we0-f179.google.com with SMTP id q59so7913634wes.38 for ; Thu, 28 Nov 2013 03:15:43 -0800 (PST) In-Reply-To: <87li08u6v6.fsf@gmail.com> (Nicolas Goaziou's message of "Thu, 28 Nov 2013 12:02:21 +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: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Hi Nicolas, Nicolas Goaziou writes: > Bastien writes: > >> PS: This is a rather crude fix, don't hesitate to proofread the >> patch just in case. Thanks! > > Actually, I'm rather surprised this problem happens (I wasn't able to > reproduce it FWIW). See the bug in action in this video: https://vimeo.com/80541405 > In `org-cycle-hide-drawers, END is, at the bare minimum, the next > headline. The error happens with the last line > > (goto-char (org-element-property :end drawer)) > > Though, according to Org syntax, a drawer cannot go past a headline (IOW > it cannot contain the headline). Therefore, there's no reason for > (org-element-property :end drawer) to be greater than END. I think END is just one char before the point when the (goto-char ...) expression above is evaluated. > This patch may fix something, but I tend to think that the problem is > elsewhere. Either the parser is wrong (but then, I would have been able > to reproduce the bug), or there's a cache error. > > Assuming you remove your fix for a while, do you have a reproducible > recipe from a fresh Org buffer available? Also, does it happen with > `org-element-use-cache' set to nil? Yes -- with both nil and t the bug is there. Thanks for double-checking! -- Bastien