emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug when cycling
@ 2013-11-26 23:24 Bastien
  2013-11-28  5:29 ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2013-11-26 23:24 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

with latest master and the file below, hitting TAB at the beginning
of the headline will produce the attached backtrace.

* Test
  SCHEDULED: <2013-11-25 lun.>
  :PROPERTIES:
  :CAPTURED: [2013-11-08 ven. 18:13]
  :END:

Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)")
  re-search-forward("^[ 	]*:\\(\\(?:\\w\\|[-_]\\)+\\):[ 	]*$" 2256 t)
  (while (re-search-forward org-drawer-regexp end t) (if (member-ignore-case (match-string 1) exceptions) nil (let ((drawer (org-element-at-point))) (if (memq (org-element-type drawer) (quote (drawer property-drawer))) (progn (org-flag-drawer t drawer) (goto-char (org-element-property :end drawer)))))))
  (let* ((globalp (memq state (quote (contents all)))) (beg (if globalp (point-min) (point))) (end (if globalp (point-max) (if (eq state (quote children)) (save-excursion (outline-next-heading) (point)) (org-end-of-subtree t))))) (goto-char beg) (while (re-search-forward org-drawer-regexp end t) (if (member-ignore-case (match-string 1) exceptions) nil (let ((drawer (org-element-at-point))) (if (memq (org-element-type drawer) (quote (drawer property-drawer))) (progn (org-flag-drawer t drawer) (goto-char (org-element-property :end drawer))))))))
  (save-excursion (let* ((globalp (memq state (quote (contents all)))) (beg (if globalp (point-min) (point))) (end (if globalp (point-max) (if (eq state (quote children)) (save-excursion (outline-next-heading) (point)) (org-end-of-subtree t))))) (goto-char beg) (while (re-search-forward org-drawer-regexp end t) (if (member-ignore-case (match-string 1) exceptions) nil (let ((drawer (org-element-at-point))) (if (memq (org-element-type drawer) (quote ...)) (progn (org-flag-drawer t drawer) (goto-char ...))))))))
  (progn (save-excursion (let* ((globalp (memq state (quote (contents all)))) (beg (if globalp (point-min) (point))) (end (if globalp (point-max) (if (eq state ...) (save-excursion ... ...) (org-end-of-subtree t))))) (goto-char beg) (while (re-search-forward org-drawer-regexp end t) (if (member-ignore-case (match-string 1) exceptions) nil (let ((drawer ...)) (if (memq ... ...) (progn ... ...))))))))
  (if (and (derived-mode-p (quote org-mode)) (not (memq state (quote (overview folded contents))))) (progn (save-excursion (let* ((globalp (memq state (quote ...))) (beg (if globalp (point-min) (point))) (end (if globalp (point-max) (if ... ... ...)))) (goto-char beg) (while (re-search-forward org-drawer-regexp end t) (if (member-ignore-case (match-string 1) exceptions) nil (let (...) (if ... ...))))))))
  org-cycle-hide-drawers(subtree)
  run-hook-with-args(org-cycle-hide-drawers subtree)
  (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook) (quote subtree)))
  (cond ((= eos eoh) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-pre-cycle-hook) (quote empty))) (org-unlogged-message "EMPTY ENTRY") (setq org-cycle-subtree-status nil) (save-excursion (goto-char eos) (outline-next-heading) (if (outline-invisible-p) (org-flag-heading nil)))) ((and (or (>= eol eos) (not (string-match "\\S-" (buffer-substring eol eos)))) (or has-children (not (setq children-skipped org-cycle-skip-children-state-if-no-children)))) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-pre-cycle-hook) (quote children))) (if (org-at-item-p) (org-list-set-item-visibility (point-at-bol) struct (quote children)) (org-show-entry) (let* ((org-called-with-limited-levels t) (org-outline-regexp (org-get-limited-outline-regexp)) (outline-regexp org-outline-regexp) (org-outline-regexp-bol (concat "^" org-outline-regexp))) (show-children)) (if (eq org-cycle-include-plain-lists (quote integrate)) (progn (save-excursion (org-back-to-heading) (while (org-list-search-forward ... eos t) (beginning-of-line 1) (let* ... ... ...)))))) (org-unlogged-message "CHILDREN") (save-excursion (goto-char eos) (outline-next-heading) (if (outline-invisible-p) (org-flag-heading nil))) (setq org-cycle-subtree-status (quote children)) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook) (quote children)))) ((or children-skipped (and (eq last-command this-command) (eq org-cycle-subtree-status (quote children)))) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-pre-cycle-hook) (quote subtree))) (outline-flag-region eoh eos nil) (org-unlogged-message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE")) (setq org-cycle-subtree-status (quote subtree)) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook) (quote subtree)))) (t (run-hook-with-args (quote org-pre-cycle-hook) (quote folded)) (outline-flag-region eoh eos t) (org-unlogged-message "FOLDED") (setq org-cycle-subtree-status (quote folded)) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook) (quote folded)))))
  (let ((goal-column 0) eoh eol eos has-children children-skipped struct) (save-excursion (if (org-at-item-p) (progn (beginning-of-line) (setq struct (org-list-struct)) (setq eoh (point-at-eol)) (setq eos (org-list-get-item-end-before-blank (point) struct)) (setq has-children (org-list-has-child-p (point) struct))) (org-back-to-heading) (setq eoh (save-excursion (outline-end-of-heading) (point))) (setq eos (save-excursion (1- (org-end-of-subtree t t)))) (setq has-children (or (save-excursion (let (...) (outline-next-heading) (and ... ...))) (save-excursion (org-list-search-forward (org-item-beginning-re) eos t))))) (beginning-of-line 2) (if nil (while (and (not (eobp)) (get-char-property (1- (point)) (quote invisible))) (beginning-of-line 2)) (while (and (not (eobp)) (get-char-property (1- (point)) (quote invisible))) (goto-char (next-single-char-property-change (point) (quote invisible))) (and (eolp) (beginning-of-line 2)))) (setq eol (point))) (cond ((= eos eoh) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-pre-cycle-hook) (quote empty))) (org-unlogged-message "EMPTY ENTRY") (setq org-cycle-subtree-status nil) (save-excursion (goto-char eos) (outline-next-heading) (if (outline-invisible-p) (org-flag-heading nil)))) ((and (or (>= eol eos) (not (string-match "\\S-" (buffer-substring eol eos)))) (or has-children (not (setq children-skipped org-cycle-skip-children-state-if-no-children)))) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-pre-cycle-hook) (quote children))) (if (org-at-item-p) (org-list-set-item-visibility (point-at-bol) struct (quote children)) (org-show-entry) (let* ((org-called-with-limited-levels t) (org-outline-regexp (org-get-limited-outline-regexp)) (outline-regexp org-outline-regexp) (org-outline-regexp-bol (concat "^" org-outline-regexp))) (show-children)) (if (eq org-cycle-include-plain-lists (quote integrate)) (progn (save-excursion (org-back-to-heading) (while ... ... ...))))) (org-unlogged-message "CHILDREN") (save-excursion (goto-char eos) (outline-next-heading) (if (outline-invisible-p) (org-flag-heading nil))) (setq org-cycle-subtree-status (quote children)) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook) (quote children)))) ((or children-skipped (and (eq last-command this-command) (eq org-cycle-subtree-status (quote children)))) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-pre-cycle-hook) (quote subtree))) (outline-flag-region eoh eos nil) (org-unlogged-message (if children-skipped "SUBTREE (NO CHILDREN)" "SUBTREE")) (setq org-cycle-subtree-status (quote subtree)) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook) (quote subtree)))) (t (run-hook-with-args (quote org-pre-cycle-hook) (quote folded)) (outline-flag-region eoh eos t) (org-unlogged-message "FOLDED") (setq org-cycle-subtree-status (quote folded)) (if (org-before-first-heading-p) nil (run-hook-with-args (quote org-cycle-hook) (quote folded))))))
  org-cycle-internal-local()
  (cond ((equal arg (quote (16))) (setq last-command (quote dummy)) (org-set-startup-visibility) (org-unlogged-message "Startup visibility, plus VISIBILITY properties")) ((equal arg (quote (64))) (show-all) (org-unlogged-message "Entire buffer visible, including drawers")) ((org-at-table-p (quote any)) (if (org-at-table\.el-p) (message "Use C-c ' to edit table.el tables") (if arg (org-table-edit-field t) (org-table-justify-field-maybe) (call-interactively (quote org-table-next-field))))) ((run-hook-with-args-until-success (quote org-tab-after-check-for-table-hook))) ((eq arg t) (org-cycle-internal-global)) ((save-excursion (beginning-of-line 1) (looking-at org-drawer-regexp)) (org-flag-drawer (not (get-char-property (match-end 0) (quote invisible))))) ((integerp arg) (save-excursion (org-back-to-heading) (outline-up-heading (if (< arg 0) (- arg) (- (funcall outline-level) arg))) (org-show-subtree))) ((and (featurep (quote org-inlinetask)) (org-inlinetask-at-task-p) (or (bolp) (not (eq org-cycle-emulate-tab (quote exc-hl-bol))))) (org-inlinetask-toggle-visibility)) ((org-try-cdlatex-tab)) ((and (or (and org-cycle-include-plain-lists (org-at-item-p)) (save-excursion (beginning-of-line 1) (looking-at org-outline-regexp))) (or (bolp) (not (eq org-cycle-emulate-tab (quote exc-hl-bol))))) (org-cycle-internal-local)) (buffer-read-only (org-back-to-heading)) ((run-hook-with-args-until-success (quote org-tab-after-check-for-cycling-hook))) ((org-try-structure-completion)) ((run-hook-with-args-until-success (quote org-tab-before-tab-emulation-hook))) ((and (eq org-cycle-emulate-tab (quote exc-hl-bol)) (or (not (bolp)) (not (looking-at org-outline-regexp)))) (call-interactively (global-key-binding "	"))) ((if (and (memq org-cycle-emulate-tab (quote (white whitestart))) (save-excursion (beginning-of-line 1) (looking-at "[ 	]*")) (or (and (eq org-cycle-emulate-tab (quote white)) (= (match-end 0) (point-at-eol))) (and (eq org-cycle-emulate-tab (quote whitestart)) (>= (match-end 0) pos)))) t (eq org-cycle-emulate-tab t)) (call-interactively (global-key-binding "	"))) (t (save-excursion (org-back-to-heading) (org-cycle))))
  (let* ((limit-level (or org-cycle-max-level (and (boundp (quote org-inlinetask-min-level)) org-inlinetask-min-level (1- org-inlinetask-min-level)))) (nstars (and limit-level (if org-odd-levels-only (and limit-level (1- (* limit-level 2))) limit-level))) (org-outline-regexp (if (not (derived-mode-p (quote org-mode))) outline-regexp (concat "\\*" (if nstars (format "\\{1,%d\\} " nstars) "+ ")))) (bob-special (and org-cycle-global-at-bob (not arg) (bobp) (not (looking-at org-outline-regexp)))) (org-cycle-hook (if bob-special (delq (quote org-optimize-window-after-visibility-change) (copy-sequence org-cycle-hook)) org-cycle-hook)) (pos (point))) (if (or bob-special (equal arg (quote (4)))) (setq arg t)) (cond ((equal arg (quote (16))) (setq last-command (quote dummy)) (org-set-startup-visibility) (org-unlogged-message "Startup visibility, plus VISIBILITY properties")) ((equal arg (quote (64))) (show-all) (org-unlogged-message "Entire buffer visible, including drawers")) ((org-at-table-p (quote any)) (if (org-at-table\.el-p) (message "Use C-c ' to edit table.el tables") (if arg (org-table-edit-field t) (org-table-justify-field-maybe) (call-interactively (quote org-table-next-field))))) ((run-hook-with-args-until-success (quote org-tab-after-check-for-table-hook))) ((eq arg t) (org-cycle-internal-global)) ((save-excursion (beginning-of-line 1) (looking-at org-drawer-regexp)) (org-flag-drawer (not (get-char-property (match-end 0) (quote invisible))))) ((integerp arg) (save-excursion (org-back-to-heading) (outline-up-heading (if (< arg 0) (- arg) (- (funcall outline-level) arg))) (org-show-subtree))) ((and (featurep (quote org-inlinetask)) (org-inlinetask-at-task-p) (or (bolp) (not (eq org-cycle-emulate-tab (quote exc-hl-bol))))) (org-inlinetask-toggle-visibility)) ((org-try-cdlatex-tab)) ((and (or (and org-cycle-include-plain-lists (org-at-item-p)) (save-excursion (beginning-of-line 1) (looking-at org-outline-regexp))) (or (bolp) (not (eq org-cycle-emulate-tab (quote exc-hl-bol))))) (org-cycle-internal-local)) (buffer-read-only (org-back-to-heading)) ((run-hook-with-args-until-success (quote org-tab-after-check-for-cycling-hook))) ((org-try-structure-completion)) ((run-hook-with-args-until-success (quote org-tab-before-tab-emulation-hook))) ((and (eq org-cycle-emulate-tab (quote exc-hl-bol)) (or (not (bolp)) (not (looking-at org-outline-regexp)))) (call-interactively (global-key-binding "	"))) ((if (and (memq org-cycle-emulate-tab (quote (white whitestart))) (save-excursion (beginning-of-line 1) (looking-at "[ 	]*")) (or (and (eq org-cycle-emulate-tab ...) (= ... ...)) (and (eq org-cycle-emulate-tab ...) (>= ... pos)))) t (eq org-cycle-emulate-tab t)) (call-interactively (global-key-binding "	"))) (t (save-excursion (org-back-to-heading) (org-cycle)))))
  (if (or (run-hook-with-args-until-success (quote org-tab-first-hook)) (and org-cycle-level-after-item/entry-creation (or (org-cycle-level) (org-cycle-item-indentation)))) nil (let* ((limit-level (or org-cycle-max-level (and (boundp (quote org-inlinetask-min-level)) org-inlinetask-min-level (1- org-inlinetask-min-level)))) (nstars (and limit-level (if org-odd-levels-only (and limit-level (1- ...)) limit-level))) (org-outline-regexp (if (not (derived-mode-p (quote org-mode))) outline-regexp (concat "\\*" (if nstars (format "\\{1,%d\\} " nstars) "+ ")))) (bob-special (and org-cycle-global-at-bob (not arg) (bobp) (not (looking-at org-outline-regexp)))) (org-cycle-hook (if bob-special (delq (quote org-optimize-window-after-visibility-change) (copy-sequence org-cycle-hook)) org-cycle-hook)) (pos (point))) (if (or bob-special (equal arg (quote (4)))) (setq arg t)) (cond ((equal arg (quote (16))) (setq last-command (quote dummy)) (org-set-startup-visibility) (org-unlogged-message "Startup visibility, plus VISIBILITY properties")) ((equal arg (quote (64))) (show-all) (org-unlogged-message "Entire buffer visible, including drawers")) ((org-at-table-p (quote any)) (if (org-at-table\.el-p) (message "Use C-c ' to edit table.el tables") (if arg (org-table-edit-field t) (org-table-justify-field-maybe) (call-interactively (quote org-table-next-field))))) ((run-hook-with-args-until-success (quote org-tab-after-check-for-table-hook))) ((eq arg t) (org-cycle-internal-global)) ((save-excursion (beginning-of-line 1) (looking-at org-drawer-regexp)) (org-flag-drawer (not (get-char-property (match-end 0) (quote invisible))))) ((integerp arg) (save-excursion (org-back-to-heading) (outline-up-heading (if (< arg 0) (- arg) (- ... arg))) (org-show-subtree))) ((and (featurep (quote org-inlinetask)) (org-inlinetask-at-task-p) (or (bolp) (not (eq org-cycle-emulate-tab ...)))) (org-inlinetask-toggle-visibility)) ((org-try-cdlatex-tab)) ((and (or (and org-cycle-include-plain-lists (org-at-item-p)) (save-excursion (beginning-of-line 1) (looking-at org-outline-regexp))) (or (bolp) (not (eq org-cycle-emulate-tab ...)))) (org-cycle-internal-local)) (buffer-read-only (org-back-to-heading)) ((run-hook-with-args-until-success (quote org-tab-after-check-for-cycling-hook))) ((org-try-structure-completion)) ((run-hook-with-args-until-success (quote org-tab-before-tab-emulation-hook))) ((and (eq org-cycle-emulate-tab (quote exc-hl-bol)) (or (not (bolp)) (not (looking-at org-outline-regexp)))) (call-interactively (global-key-binding "	"))) ((if (and (memq org-cycle-emulate-tab (quote ...)) (save-excursion (beginning-of-line 1) (looking-at "[ 	]*")) (or (and ... ...) (and ... ...))) t (eq org-cycle-emulate-tab t)) (call-interactively (global-key-binding "	"))) (t (save-excursion (org-back-to-heading) (org-cycle))))))
  org-cycle(nil)
  call-interactively(org-cycle nil nil)
  command-execute(org-cycle)

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug when cycling
  2013-11-26 23:24 Bug when cycling Bastien
