diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-03-17 13:01:06 +0100 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2011-03-23 18:33:05 +0100 |
commit | 051b5b291cb3dbe6b7dba68fc8da5451e2546953 (patch) | |
tree | 3006e536f9f56636ab5e54bf5da060312cfc05ad | |
parent | 1c0d592463632293aa4e5685abdcb5732b3c7fe9 (diff) | |
download | org-mode-051b5b291cb3dbe6b7dba68fc8da5451e2546953.tar.gz |
org-list: fix infinite loop on erroneous block and drawer constructs
* lisp/org-list.el (org-list-struct,org-in-item-p): don't assume end
of blocks or drawers necessarily start somewhere. It it isn't the
case, treat them as normal text.
-rw-r--r-- | lisp/org-list.el | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/org-list.el b/lisp/org-list.el index 4cc2d53..7136e2b 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -468,10 +468,10 @@ This checks `org-list-ending-method'." (looking-at org-list-end-re)) (throw 'exit nil)) ;; Skip blocks, drawers, inline-tasks, blank lines - ((looking-at "^[ \t]*#\\+end_") - (re-search-backward "^[ \t]*#\\+begin_" nil t)) - ((looking-at "^[ \t]*:END:") - (re-search-backward drawers-re nil t) + ((and (looking-at "^[ \t]*#\\+end_") + (re-search-backward "^[ \t]*#\\+begin_" lim-up t))) + ((and (looking-at "^[ \t]*:END:") + (re-search-backward drawers-re lim-up t)) (beginning-of-line)) ((and inlinetask-re (looking-at inlinetask-re)) (org-inlinetask-goto-beginning) @@ -689,10 +689,10 @@ Assume point is at an item." (memq (assq (car beg-cell) itm-lst) itm-lst)))) ;; Skip blocks, drawers, inline tasks, blank lines ;; along the way. - ((looking-at "^[ \t]*#\\+end_") - (re-search-backward "^[ \t]*#\\+begin_" nil t)) - ((looking-at "^[ \t]*:END:") - (re-search-backward drawers-re nil t) + ((and (looking-at "^[ \t]*#\\+end_") + (re-search-backward "^[ \t]*#\\+begin_" lim-up t))) + ((and (looking-at "^[ \t]*:END:") + (re-search-backward drawers-re lim-up t)) (beginning-of-line)) ((and inlinetask-re (looking-at inlinetask-re)) (org-inlinetask-goto-beginning) @@ -756,11 +756,11 @@ Assume point is at an item." (throw 'exit (push (cons 0 (point)) end-lst-2))) ;; Skip blocks, drawers, inline tasks and blank lines ;; along the way - ((looking-at "^[ \t]*#\\+begin_") - (re-search-forward "^[ \t]*#\\+end_") + ((and (looking-at "^[ \t]*#\\+begin_") + (re-search-forward "^[ \t]*#\\+end_" lim-down t)) (forward-line 1)) - ((looking-at drawers-re) - (re-search-forward "^[ \t]*:END:" nil t) + ((and (looking-at drawers-re) + (re-search-forward "^[ \t]*:END:" lim-down t)) (forward-line 1)) ((and inlinetask-re (looking-at inlinetask-re)) (org-inlinetask-goto-end)) |