org-list: ignore lines with org-example property when creating structure
* lisp/org-list.el (org-list-struct): when a line has org-example property, skip the entire block. This is needed during export, for example when src blocks in org markup contain lists, and are returned verbatim because org isn't in the list of interpreted languages.
This commit is contained in:
parent
d309256aff
commit
dcf23c416f
|
@ -661,14 +661,22 @@ Assume point is at an item."
|
|||
;; Jump to part 2.
|
||||
(throw 'exit
|
||||
(setq itm-lst
|
||||
(if (not (looking-at item-re))
|
||||
(if (or (not (looking-at item-re))
|
||||
(get-text-property (point) 'org-example))
|
||||
(memq (assq (car beg-cell) itm-lst) itm-lst)
|
||||
(setq beg-cell (cons (point) ind))
|
||||
(cons (funcall assoc-at-point ind) itm-lst)))))
|
||||
((and (not (eq org-list-ending-method 'indent))
|
||||
(looking-at org-list-end-re))
|
||||
;; At a verbatim block, go before its beginning. Move
|
||||
;; from eol to ensure `previous-single-property-change'
|
||||
;; will return a value.
|
||||
((get-text-property (point) 'org-example)
|
||||
(goto-char (previous-single-property-change
|
||||
(point-at-eol) 'org-example nil lim-up))
|
||||
(forward-line -1))
|
||||
;; Looking at a list ending regexp. Dismiss useless
|
||||
;; data recorded above BEG-CELL. Jump to part 2.
|
||||
((and (not (eq org-list-ending-method 'indent))
|
||||
(looking-at org-list-end-re))
|
||||
(throw 'exit
|
||||
(setq itm-lst
|
||||
(memq (assq (car beg-cell) itm-lst) itm-lst))))
|
||||
|
@ -732,10 +740,16 @@ Assume point is at an item."
|
|||
;; part 3.
|
||||
(throw 'exit
|
||||
(push (cons 0 (funcall end-before-blank)) end-lst-2)))
|
||||
((and (not (eq org-list-ending-method 'indent))
|
||||
(looking-at org-list-end-re))
|
||||
;; At a verbatim block, move to its end. Point is at bol
|
||||
;; and 'org-example property is set by whole lines:
|
||||
;; `next-single-property-change' always return a value.
|
||||
((get-text-property (point) 'org-example)
|
||||
(goto-char
|
||||
(next-single-property-change (point) 'org-example nil lim-down)))
|
||||
;; Looking at a list ending regexp. Save point as an
|
||||
;; ending position and jump to part 3.
|
||||
((and (not (eq org-list-ending-method 'indent))
|
||||
(looking-at org-list-end-re))
|
||||
(throw 'exit (push (cons 0 (point-at-bol)) end-lst-2)))
|
||||
;; Skip blocks, drawers, inline tasks and blank lines
|
||||
;; along the way
|
||||
|
|
Loading…
Reference in New Issue