@ 2013-11-28  5:29 ` Bastien
  2013-11-28 10:47   ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2013-11-28  5:29 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> with latest master and the file below, hitting TAB at the beginning
> of the headline will produce the attached backtrace.

I just fixed this:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=c811bb

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug when cycling
  2013-11-28  5:29 ` Bastien
@ 2013-11-28 10:47   ` Nicolas Goaziou
  2013-11-28 10:49     ` Bastien
  0 siblings, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2013-11-28 10:47 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Hello,

Bastien <bzg@gnu.org> writes:

> Bastien <bzg@gnu.org> writes:
>
>> with latest master and the file below, hitting TAB at the beginning
>> of the headline will produce the attached backtrace.
>
> I just fixed this:
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=c811bb

Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug when cycling
  2013-11-28 10:47   ` Nicolas Goaziou
@ 2013-11-28 10:49     ` Bastien
  2013-11-28 11:02       ` Nicolas Goaziou
  0 siblings, 1 reply; 8+ messages in thread
From: Bastien @ 2013-11-28 10:49 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

>> I just fixed this:
>> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=c811bb
>
> Thank you.

PS: This is a rather crude fix, don't hesitate to proofread the
patch just in case.  Thanks!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug when cycling
  2013-11-28 10:49     ` Bastien
@ 2013-11-28 11:02       ` Nicolas Goaziou
  2013-11-28 11:15         ` Bastien
  2013-11-28 11:17         ` Nicolas Goaziou
  0 siblings, 2 replies; 8+ messages in thread
From: Nicolas Goaziou @ 2013-11-28 11:02 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Bastien <bzg@gnu.org> 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).

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.

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?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug when cycling
  2013-11-28 11:02       ` Nicolas Goaziou
@ 2013-11-28 11:15         ` Bastien
  2013-11-28 11:17         ` Nicolas Goaziou
  1 sibling, 0 replies; 8+ messages in thread
From: Bastien @ 2013-11-28 11:15 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Hi Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Bastien <bzg@gnu.org> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug when cycling
  2013-11-28 11:02       ` Nicolas Goaziou
  2013-11-28 11:15         ` Bastien
@ 2013-11-28 11:17         ` Nicolas Goaziou
  2013-11-28 11:30           ` Bastien
  1 sibling, 1 reply; 8+ messages in thread
From: Nicolas Goaziou @ 2013-11-28 11:17 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Bastien <bzg@gnu.org> 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).
>
> 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.
>
> 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?

Nevermind. I mixed (org-end-of-subtree t) and (org-end-of-subtree t t).

(org-element-property :end drawer) will always go past empty headlines
at the end of the drawer, but `org-end-of-subtree' won't.

Anyway the patch is correct, or we can use (org-end-of-subtree t t)
instead of (max (point) end). The difference is negligible in practice.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Bug when cycling
  2013-11-28 11:17         ` Nicolas Goaziou
@ 2013-11-28 11:30           ` Bastien
  0 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2013-11-28 11:30 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Hello,

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Anyway the patch is correct, or we can use (org-end-of-subtree t t)
> instead of (max (point) end). The difference is negligible in practice.

Okay, thanks for confirming!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-11-28 11:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-26 23:24 Bug when cycling Bastien
2013-11-28  5:29 ` Bastien
2013-11-28 10:47   ` Nicolas Goaziou
2013-11-28 10:49     ` Bastien
2013-11-28 11:02       ` Nicolas Goaziou
2013-11-28 11:15         ` Bastien
2013-11-28 11:17         ` Nicolas Goaziou
2013-11-28 11:30           ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).