org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;; org-element.el --- Parser And Applications for Org syntax
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; Copyright (C) 2012 Free Software Foundation, Inc.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
|
|
|
|
|
;; Keywords: outlines, hypermedia, calendar, wp
|
|
|
|
|
|
|
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
2011-12-26 09:34:36 -05:00
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;; Org syntax can be divided into three categories: "Greater
|
|
|
|
|
;; elements", "Elements" and "Objects".
|
|
|
|
|
|
2012-04-25 16:15:29 -04:00
|
|
|
|
;; Elements are related to the structure of the document. Indeed, all
|
|
|
|
|
;; elements are a cover for the document: each position within belongs
|
|
|
|
|
;; to at least one element.
|
|
|
|
|
|
|
|
|
|
;; An element always starts and ends at the beginning of a line. With
|
|
|
|
|
;; a few exceptions (namely `headline', `item', `section', `keyword',
|
|
|
|
|
;; `babel-call' and `property-drawer' types), it can also accept
|
|
|
|
|
;; a fixed set of keywords as attributes. Those are called
|
|
|
|
|
;; "affiliated keywords" to distinguish them from other keywords,
|
|
|
|
|
;; which are full-fledged elements.
|
|
|
|
|
;;
|
|
|
|
|
;; Element containing other elements (and only elements) are called
|
|
|
|
|
;; greater elements. Concerned types are: `center-block', `drawer',
|
|
|
|
|
;; `dynamic-block', `footnote-definition', `headline', `inlinetask',
|
|
|
|
|
;; `item', `plain-list', `quote-block', `section' and `special-block'.
|
|
|
|
|
;;
|
|
|
|
|
;; Other element types are: `babel-call', `comment', `comment-block',
|
|
|
|
|
;; `example-block', `export-block', `fixed-width', `horizontal-rule',
|
|
|
|
|
;; `keyword', `latex-environment', `paragraph', `property-drawer',
|
|
|
|
|
;; `quote-section', `src-block', `table', `table-cell', `table-row'
|
2012-04-27 09:02:22 -04:00
|
|
|
|
;; and `verse-block'. Among them, `paragraph', `table-cell' and
|
2012-04-25 16:15:29 -04:00
|
|
|
|
;; `verse-block' types can contain Org objects and plain text.
|
|
|
|
|
;;
|
|
|
|
|
;; Objects are related to document's contents. Some of them are
|
|
|
|
|
;; recursive. Associated types are of the following: `emphasis',
|
|
|
|
|
;; `entity', `export-snippet', `footnote-reference',
|
|
|
|
|
;; `inline-babel-call', `inline-src-block', `latex-fragment',
|
|
|
|
|
;; `line-break', `link', `macro', `radio-target', `statistics-cookie',
|
|
|
|
|
;; `subscript', `superscript', `table-cell', `target', `time-stamp'
|
|
|
|
|
;; and `verbatim'.
|
|
|
|
|
;;
|
|
|
|
|
;; Some elements also have special properties whose value can hold
|
|
|
|
|
;; objects themselves (i.e. an item tag or an headline name). Such
|
|
|
|
|
;; values are called "secondary strings". Any object belongs to
|
|
|
|
|
;; either an element or a secondary string.
|
|
|
|
|
;;
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Notwithstanding affiliated keywords, each greater element, element
|
|
|
|
|
;; and object has a fixed set of properties attached to it. Among
|
|
|
|
|
;; them, three are shared by all types: `:begin' and `:end', which
|
|
|
|
|
;; refer to the beginning and ending buffer positions of the
|
|
|
|
|
;; considered element or object, and `:post-blank', which holds the
|
2012-04-25 16:15:29 -04:00
|
|
|
|
;; number of blank lines, or white spaces, at its end. Greater
|
|
|
|
|
;; elements and elements containing objects will also have
|
|
|
|
|
;; `:contents-begin' and `:contents-end' properties to delimit
|
|
|
|
|
;; contents.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;; Lisp-wise, an element or an object can be represented as a list.
|
|
|
|
|
;; It follows the pattern (TYPE PROPERTIES CONTENTS), where:
|
|
|
|
|
;; TYPE is a symbol describing the Org element or object.
|
|
|
|
|
;; PROPERTIES is the property list attached to it. See docstring of
|
|
|
|
|
;; appropriate parsing function to get an exhaustive
|
|
|
|
|
;; list.
|
|
|
|
|
;; CONTENTS is a list of elements, objects or raw strings contained
|
|
|
|
|
;; in the current element or object, when applicable.
|
|
|
|
|
|
|
|
|
|
;; An Org buffer is a nested list of such elements and objects, whose
|
|
|
|
|
;; type is `org-data' and properties is nil.
|
|
|
|
|
|
|
|
|
|
;; The first part of this file implements a parser and an interpreter
|
|
|
|
|
;; for each type of Org syntax.
|
|
|
|
|
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; The next two parts introduce four accessors and a function
|
2012-04-25 16:15:29 -04:00
|
|
|
|
;; retrieving the element starting at point (respectively
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; `org-element-type', `org-element-property', `org-element-contents',
|
|
|
|
|
;; `org-element-restriction' and `org-element-current-element').
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;; The following part creates a fully recursive buffer parser. It
|
|
|
|
|
;; also provides a tool to map a function to elements or objects
|
|
|
|
|
;; matching some criteria in the parse tree. Functions of interest
|
|
|
|
|
;; are `org-element-parse-buffer', `org-element-map' and, to a lesser
|
|
|
|
|
;; extent, `org-element-parse-secondary-string'.
|
|
|
|
|
|
|
|
|
|
;; The penultimate part is the cradle of an interpreter for the
|
|
|
|
|
;; obtained parse tree: `org-element-interpret-data' (and its
|
|
|
|
|
;; relative, `org-element-interpret-secondary').
|
|
|
|
|
|
|
|
|
|
;; The library ends by furnishing a set of interactive tools for
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; element's navigation and manipulation, mostly based on
|
|
|
|
|
;; `org-element-at-point' function.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
|
|
(eval-when-compile (require 'cl))
|
|
|
|
|
(require 'org)
|
|
|
|
|
(declare-function org-inlinetask-goto-end "org-inlinetask" ())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Greater elements
|
|
|
|
|
|
|
|
|
|
;; For each greater element type, we define a parser and an
|
|
|
|
|
;; interpreter.
|
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
;; A parser returns the element or object as the list described above.
|
|
|
|
|
;; Most of them accepts no argument. Though, exceptions exist. Hence
|
|
|
|
|
;; every element containing a secondary string (see
|
|
|
|
|
;; `org-element-secondary-value-alist') will accept an optional
|
|
|
|
|
;; argument to toggle parsing of that secondary string. Moreover,
|
|
|
|
|
;; `item' parser requires current list's structure as its first
|
|
|
|
|
;; element.
|
|
|
|
|
|
|
|
|
|
;; An interpreter accepts two arguments: the list representation of
|
|
|
|
|
;; the element or object, and its contents. The latter may be nil,
|
|
|
|
|
;; depending on the element or object considered. It returns the
|
|
|
|
|
;; appropriate Org syntax, as a string.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;; Parsing functions must follow the naming convention:
|
|
|
|
|
;; org-element-TYPE-parser, where TYPE is greater element's type, as
|
|
|
|
|
;; defined in `org-element-greater-elements'.
|
|
|
|
|
;;
|
|
|
|
|
;; Similarly, interpreting functions must follow the naming
|
|
|
|
|
;; convention: org-element-TYPE-interpreter.
|
|
|
|
|
|
|
|
|
|
;; With the exception of `headline' and `item' types, greater elements
|
|
|
|
|
;; cannot contain other greater elements of their own type.
|
|
|
|
|
|
|
|
|
|
;; Beside implementing a parser and an interpreter, adding a new
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; greater element requires to tweak `org-element-current-element'.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Moreover, the newly defined type must be added to both
|
|
|
|
|
;; `org-element-all-elements' and `org-element-greater-elements'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Center Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-center-block-parser ()
|
|
|
|
|
"Parse a center block.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `center-block' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:begin', `:end', `:hiddenp', `:contents-begin',
|
|
|
|
|
`:contents-end' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at beginning or end of the block."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(keywords (progn
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(re-search-backward
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat "^[ \t]*#\\+BEGIN_CENTER") nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-element-collect-affiliated-keywords)))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-begin (progn (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(contents-end (progn (re-search-forward
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat "^[ \t]*#\\+END_CENTER") nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(point-at-bol)))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(center-block
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-center-block-interpreter (center-block contents)
|
|
|
|
|
"Interpret CENTER-BLOCK element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
2012-04-27 09:02:22 -04:00
|
|
|
|
(format "#+BEGIN_CENTER\n%s#+END_CENTER" contents))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Drawer
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-drawer-parser ()
|
|
|
|
|
"Parse a drawer.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `drawer' and CDR is a plist containing
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:drawer-name', `:begin', `:end', `:hiddenp', `:contents-begin',
|
|
|
|
|
`:contents-end' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at beginning of drawer."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(name (progn (looking-at org-drawer-regexp)
|
|
|
|
|
(org-match-string-no-properties 1)))
|
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-begin (progn (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(contents-end (progn (re-search-forward "^[ \t]*:END:" nil t)
|
|
|
|
|
(point-at-bol)))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(drawer
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:drawer-name ,name
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-drawer-interpreter (drawer contents)
|
|
|
|
|
"Interpret DRAWER element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
|
|
|
|
(format ":%s:\n%s:END:"
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :drawer-name drawer)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
contents))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Dynamic Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-dynamic-block-parser ()
|
|
|
|
|
"Parse a dynamic block.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `dynamic-block' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:block-name', `:begin', `:end', `:hiddenp',
|
|
|
|
|
`:contents-begin', `:contents-end', `:arguments' and
|
|
|
|
|
`:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at beginning of dynamic block."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(name (progn (looking-at org-dblock-start-re)
|
|
|
|
|
(org-match-string-no-properties 1)))
|
|
|
|
|
(arguments (org-match-string-no-properties 3))
|
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-begin (progn (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(contents-end (progn (re-search-forward org-dblock-end-re nil t)
|
|
|
|
|
(point-at-bol)))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(list 'dynamic-block
|
2011-12-09 08:38:36 -05:00
|
|
|
|
`(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:block-name ,name
|
|
|
|
|
:arguments ,arguments
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-dynamic-block-interpreter (dynamic-block contents)
|
|
|
|
|
"Interpret DYNAMIC-BLOCK element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
|
|
|
|
(format "#+BEGIN: %s%s\n%s#+END:"
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :block-name dynamic-block)
|
|
|
|
|
(let ((args (org-element-property :arguments dynamic-block)))
|
2012-04-27 09:28:01 -04:00
|
|
|
|
(and args (concat " " args)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
contents))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Footnote Definition
|
2011-12-01 09:42:06 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-footnote-definition-parser ()
|
|
|
|
|
"Parse a footnote definition.
|
|
|
|
|
|
2012-04-06 17:50:00 -04:00
|
|
|
|
Return a list whose CAR is `footnote-definition' and CDR is
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
a plist containing `:label', `:begin' `:end', `:contents-begin',
|
2012-04-06 17:50:00 -04:00
|
|
|
|
`:contents-end' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the footnote definition."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
2012-04-06 17:50:00 -04:00
|
|
|
|
(looking-at org-footnote-definition-re)
|
|
|
|
|
(let* ((label (org-match-string-no-properties 1))
|
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(begin (car keywords))
|
2012-04-06 17:50:00 -04:00
|
|
|
|
(contents-begin (progn (search-forward "]")
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-skip-whitespace)
|
|
|
|
|
(point)))
|
2012-04-06 17:50:00 -04:00
|
|
|
|
(contents-end (if (progn
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(re-search-forward
|
|
|
|
|
(concat org-outline-regexp-bol "\\|"
|
|
|
|
|
org-footnote-definition-re "\\|"
|
|
|
|
|
"^[ \t]*$") nil t))
|
|
|
|
|
(match-beginning 0)
|
|
|
|
|
(point-max)))
|
2012-04-06 13:14:51 -04:00
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(footnote-definition
|
|
|
|
|
(:label ,label
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,(count-lines contents-end end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2011-12-01 09:42:06 -05:00
|
|
|
|
(defun org-element-footnote-definition-interpreter (footnote-definition contents)
|
|
|
|
|
"Interpret FOOTNOTE-DEFINITION element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the footnote-definition."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(concat (format "[%s]" (org-element-property :label footnote-definition))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
" "
|
|
|
|
|
contents))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Headline
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(defun org-element-headline-parser (&optional raw-secondary-p)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Parse an headline.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `headline' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:raw-value', `:title', `:begin', `:end',
|
|
|
|
|
`:pre-blank', `:hiddenp', `:contents-begin' and `:contents-end',
|
|
|
|
|
`:level', `:priority', `:tags', `:todo-keyword',`:todo-type',
|
|
|
|
|
`:scheduled', `:deadline', `:timestamp', `:clock', `:category',
|
2011-12-25 04:15:36 -05:00
|
|
|
|
`:quotedp', `:archivedp', `:commentedp' and `:footnote-section-p'
|
|
|
|
|
keywords.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
The plist also contains any property set in the property drawer,
|
|
|
|
|
with its name in lowercase, the underscores replaced with hyphens
|
|
|
|
|
and colons at the beginning (i.e. `:custom-id').
|
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
When RAW-SECONDARY-P is non-nil, headline's title will not be
|
|
|
|
|
parsed as a secondary string, but as a plain string instead.
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
Assume point is at beginning of the headline."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((components (org-heading-components))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(level (nth 1 components))
|
|
|
|
|
(todo (nth 2 components))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(todo-type
|
|
|
|
|
(and todo (if (member todo org-done-keywords) 'done 'todo)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(tags (nth 5 components))
|
|
|
|
|
(raw-value (nth 4 components))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(quotedp
|
|
|
|
|
(let ((case-fold-search nil))
|
|
|
|
|
(string-match (format "^%s +" org-quote-string) raw-value)))
|
|
|
|
|
(commentedp
|
|
|
|
|
(let ((case-fold-search nil))
|
|
|
|
|
(string-match (format "^%s +" org-comment-string) raw-value)))
|
|
|
|
|
(archivedp
|
|
|
|
|
(and tags
|
|
|
|
|
(let ((case-fold-search nil))
|
|
|
|
|
(string-match (format ":%s:" org-archive-tag) tags))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(footnote-section-p (and org-footnote-section
|
|
|
|
|
(string= org-footnote-section raw-value)))
|
|
|
|
|
(standard-props (let (plist)
|
|
|
|
|
(mapc
|
|
|
|
|
(lambda (p)
|
|
|
|
|
(let ((p-name (downcase (car p))))
|
|
|
|
|
(while (string-match "_" p-name)
|
|
|
|
|
(setq p-name
|
|
|
|
|
(replace-match "-" nil nil p-name)))
|
|
|
|
|
(setq p-name (intern (concat ":" p-name)))
|
|
|
|
|
(setq plist
|
|
|
|
|
(plist-put plist p-name (cdr p)))))
|
|
|
|
|
(org-entry-properties nil 'standard))
|
|
|
|
|
plist))
|
|
|
|
|
(time-props (org-entry-properties nil 'special "CLOCK"))
|
|
|
|
|
(scheduled (cdr (assoc "SCHEDULED" time-props)))
|
|
|
|
|
(deadline (cdr (assoc "DEADLINE" time-props)))
|
|
|
|
|
(clock (cdr (assoc "CLOCK" time-props)))
|
|
|
|
|
(timestamp (cdr (assoc "TIMESTAMP" time-props)))
|
|
|
|
|
(begin (point))
|
|
|
|
|
(pos-after-head (save-excursion (forward-line) (point)))
|
|
|
|
|
(contents-begin (save-excursion (forward-line)
|
|
|
|
|
(org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol))))
|
|
|
|
|
(hidden (save-excursion (forward-line) (org-truely-invisible-p)))
|
|
|
|
|
(end (progn (goto-char (org-end-of-subtree t t))))
|
|
|
|
|
(contents-end (progn (skip-chars-backward " \r\t\n")
|
|
|
|
|
(forward-line)
|
|
|
|
|
(point)))
|
|
|
|
|
title)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Clean RAW-VALUE from any quote or comment string.
|
|
|
|
|
(when (or quotedp commentedp)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(setq raw-value
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
(concat "\\(" org-quote-string "\\|" org-comment-string "\\) +")
|
|
|
|
|
""
|
|
|
|
|
raw-value)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Clean TAGS from archive tag, if any.
|
|
|
|
|
(when archivedp
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(setq tags
|
|
|
|
|
(and (not (string= tags (format ":%s:" org-archive-tag)))
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
(concat org-archive-tag ":") "" tags)))
|
|
|
|
|
(when (string= tags ":") (setq tags nil)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Then get TITLE.
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(setq title
|
|
|
|
|
(if raw-secondary-p raw-value
|
|
|
|
|
(org-element-parse-secondary-string
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
raw-value (org-element-restriction 'headline))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(headline
|
|
|
|
|
(:raw-value ,raw-value
|
|
|
|
|
:title ,title
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:pre-blank ,(count-lines pos-after-head contents-begin)
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:level ,level
|
|
|
|
|
:priority ,(nth 3 components)
|
|
|
|
|
:tags ,tags
|
|
|
|
|
:todo-keyword ,todo
|
|
|
|
|
:todo-type ,todo-type
|
|
|
|
|
:scheduled ,scheduled
|
|
|
|
|
:deadline ,deadline
|
|
|
|
|
:timestamp ,timestamp
|
|
|
|
|
:clock ,clock
|
|
|
|
|
:post-blank ,(count-lines contents-end end)
|
|
|
|
|
:footnote-section-p ,footnote-section-p
|
|
|
|
|
:archivedp ,archivedp
|
|
|
|
|
:commentedp ,commentedp
|
|
|
|
|
:quotedp ,quotedp
|
|
|
|
|
,@standard-props)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-headline-interpreter (headline contents)
|
|
|
|
|
"Interpret HEADLINE element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let* ((level (org-element-property :level headline))
|
|
|
|
|
(todo (org-element-property :todo-keyword headline))
|
|
|
|
|
(priority (org-element-property :priority headline))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(title (org-element-interpret-secondary
|
|
|
|
|
(org-element-property :title headline)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(tags (let ((tag-string (org-element-property :tags headline))
|
|
|
|
|
(archivedp (org-element-property :archivedp headline)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(cond
|
|
|
|
|
((and (not tag-string) archivedp)
|
|
|
|
|
(format ":%s:" org-archive-tag))
|
|
|
|
|
(archivedp (concat ":" org-archive-tag tag-string))
|
|
|
|
|
(t tag-string))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(commentedp (org-element-property :commentedp headline))
|
|
|
|
|
(quotedp (org-element-property :quotedp headline))
|
|
|
|
|
(pre-blank (org-element-property :pre-blank headline))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(heading (concat (make-string level ?*)
|
|
|
|
|
(and todo (concat " " todo))
|
|
|
|
|
(and quotedp (concat " " org-quote-string))
|
|
|
|
|
(and commentedp (concat " " org-comment-string))
|
2012-04-27 09:56:30 -04:00
|
|
|
|
(and priority
|
|
|
|
|
(format " [#%s]" (char-to-string priority)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(cond ((and org-footnote-section
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property
|
2011-12-09 08:38:36 -05:00
|
|
|
|
:footnote-section-p headline))
|
|
|
|
|
(concat " " org-footnote-section))
|
2012-04-27 09:56:30 -04:00
|
|
|
|
(title (concat " " title))))))
|
|
|
|
|
(concat heading
|
|
|
|
|
;; Align tags.
|
|
|
|
|
(when tags
|
|
|
|
|
(cond
|
|
|
|
|
((zerop org-tags-column) (format " %s" tags))
|
|
|
|
|
((< org-tags-column 0)
|
|
|
|
|
(concat
|
|
|
|
|
(make-string
|
|
|
|
|
(max (- (+ org-tags-column (length heading) (length tags))) 1)
|
|
|
|
|
? )
|
|
|
|
|
tags))
|
|
|
|
|
(t
|
|
|
|
|
(concat
|
|
|
|
|
(make-string (max (- org-tags-column (length heading)) 1) ? )
|
|
|
|
|
tags))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(make-string (1+ pre-blank) 10)
|
|
|
|
|
contents)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Inlinetask
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(defun org-element-inlinetask-parser (&optional raw-secondary-p)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Parse an inline task.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `inlinetask' and CDR is a plist
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
containing `:title', `:begin', `:end', `:hiddenp',
|
2011-12-25 04:15:36 -05:00
|
|
|
|
`:contents-begin' and `:contents-end', `:level', `:priority',
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
`:tags', `:todo-keyword', `:todo-type', `:scheduled',
|
|
|
|
|
`:deadline', `:timestamp', `:clock' and `:post-blank' keywords.
|
2011-12-25 04:15:36 -05:00
|
|
|
|
|
|
|
|
|
The plist also contains any property set in the property drawer,
|
|
|
|
|
with its name in lowercase, the underscores replaced with hyphens
|
|
|
|
|
and colons at the beginning (i.e. `:custom-id').
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
When optional argument RAW-SECONDARY-P is non-nil, inline-task's
|
|
|
|
|
title will not be parsed as a secondary string, but as a plain
|
|
|
|
|
string instead.
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
Assume point is at beginning of the inline task."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((keywords (org-element-collect-affiliated-keywords))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(components (org-heading-components))
|
|
|
|
|
(todo (nth 2 components))
|
|
|
|
|
(todo-type (and todo
|
|
|
|
|
(if (member todo org-done-keywords) 'done 'todo)))
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(title (if raw-secondary-p (nth 4 components)
|
|
|
|
|
(org-element-parse-secondary-string
|
|
|
|
|
(nth 4 components)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(org-element-restriction 'inlinetask))))
|
2011-12-25 04:15:36 -05:00
|
|
|
|
(standard-props (let (plist)
|
|
|
|
|
(mapc
|
|
|
|
|
(lambda (p)
|
|
|
|
|
(let ((p-name (downcase (car p))))
|
|
|
|
|
(while (string-match "_" p-name)
|
|
|
|
|
(setq p-name
|
|
|
|
|
(replace-match "-" nil nil p-name)))
|
|
|
|
|
(setq p-name (intern (concat ":" p-name)))
|
|
|
|
|
(setq plist
|
|
|
|
|
(plist-put plist p-name (cdr p)))))
|
|
|
|
|
(org-entry-properties nil 'standard))
|
|
|
|
|
plist))
|
|
|
|
|
(time-props (org-entry-properties nil 'special "CLOCK"))
|
|
|
|
|
(scheduled (cdr (assoc "SCHEDULED" time-props)))
|
|
|
|
|
(deadline (cdr (assoc "DEADLINE" time-props)))
|
|
|
|
|
(clock (cdr (assoc "CLOCK" time-props)))
|
|
|
|
|
(timestamp (cdr (assoc "TIMESTAMP" time-props)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(contents-begin (save-excursion (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(pos-before-blank (org-inlinetask-goto-end))
|
|
|
|
|
;; In the case of a single line task, CONTENTS-BEGIN and
|
|
|
|
|
;; CONTENTS-END might overlap.
|
|
|
|
|
(contents-end (max contents-begin
|
2012-04-27 09:56:30 -04:00
|
|
|
|
(if (not (bolp)) (point-at-bol)
|
|
|
|
|
(save-excursion (forward-line -1) (point)))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(inlinetask
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(:title ,title
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:hiddenp ,(and (> contents-end contents-begin) hidden)
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:level ,(nth 1 components)
|
|
|
|
|
:priority ,(nth 3 components)
|
|
|
|
|
:tags ,(nth 5 components)
|
|
|
|
|
:todo-keyword ,todo
|
|
|
|
|
:todo-type ,todo-type
|
|
|
|
|
:scheduled ,scheduled
|
|
|
|
|
:deadline ,deadline
|
|
|
|
|
:timestamp ,timestamp
|
|
|
|
|
:clock ,clock
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@standard-props
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-inlinetask-interpreter (inlinetask contents)
|
|
|
|
|
"Interpret INLINETASK element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of inlinetask."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let* ((level (org-element-property :level inlinetask))
|
|
|
|
|
(todo (org-element-property :todo-keyword inlinetask))
|
|
|
|
|
(priority (org-element-property :priority inlinetask))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(title (org-element-interpret-secondary
|
|
|
|
|
(org-element-property :title inlinetask)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(tags (org-element-property :tags inlinetask))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(task (concat (make-string level ?*)
|
|
|
|
|
(and todo (concat " " todo))
|
2012-04-27 09:56:30 -04:00
|
|
|
|
(and priority
|
|
|
|
|
(format " [#%s]" (char-to-string priority)))
|
|
|
|
|
(and title (concat " " title)))))
|
|
|
|
|
(concat task
|
|
|
|
|
;; Align tags.
|
|
|
|
|
(when tags
|
|
|
|
|
(cond
|
|
|
|
|
((zerop org-tags-column) (format " %s" tags))
|
|
|
|
|
((< org-tags-column 0)
|
|
|
|
|
(concat
|
|
|
|
|
(make-string
|
|
|
|
|
(max (- (+ org-tags-column (length task) (length tags))) 1)
|
|
|
|
|
? )
|
|
|
|
|
tags))
|
|
|
|
|
(t
|
|
|
|
|
(concat
|
|
|
|
|
(make-string (max (- org-tags-column (length task)) 1) ? )
|
|
|
|
|
tags))))
|
|
|
|
|
;; Prefer degenerate inlinetasks when there are no
|
|
|
|
|
;; contents.
|
|
|
|
|
(when contents
|
|
|
|
|
(concat "\n"
|
|
|
|
|
contents
|
|
|
|
|
(make-string level ?*) " END")))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Item
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(defun org-element-item-parser (struct &optional raw-secondary-p)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Parse an item.
|
|
|
|
|
|
|
|
|
|
STRUCT is the structure of the plain list.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `item' and CDR is a plist containing
|
2011-12-25 05:24:56 -05:00
|
|
|
|
`:bullet', `:begin', `:end', `:contents-begin', `:contents-end',
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
`:checkbox', `:counter', `:tag', `:structure', `:hiddenp' and
|
|
|
|
|
`:post-blank' keywords.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
When optional argument RAW-SECONDARY-P is non-nil, item's tag, if
|
|
|
|
|
any, will not be parsed as a secondary string, but as a plain
|
|
|
|
|
string instead.
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
Assume point is at the beginning of the item."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
(let* ((begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(bullet (org-list-get-bullet (point) struct))
|
|
|
|
|
(checkbox (let ((box (org-list-get-checkbox begin struct)))
|
|
|
|
|
(cond ((equal "[ ]" box) 'off)
|
|
|
|
|
((equal "[X]" box) 'on)
|
|
|
|
|
((equal "[-]" box) 'trans))))
|
|
|
|
|
(counter (let ((c (org-list-get-counter begin struct)))
|
|
|
|
|
(cond
|
|
|
|
|
((not c) nil)
|
|
|
|
|
((string-match "[A-Za-z]" c)
|
|
|
|
|
(- (string-to-char (upcase (match-string 0 c)))
|
|
|
|
|
64))
|
|
|
|
|
((string-match "[0-9]+" c)
|
|
|
|
|
(string-to-number (match-string 0 c))))))
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(tag
|
|
|
|
|
(let ((raw-tag (org-list-get-tag begin struct)))
|
|
|
|
|
(and raw-tag
|
|
|
|
|
(if raw-secondary-p raw-tag
|
|
|
|
|
(org-element-parse-secondary-string
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
raw-tag (org-element-restriction 'item))))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(end (org-list-get-item-end begin struct))
|
|
|
|
|
(contents-begin (progn (looking-at org-list-full-item-re)
|
|
|
|
|
(goto-char (match-end 0))
|
|
|
|
|
(org-skip-whitespace)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; If first line isn't empty,
|
|
|
|
|
;; contents really start at the text
|
|
|
|
|
;; after item's meta-data.
|
|
|
|
|
(if (= (point-at-bol) begin) (point)
|
|
|
|
|
(point-at-bol))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(hidden (progn (forward-line)
|
|
|
|
|
(and (not (= (point) end))
|
|
|
|
|
(org-truely-invisible-p))))
|
|
|
|
|
(contents-end (progn (goto-char end)
|
|
|
|
|
(skip-chars-backward " \r\t\n")
|
|
|
|
|
(forward-line)
|
|
|
|
|
(point))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(item
|
|
|
|
|
(:bullet ,bullet
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
;; CONTENTS-BEGIN and CONTENTS-END may be mixed
|
|
|
|
|
;; up in the case of an empty item separated
|
|
|
|
|
;; from the next by a blank line. Thus, ensure
|
|
|
|
|
;; the former is always the smallest of two.
|
|
|
|
|
:contents-begin ,(min contents-begin contents-end)
|
|
|
|
|
:contents-end ,(max contents-begin contents-end)
|
|
|
|
|
:checkbox ,checkbox
|
|
|
|
|
:counter ,counter
|
|
|
|
|
:tag ,tag
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:structure ,struct
|
|
|
|
|
:post-blank ,(count-lines contents-end end))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-item-interpreter (item contents)
|
|
|
|
|
"Interpret ITEM element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let* ((bullet
|
|
|
|
|
(let* ((beg (org-element-property :begin item))
|
|
|
|
|
(struct (org-element-property :structure item))
|
|
|
|
|
(pre (org-list-prevs-alist struct))
|
|
|
|
|
(bul (org-element-property :bullet item)))
|
|
|
|
|
(org-list-bullet-string
|
|
|
|
|
(if (not (eq (org-list-get-list-type beg struct pre) 'ordered)) "-"
|
|
|
|
|
(let ((num
|
|
|
|
|
(car
|
|
|
|
|
(last
|
|
|
|
|
(org-list-get-item-number
|
|
|
|
|
beg struct pre (org-list-parents-alist struct))))))
|
|
|
|
|
(format "%d%s"
|
|
|
|
|
num
|
|
|
|
|
(if (eq org-plain-list-ordered-item-terminator ?\)) ")"
|
|
|
|
|
".")))))))
|
|
|
|
|
(checkbox (org-element-property :checkbox item))
|
|
|
|
|
(counter (org-element-property :counter item))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(tag (let ((tag (org-element-property :tag item)))
|
|
|
|
|
(and tag (org-element-interpret-secondary tag))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; Compute indentation.
|
|
|
|
|
(ind (make-string (length bullet) 32)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Indent contents.
|
|
|
|
|
(concat
|
|
|
|
|
bullet
|
|
|
|
|
(and counter (format "[@%d] " counter))
|
|
|
|
|
(cond
|
|
|
|
|
((eq checkbox 'on) "[X] ")
|
|
|
|
|
((eq checkbox 'off) "[ ] ")
|
|
|
|
|
((eq checkbox 'trans) "[-] "))
|
|
|
|
|
(and tag (format "%s :: " tag))
|
|
|
|
|
(org-trim
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(replace-regexp-in-string "\\(^\\)[ \t]*\\S-" ind contents nil nil 1)))))
|
|
|
|
|
|
2012-01-11 09:14:08 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Plain List
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-plain-list-parser (&optional structure)
|
|
|
|
|
"Parse a plain list.
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
Optional argument STRUCTURE, when non-nil, is the structure of
|
|
|
|
|
the plain list being parsed.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `plain-list' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:type', `:begin', `:end', `:contents-begin' and
|
|
|
|
|
`:contents-end', `:level', `:structure' and `:post-blank'
|
|
|
|
|
keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at one of the list items."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((struct (or structure (org-list-struct)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(prevs (org-list-prevs-alist struct))
|
|
|
|
|
(parents (org-list-parents-alist struct))
|
|
|
|
|
(type (org-list-get-list-type (point) struct prevs))
|
|
|
|
|
(contents-begin (goto-char
|
|
|
|
|
(org-list-get-list-begin (point) struct prevs)))
|
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-end (goto-char
|
|
|
|
|
(org-list-get-list-end (point) struct prevs)))
|
|
|
|
|
(end (save-excursion (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol))))
|
|
|
|
|
(level 0))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Get list level.
|
|
|
|
|
(let ((item contents-begin))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(while (setq item
|
|
|
|
|
(org-list-get-parent
|
|
|
|
|
(org-list-get-list-begin item struct prevs)
|
|
|
|
|
struct parents))
|
|
|
|
|
(incf level)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Blank lines below list belong to the top-level list only.
|
|
|
|
|
(when (> level 0)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(setq end (min (org-list-get-bottom-point struct)
|
|
|
|
|
(progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Return value.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(plain-list
|
|
|
|
|
(:type ,type
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:level ,level
|
|
|
|
|
:structure ,struct
|
|
|
|
|
:post-blank ,(count-lines contents-end end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-plain-list-interpreter (plain-list contents)
|
|
|
|
|
"Interpret PLAIN-LIST element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
|
|
|
|
contents)
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Quote Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-quote-block-parser ()
|
|
|
|
|
"Parse a quote block.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `quote-block' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:begin', `:end', `:hiddenp', `:contents-begin',
|
|
|
|
|
`:contents-end' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at beginning or end of the block."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(keywords (progn
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(re-search-backward
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat "^[ \t]*#\\+BEGIN_QUOTE") nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-element-collect-affiliated-keywords)))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-begin (progn (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(contents-end (progn (re-search-forward
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat "^[ \t]*#\\+END_QUOTE") nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(point-at-bol)))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(quote-block
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-quote-block-interpreter (quote-block contents)
|
|
|
|
|
"Interpret QUOTE-BLOCK element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(format "#+BEGIN_QUOTE\n%s#+END_QUOTE" contents))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
|
|
|
|
;;;; Section
|
|
|
|
|
|
|
|
|
|
(defun org-element-section-parser ()
|
|
|
|
|
"Parse a section.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `section' and CDR is a plist
|
2012-03-19 16:38:12 -04:00
|
|
|
|
containing `:begin', `:end', `:contents-begin', `contents-end'
|
|
|
|
|
and `:post-blank' keywords."
|
|
|
|
|
(save-excursion
|
|
|
|
|
;; Beginning of section is the beginning of the first non-blank
|
|
|
|
|
;; line after previous headline.
|
|
|
|
|
(org-with-limited-levels
|
|
|
|
|
(let ((begin
|
|
|
|
|
(save-excursion
|
|
|
|
|
(outline-previous-heading)
|
|
|
|
|
(if (not (org-at-heading-p)) (point)
|
|
|
|
|
(forward-line) (org-skip-whitespace) (point-at-bol))))
|
|
|
|
|
(end (progn (outline-next-heading) (point)))
|
|
|
|
|
(pos-before-blank (progn (skip-chars-backward " \r\t\n")
|
|
|
|
|
(forward-line)
|
|
|
|
|
(point))))
|
|
|
|
|
`(section
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:contents-begin ,begin
|
|
|
|
|
:contents-end ,pos-before-blank
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)))))))
|
|
|
|
|
|
|
|
|
|
(defun org-element-section-interpreter (section contents)
|
|
|
|
|
"Interpret SECTION element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
|
|
|
|
contents)
|
|
|
|
|
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Special Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-special-block-parser ()
|
|
|
|
|
"Parse a special block.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `special-block' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:type', `:begin', `:end', `:hiddenp',
|
|
|
|
|
`:contents-begin', `:contents-end' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at beginning or end of the block."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(type (progn (looking-at
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
"[ \t]*#\\+\\(?:BEGIN\\|END\\)_\\([-A-Za-z0-9]+\\)")
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-match-string-no-properties 1)))
|
|
|
|
|
(keywords (progn
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(re-search-backward
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat "^[ \t]*#\\+BEGIN_" type) nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-element-collect-affiliated-keywords)))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-begin (progn (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(contents-end (progn (re-search-forward
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat "^[ \t]*#\\+END_" type) nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(point-at-bol)))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(special-block
|
|
|
|
|
(:type ,type
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-special-block-interpreter (special-block contents)
|
|
|
|
|
"Interpret SPECIAL-BLOCK element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((block-type (org-element-property :type special-block)))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(format "#+BEGIN_%s\n%s#+END_%s" block-type contents block-type)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Elements
|
|
|
|
|
|
|
|
|
|
;; For each element, a parser and an interpreter are also defined.
|
|
|
|
|
;; Both follow the same naming convention used for greater elements.
|
|
|
|
|
|
|
|
|
|
;; Also, as for greater elements, adding a new element type is done
|
|
|
|
|
;; through the following steps: implement a parser and an interpreter,
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; tweak `org-element-current-element' so that it recognizes the new
|
|
|
|
|
;; type and add that new type to `org-element-all-elements'.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;; As a special case, when the newly defined type is a block type,
|
|
|
|
|
;; `org-element-non-recursive-block-alist' has to be modified
|
|
|
|
|
;; accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Babel Call
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-babel-call-parser ()
|
|
|
|
|
"Parse a babel call.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `babel-call' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:begin', `:end', `:info' and `:post-blank' as
|
|
|
|
|
keywords."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((info (progn (looking-at org-babel-block-lob-one-liner-regexp)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-babel-lob-get-info)))
|
|
|
|
|
(beg (point-at-bol))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(babel-call
|
|
|
|
|
(:beg ,beg
|
|
|
|
|
:end ,end
|
|
|
|
|
:info ,info
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-babel-call-interpreter (inline-babel-call contents)
|
|
|
|
|
"Interpret INLINE-BABEL-CALL object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let* ((babel-info (org-element-property :info inline-babel-call))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(main-source (car babel-info))
|
|
|
|
|
(post-options (nth 1 babel-info)))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat "#+CALL: "
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(if (string-match "\\[\\(\\[.*?\\]\\)\\]" main-source)
|
|
|
|
|
;; Remove redundant square brackets.
|
|
|
|
|
(replace-match
|
|
|
|
|
(match-string 1 main-source) nil nil main-source)
|
|
|
|
|
main-source)
|
|
|
|
|
(and post-options (format "[%s]" post-options)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Comment
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-comment-parser ()
|
|
|
|
|
"Parse a comment.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `comment' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:begin', `:end', `:value' and `:post-blank'
|
|
|
|
|
keywords."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let (beg-coms begin end end-coms keywords)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (looking-at "#")
|
|
|
|
|
;; First type of comment: comments at column 0.
|
|
|
|
|
(let ((comment-re "^\\([^#]\\|#\\+[a-z]\\)"))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(re-search-backward comment-re nil 'move)
|
|
|
|
|
(if (bobp) (setq keywords nil beg-coms (point))
|
|
|
|
|
(forward-line)
|
|
|
|
|
(setq keywords (org-element-collect-affiliated-keywords)
|
|
|
|
|
beg-coms (point))))
|
|
|
|
|
(re-search-forward comment-re nil 'move)
|
|
|
|
|
(setq end-coms (if (eobp) (point) (match-beginning 0))))
|
|
|
|
|
;; Second type of comment: indented comments.
|
|
|
|
|
(let ((comment-re "[ \t]*#\\+\\(?: \\|$\\)"))
|
|
|
|
|
(unless (bobp)
|
|
|
|
|
(while (and (not (bobp)) (looking-at comment-re))
|
|
|
|
|
(forward-line -1))
|
|
|
|
|
(unless (looking-at comment-re) (forward-line)))
|
|
|
|
|
(setq beg-coms (point))
|
|
|
|
|
(setq keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
;; Get comments ending. This may not be accurate if
|
|
|
|
|
;; commented lines within an item are followed by commented
|
|
|
|
|
;; lines outside of the list. Though, parser will always
|
|
|
|
|
;; get it right as it already knows surrounding element and
|
|
|
|
|
;; has narrowed buffer to its contents.
|
|
|
|
|
(while (looking-at comment-re) (forward-line))
|
|
|
|
|
(setq end-coms (point))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Find position after blank.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char end-coms)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(org-skip-whitespace)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(setq end (if (eobp) (point) (point-at-bol))))
|
|
|
|
|
`(comment
|
|
|
|
|
(:begin ,(or (car keywords) beg-coms)
|
|
|
|
|
:end ,end
|
|
|
|
|
:value ,(buffer-substring-no-properties beg-coms end-coms)
|
|
|
|
|
:post-blank ,(count-lines end-coms end)
|
|
|
|
|
,@(cadr keywords)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-comment-interpreter (comment contents)
|
|
|
|
|
"Interpret COMMENT element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :value comment))
|
|
|
|
|
|
2012-01-11 09:14:08 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Comment Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-comment-block-parser ()
|
|
|
|
|
"Parse an export block.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `comment-block' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:begin', `:end', `:hiddenp', `:value' and
|
|
|
|
|
`:post-blank' keywords."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(let* ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(keywords (progn
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(re-search-backward "^[ \t]*#\\+BEGIN_COMMENT" nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-element-collect-affiliated-keywords)))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-begin (progn (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(contents-end (progn (re-search-forward
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
"^[ \t]*#\\+END_COMMENT" nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(point-at-bol)))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol))))
|
|
|
|
|
(value (buffer-substring-no-properties contents-begin contents-end)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(comment-block
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:value ,value
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-comment-block-interpreter (comment-block contents)
|
|
|
|
|
"Interpret COMMENT-BLOCK element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-04-27 11:27:08 -04:00
|
|
|
|
(format "#+BEGIN_COMMENT\n%s#+END_COMMENT"
|
|
|
|
|
(org-remove-indentation (org-element-property :value comment-block))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Example Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-example-block-parser ()
|
|
|
|
|
"Parse an example block.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `example-block' and CDR is a plist
|
2012-03-19 16:38:12 -04:00
|
|
|
|
containing `:begin', `:end', `:number-lines', `:preserve-indent',
|
|
|
|
|
`:retain-labels', `:use-labels', `:label-fmt', `:hiddenp',
|
|
|
|
|
`:switches', `:value' and `:post-blank' keywords."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(let* ((case-fold-search t)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(switches (progn
|
|
|
|
|
(re-search-backward
|
|
|
|
|
"^[ \t]*#\\+BEGIN_EXAMPLE\\(?: +\\(.*\\)\\)?" nil t)
|
|
|
|
|
(org-match-string-no-properties 1)))
|
|
|
|
|
;; Switches analysis
|
|
|
|
|
(number-lines (cond ((not switches) nil)
|
|
|
|
|
((string-match "-n\\>" switches) 'new)
|
|
|
|
|
((string-match "+n\\>" switches) 'continued)))
|
|
|
|
|
(preserve-indent (and switches (string-match "-i\\>" switches)))
|
|
|
|
|
;; Should labels be retained in (or stripped from) example
|
|
|
|
|
;; blocks?
|
|
|
|
|
(retain-labels
|
|
|
|
|
(or (not switches)
|
|
|
|
|
(not (string-match "-r\\>" switches))
|
|
|
|
|
(and number-lines (string-match "-k\\>" switches))))
|
|
|
|
|
;; What should code-references use - labels or
|
|
|
|
|
;; line-numbers?
|
|
|
|
|
(use-labels
|
|
|
|
|
(or (not switches)
|
|
|
|
|
(and retain-labels (not (string-match "-k\\>" switches)))))
|
|
|
|
|
(label-fmt (and switches
|
|
|
|
|
(string-match "-l +\"\\([^\"\n]+\\)\"" switches)
|
|
|
|
|
(match-string 1 switches)))
|
|
|
|
|
;; Standard block parsing.
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-begin (progn (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(contents-end (progn
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(re-search-forward "^[ \t]*#\\+END_EXAMPLE" nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(point-at-bol)))
|
|
|
|
|
(value (buffer-substring-no-properties contents-begin contents-end))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(example-block
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:value ,value
|
|
|
|
|
:switches ,switches
|
|
|
|
|
:number-lines ,number-lines
|
|
|
|
|
:preserve-indent ,preserve-indent
|
|
|
|
|
:retain-labels ,retain-labels
|
|
|
|
|
:use-labels ,use-labels
|
|
|
|
|
:label-fmt ,label-fmt
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-example-block-interpreter (example-block contents)
|
|
|
|
|
"Interpret EXAMPLE-BLOCK element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((options (org-element-property :options example-block)))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat "#+BEGIN_EXAMPLE" (and options (concat " " options)) "\n"
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-remove-indentation
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :value example-block))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
"#+END_EXAMPLE")))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Export Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-export-block-parser ()
|
|
|
|
|
"Parse an export block.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `export-block' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:begin', `:end', `:type', `:hiddenp', `:value' and
|
|
|
|
|
`:post-blank' keywords."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(let* ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(contents)
|
|
|
|
|
(type (progn (re-search-backward
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(concat "[ \t]*#\\+BEGIN_"
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-re "\\([[:alnum:]]+\\)")))
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(upcase (org-match-string-no-properties 1))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-begin (progn (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(contents-end (progn (re-search-forward
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(concat "^[ \t]*#\\+END_" type) nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(point-at-bol)))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol))))
|
|
|
|
|
(value (buffer-substring-no-properties contents-begin contents-end)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(export-block
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:type ,type
|
|
|
|
|
:value ,value
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-export-block-interpreter (export-block contents)
|
|
|
|
|
"Interpret EXPORT-BLOCK element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((type (org-element-property :type export-block)))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat (format "#+BEGIN_%s\n" type)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :value export-block)
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(format "#+END_%s" type))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Fixed-width
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-fixed-width-parser ()
|
|
|
|
|
"Parse a fixed-width section.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `fixed-width' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:begin', `:end', `:value' and `:post-blank'
|
|
|
|
|
keywords."
|
|
|
|
|
(let ((fixed-re "[ \t]*:\\( \\|$\\)")
|
2011-12-09 08:38:36 -05:00
|
|
|
|
beg-area begin end value pos-before-blank keywords)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
;; Move to the beginning of the fixed-width area.
|
|
|
|
|
(unless (bobp)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(while (and (not (bobp)) (looking-at fixed-re))
|
|
|
|
|
(forward-line -1))
|
|
|
|
|
(unless (looking-at fixed-re) (forward-line 1)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(setq beg-area (point))
|
|
|
|
|
;; Get affiliated keywords, if any.
|
|
|
|
|
(setq keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
;; Store true beginning of element.
|
|
|
|
|
(setq begin (car keywords))
|
|
|
|
|
;; Get ending of fixed-width area. If point is in a list,
|
|
|
|
|
;; ensure to not get outside of it.
|
|
|
|
|
(let* ((itemp (org-in-item-p))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(max-pos (if itemp
|
|
|
|
|
(org-list-get-bottom-point
|
|
|
|
|
(save-excursion (goto-char itemp) (org-list-struct)))
|
|
|
|
|
(point-max))))
|
|
|
|
|
(while (and (looking-at fixed-re) (< (point) max-pos))
|
|
|
|
|
(forward-line)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(setq pos-before-blank (point))
|
|
|
|
|
;; Find position after blank
|
|
|
|
|
(org-skip-whitespace)
|
|
|
|
|
(setq end (if (eobp) (point) (point-at-bol)))
|
|
|
|
|
;; Extract value.
|
|
|
|
|
(setq value (buffer-substring-no-properties beg-area pos-before-blank)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(fixed-width
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:value ,value
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-fixed-width-interpreter (fixed-width contents)
|
|
|
|
|
"Interpret FIXED-WIDTH element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-remove-indentation (org-element-property :value fixed-width)))
|
|
|
|
|
|
2012-01-11 09:14:08 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Horizontal Rule
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-horizontal-rule-parser ()
|
|
|
|
|
"Parse an horizontal rule.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `horizontal-rule' and CDR is
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
a plist containing `:begin', `:end' and `:post-blank'
|
|
|
|
|
keywords."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((keywords (org-element-collect-affiliated-keywords))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(post-hr (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(horizontal-rule
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:post-blank ,(count-lines post-hr end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-horizontal-rule-interpreter (horizontal-rule contents)
|
|
|
|
|
"Interpret HORIZONTAL-RULE element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
|
|
|
|
"-----")
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Keyword
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-keyword-parser ()
|
|
|
|
|
"Parse a keyword at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `keyword' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:key', `:value', `:begin', `:end' and `:post-blank'
|
|
|
|
|
keywords."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(key (progn (looking-at
|
|
|
|
|
"[ \t]*#\\+\\(\\(?:[a-z]+\\)\\(?:_[a-z]+\\)*\\):")
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(upcase (org-match-string-no-properties 1))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(value (org-trim (buffer-substring-no-properties
|
|
|
|
|
(match-end 0) (point-at-eol))))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(keyword
|
|
|
|
|
(:key ,key
|
|
|
|
|
:value ,value
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-keyword-interpreter (keyword contents)
|
|
|
|
|
"Interpret KEYWORD element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
|
|
|
|
(format "#+%s: %s"
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :key keyword)
|
|
|
|
|
(org-element-property :value keyword)))
|
|
|
|
|
|
2012-01-11 09:14:08 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Latex Environment
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-latex-environment-parser ()
|
|
|
|
|
"Parse a LaTeX environment.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `latex-environment' and CDR is a plist
|
|
|
|
|
containing `:begin', `:end', `:value' and `:post-blank'
|
|
|
|
|
keywords."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(let* ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(contents-begin (re-search-backward "^[ \t]*\\\\begin" nil t))
|
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-end (progn (re-search-forward "^[ \t]*\\\\end")
|
|
|
|
|
(forward-line)
|
|
|
|
|
(point)))
|
|
|
|
|
(value (buffer-substring-no-properties contents-begin contents-end))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(latex-environment
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:value ,value
|
|
|
|
|
:post-blank ,(count-lines contents-end end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-latex-environment-interpreter (latex-environment contents)
|
|
|
|
|
"Interpret LATEX-ENVIRONMENT element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :value latex-environment))
|
|
|
|
|
|
2012-01-11 09:14:08 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Paragraph
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-paragraph-parser ()
|
|
|
|
|
"Parse a paragraph.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `paragraph' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:begin', `:end', `:contents-begin' and
|
|
|
|
|
`:contents-end' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the paragraph."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((contents-begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(contents-end (progn
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(if (re-search-forward
|
|
|
|
|
org-element-paragraph-separate nil 'm)
|
|
|
|
|
(progn (forward-line -1) (end-of-line) (point))
|
|
|
|
|
(point))))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(paragraph
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-paragraph-interpreter (paragraph contents)
|
|
|
|
|
"Interpret PARAGRAPH element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the element."
|
|
|
|
|
contents)
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Property Drawer
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-property-drawer-parser ()
|
|
|
|
|
"Parse a property drawer.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `property-drawer' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:begin', `:end', `:hiddenp', `:contents-begin',
|
|
|
|
|
`:contents-end', `:properties' and `:post-blank' keywords."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(begin (progn (end-of-line)
|
|
|
|
|
(re-search-backward org-property-start-re)
|
|
|
|
|
(match-beginning 0)))
|
|
|
|
|
(contents-begin (progn (forward-line) (point)))
|
|
|
|
|
(hidden (org-truely-invisible-p))
|
|
|
|
|
(properties (let (val)
|
|
|
|
|
(while (not (looking-at "^[ \t]*:END:"))
|
|
|
|
|
(when (looking-at
|
|
|
|
|
(org-re
|
|
|
|
|
"[ \t]*:\\([[:alpha:]][[:alnum:]_-]*\\):"))
|
|
|
|
|
(push (cons (match-string 1)
|
|
|
|
|
(org-trim
|
|
|
|
|
(buffer-substring
|
|
|
|
|
(match-end 0) (point-at-eol))))
|
|
|
|
|
val))
|
|
|
|
|
(forward-line))
|
|
|
|
|
val))
|
|
|
|
|
(contents-end (progn (re-search-forward "^[ \t]*:END:" nil t)
|
|
|
|
|
(point-at-bol)))
|
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(property-drawer
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:properties ,properties
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-property-drawer-interpreter (property-drawer contents)
|
|
|
|
|
"Interpret PROPERTY-DRAWER element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((props (org-element-property :properties property-drawer)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(concat
|
|
|
|
|
":PROPERTIES:\n"
|
|
|
|
|
(mapconcat (lambda (p)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(format org-property-format (format ":%s:" (car p)) (cdr p)))
|
|
|
|
|
(nreverse props) "\n")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"\n:END:")))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Quote Section
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-quote-section-parser ()
|
|
|
|
|
"Parse a quote section.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `quote-section' and CDR is a plist
|
|
|
|
|
containing `:begin', `:end', `:value' and `:post-blank' keywords.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
|
|
|
|
Assume point is at beginning of the section."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let* ((begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(end (progn (org-with-limited-levels (outline-next-heading))
|
|
|
|
|
(point)))
|
|
|
|
|
(pos-before-blank (progn (skip-chars-backward " \r\t\n")
|
|
|
|
|
(forward-line)
|
|
|
|
|
(point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(value (buffer-substring-no-properties begin pos-before-blank)))
|
|
|
|
|
`(quote-section
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:value ,value
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-quote-section-interpreter (quote-section contents)
|
|
|
|
|
"Interpret QUOTE-SECTION element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :value quote-section))
|
|
|
|
|
|
2012-01-11 09:14:08 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Src Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-src-block-parser ()
|
|
|
|
|
"Parse a src block.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `src-block' and CDR is a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
containing `:language', `:switches', `:parameters', `:begin',
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`:end', `:hiddenp', `:contents-begin', `:contents-end',
|
|
|
|
|
`:number-lines', `:retain-labels', `:use-labels', `:label-fmt',
|
|
|
|
|
`:preserve-indent', `:value' and `:post-blank' keywords."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(let* ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; Get position at beginning of block.
|
|
|
|
|
(contents-begin
|
|
|
|
|
(re-search-backward
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(concat
|
|
|
|
|
"^[ \t]*#\\+BEGIN_SRC"
|
|
|
|
|
"\\(?: +\\(\\S-+\\)\\)?" ; language
|
|
|
|
|
"\\(\\(?: +\\(?:-l \".*?\"\\|[-+][A-Za-z]\\)\\)*\\)" ; switches
|
|
|
|
|
"\\(.*\\)[ \t]*$") ; parameters
|
2011-12-09 08:38:36 -05:00
|
|
|
|
nil t))
|
|
|
|
|
;; Get language as a string.
|
|
|
|
|
(language (org-match-string-no-properties 1))
|
2012-03-17 11:28:46 -04:00
|
|
|
|
;; Get parameters.
|
|
|
|
|
(parameters (org-trim (org-match-string-no-properties 3)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; Get switches.
|
|
|
|
|
(switches (org-match-string-no-properties 2))
|
|
|
|
|
;; Switches analysis
|
|
|
|
|
(number-lines (cond ((not switches) nil)
|
|
|
|
|
((string-match "-n\\>" switches) 'new)
|
|
|
|
|
((string-match "+n\\>" switches) 'continued)))
|
|
|
|
|
(preserve-indent (and switches (string-match "-i\\>" switches)))
|
|
|
|
|
(label-fmt (and switches
|
|
|
|
|
(string-match "-l +\"\\([^\"\n]+\\)\"" switches)
|
|
|
|
|
(match-string 1 switches)))
|
|
|
|
|
;; Should labels be retained in (or stripped from) src
|
|
|
|
|
;; blocks?
|
|
|
|
|
(retain-labels
|
|
|
|
|
(or (not switches)
|
|
|
|
|
(not (string-match "-r\\>" switches))
|
|
|
|
|
(and number-lines (string-match "-k\\>" switches))))
|
|
|
|
|
;; What should code-references use - labels or
|
|
|
|
|
;; line-numbers?
|
|
|
|
|
(use-labels
|
|
|
|
|
(or (not switches)
|
|
|
|
|
(and retain-labels (not (string-match "-k\\>" switches)))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; Get affiliated keywords.
|
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
;; Get beginning position.
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
;; Get position at end of block.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(contents-end (progn (re-search-forward "^[ \t]*#\\+END_SRC" nil t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(forward-line)
|
|
|
|
|
(point)))
|
|
|
|
|
;; Retrieve code.
|
|
|
|
|
(value (buffer-substring-no-properties
|
|
|
|
|
(save-excursion (goto-char contents-begin)
|
|
|
|
|
(forward-line)
|
|
|
|
|
(point))
|
|
|
|
|
(match-beginning 0)))
|
|
|
|
|
;; Get position after ending blank lines.
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
|
|
|
|
(if (eobp) (point) (point-at-bol))))
|
|
|
|
|
;; Get visibility status.
|
|
|
|
|
(hidden (progn (goto-char contents-begin)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(forward-line)
|
|
|
|
|
(org-truely-invisible-p))))
|
|
|
|
|
`(src-block
|
|
|
|
|
(:language ,language
|
|
|
|
|
:switches ,switches
|
|
|
|
|
:parameters ,parameters
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:number-lines ,number-lines
|
|
|
|
|
:preserve-indent ,preserve-indent
|
|
|
|
|
:retain-labels ,retain-labels
|
|
|
|
|
:use-labels ,use-labels
|
|
|
|
|
:label-fmt ,label-fmt
|
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:value ,value
|
|
|
|
|
:post-blank ,(count-lines contents-end end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-src-block-interpreter (src-block contents)
|
|
|
|
|
"Interpret SRC-BLOCK element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((lang (org-element-property :language src-block))
|
|
|
|
|
(switches (org-element-property :switches src-block))
|
|
|
|
|
(params (org-element-property :parameters src-block))
|
|
|
|
|
(value (let ((val (org-element-property :value src-block)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(cond
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-src-preserve-indentation val)
|
|
|
|
|
((zerop org-edit-src-content-indentation)
|
|
|
|
|
(org-remove-indentation val))
|
|
|
|
|
(t
|
|
|
|
|
(let ((ind (make-string
|
|
|
|
|
org-edit-src-content-indentation 32)))
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"\\(^\\)[ \t]*\\S-" ind
|
|
|
|
|
(org-remove-indentation val) nil nil 1)))))))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(concat (format "#+BEGIN_SRC%s\n"
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(concat (and lang (concat " " lang))
|
|
|
|
|
(and switches (concat " " switches))
|
|
|
|
|
(and params (concat " " params))))
|
|
|
|
|
value
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
"#+END_SRC")))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Table
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-table-parser ()
|
|
|
|
|
"Parse a table at point.
|
|
|
|
|
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
Return a list whose CAR is `table' and CDR is a plist containing
|
|
|
|
|
`:begin', `:end', `:tblfm', `:type', `:contents-begin',
|
|
|
|
|
`:contents-end', `:value' and `:post-blank' keywords."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(let* ((case-fold-search t)
|
|
|
|
|
(table-begin (goto-char (org-table-begin t)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(type (if (org-at-table.el-p) 'table.el 'org))
|
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(table-end (goto-char (marker-position (org-table-end t))))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(tblfm (when (looking-at "[ \t]*#\\+TBLFM: +\\(.*\\)[ \t]*$")
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(prog1 (org-match-string-no-properties 1)
|
|
|
|
|
(forward-line))))
|
|
|
|
|
(pos-before-blank (point))
|
|
|
|
|
(end (progn (org-skip-whitespace)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(table
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:type ,type
|
|
|
|
|
:tblfm ,tblfm
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Only `org' tables have contents. `table.el'
|
|
|
|
|
;; tables use a `:value' property to store raw
|
|
|
|
|
;; table as a string.
|
|
|
|
|
:contents-begin ,(and (eq type 'org) table-begin)
|
|
|
|
|
:contents-end ,(and (eq type 'org) table-end)
|
|
|
|
|
:value ,(and (eq type 'table.el)
|
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
|
table-begin table-end))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-table-interpreter (table contents)
|
|
|
|
|
"Interpret TABLE element as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(if (eq (org-element-property :type table) 'table.el)
|
|
|
|
|
(org-remove-indentation (org-element-property :value table))
|
|
|
|
|
(concat (with-temp-buffer (insert contents)
|
|
|
|
|
(org-table-align)
|
|
|
|
|
(buffer-string))
|
|
|
|
|
(when (org-element-property :tblfm table)
|
|
|
|
|
(format "#+TBLFM: " (org-element-property :tblfm table))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Table Row
|
|
|
|
|
|
|
|
|
|
(defun org-element-table-row-parser ()
|
|
|
|
|
"Parse table row at point.
|
|
|
|
|
|
|
|
|
|
Return a list whose CAR is `table-row' and CDR is a plist
|
|
|
|
|
containing `:begin', `:end', `:contents-begin', `:contents-end',
|
|
|
|
|
`:type' and `:post-blank' keywords."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((type (if (looking-at "^[ \t]*|-") 'rule 'standard))
|
|
|
|
|
(begin (point))
|
|
|
|
|
;; A table rule has no contents. In that case, ensure
|
|
|
|
|
;; CONTENTS-BEGIN matches CONTENTS-END.
|
|
|
|
|
(contents-begin (if (eq type 'standard)
|
|
|
|
|
(progn (search-forward "|") (point))
|
|
|
|
|
(end-of-line)
|
|
|
|
|
(skip-chars-backward " \r\t\n")
|
|
|
|
|
(point)))
|
|
|
|
|
(contents-end (progn (end-of-line)
|
|
|
|
|
(skip-chars-backward " \r\t\n")
|
|
|
|
|
(point)))
|
|
|
|
|
(end (progn (forward-line) (point))))
|
|
|
|
|
`(table-row
|
|
|
|
|
(:type ,type
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank 0)))))
|
|
|
|
|
|
|
|
|
|
(defun org-element-table-row-interpreter (table-row contents)
|
|
|
|
|
"Interpret TABLE-ROW element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the table row."
|
|
|
|
|
(if (eq (org-element-property :type table-row) 'rule) "|-"
|
|
|
|
|
(concat "| " contents)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
2012-01-11 09:14:08 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Verse Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
2012-04-25 16:15:29 -04:00
|
|
|
|
(defun org-element-verse-block-parser ()
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Parse a verse block.
|
|
|
|
|
|
2012-04-25 16:15:29 -04:00
|
|
|
|
Return a list whose CAR is `verse-block' and CDR is a plist
|
|
|
|
|
containing `:begin', `:end', `:contents-begin', `:contents-end',
|
|
|
|
|
`:hiddenp' and `:post-blank' keywords.
|
2012-03-28 09:33:20 -04:00
|
|
|
|
|
2012-04-25 16:15:29 -04:00
|
|
|
|
Assume point is at beginning of the block."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((case-fold-search t)
|
2012-04-25 16:15:29 -04:00
|
|
|
|
(keywords (org-element-collect-affiliated-keywords))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(begin (car keywords))
|
|
|
|
|
(hidden (progn (forward-line) (org-truely-invisible-p)))
|
2012-04-25 16:15:29 -04:00
|
|
|
|
(contents-begin (point))
|
|
|
|
|
(contents-end
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(progn
|
|
|
|
|
(re-search-forward (concat "^[ \t]*#\\+END_VERSE") nil t)
|
|
|
|
|
(point-at-bol)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(pos-before-blank (progn (forward-line) (point)))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(end (progn (org-skip-whitespace)
|
2012-04-25 16:15:29 -04:00
|
|
|
|
(if (eobp) (point) (point-at-bol)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(verse-block
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
2012-04-25 16:15:29 -04:00
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
2012-03-19 16:38:12 -04:00
|
|
|
|
:hiddenp ,hidden
|
|
|
|
|
:post-blank ,(count-lines pos-before-blank end)
|
|
|
|
|
,@(cadr keywords))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-verse-block-interpreter (verse-block contents)
|
|
|
|
|
"Interpret VERSE-BLOCK element as Org syntax.
|
2012-04-25 16:15:29 -04:00
|
|
|
|
CONTENTS is verse block contents."
|
|
|
|
|
(format "#+BEGIN_VERSE\n%s#+END_VERSE" contents))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Objects
|
|
|
|
|
|
|
|
|
|
;; Unlike to elements, interstices can be found between objects.
|
|
|
|
|
;; That's why, along with the parser, successor functions are provided
|
|
|
|
|
;; for each object. Some objects share the same successor
|
|
|
|
|
;; (i.e. `emphasis' and `verbatim' objects).
|
|
|
|
|
|
|
|
|
|
;; A successor must accept a single argument bounding the search. It
|
2012-04-27 09:02:22 -04:00
|
|
|
|
;; will return either a cons cell whose CAR is the object's type, as
|
|
|
|
|
;; a symbol, and CDR the position of its next occurrence, or nil.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;; Successors follow the naming convention:
|
|
|
|
|
;; org-element-NAME-successor, where NAME is the name of the
|
|
|
|
|
;; successor, as defined in `org-element-all-successors'.
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; Some object types (i.e. `emphasis') are recursive. Restrictions on
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; object types they can contain will be specified in
|
|
|
|
|
;; `org-element-object-restrictions'.
|
|
|
|
|
|
|
|
|
|
;; Adding a new type of object is simple. Implement a successor,
|
|
|
|
|
;; a parser, and an interpreter for it, all following the naming
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; convention. Register type in `org-element-all-objects' and
|
|
|
|
|
;; successor in `org-element-all-successors'. Maybe tweak
|
|
|
|
|
;; restrictions about it, and that's it.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;;;; Emphasis
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-emphasis-parser ()
|
|
|
|
|
"Parse text markup object at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `emphasis' and CDR is a plist with
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:marker', `:begin', `:end', `:contents-begin' and
|
|
|
|
|
`:contents-end' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the first emphasis marker."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(unless (bolp) (backward-char 1))
|
|
|
|
|
(looking-at org-emph-re)
|
|
|
|
|
(let ((begin (match-beginning 2))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(marker (org-match-string-no-properties 3))
|
|
|
|
|
(contents-begin (match-beginning 4))
|
|
|
|
|
(contents-end (match-end 4))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 2))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(emphasis
|
|
|
|
|
(:marker ,marker
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-emphasis-interpreter (emphasis contents)
|
|
|
|
|
"Interpret EMPHASIS object as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the object."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((marker (org-element-property :marker emphasis)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(concat marker contents marker)))
|
|
|
|
|
|
|
|
|
|
(defun org-element-text-markup-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next emphasis or verbatim object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `emphasis' or `verbatim'
|
|
|
|
|
and CDR is beginning position."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(unless (bolp) (backward-char))
|
|
|
|
|
(when (re-search-forward org-emph-re limit t)
|
|
|
|
|
(cons (if (nth 4 (assoc (match-string 3) org-emphasis-alist))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
'verbatim
|
|
|
|
|
'emphasis)
|
|
|
|
|
(match-beginning 2)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;;;; Entity
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-entity-parser ()
|
|
|
|
|
"Parse entity at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `entity' and CDR a plist with
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:begin', `:end', `:latex', `:latex-math-p', `:html', `:latin1',
|
|
|
|
|
`:utf-8', `:ascii', `:use-brackets-p' and `:post-blank' as
|
|
|
|
|
keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the entity."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(looking-at "\\\\\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|{}\\|[^[:alpha:]]\\)")
|
|
|
|
|
(let* ((value (org-entity-get (match-string 1)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(begin (match-beginning 0))
|
|
|
|
|
(bracketsp (string= (match-string 2) "{}"))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 1))
|
|
|
|
|
(when bracketsp (forward-char 2))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(entity
|
|
|
|
|
(:name ,(car value)
|
|
|
|
|
:latex ,(nth 1 value)
|
|
|
|
|
:latex-math-p ,(nth 2 value)
|
|
|
|
|
:html ,(nth 3 value)
|
|
|
|
|
:ascii ,(nth 4 value)
|
|
|
|
|
:latin1 ,(nth 5 value)
|
|
|
|
|
:utf-8 ,(nth 6 value)
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:use-brackets-p ,bracketsp
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-entity-interpreter (entity contents)
|
|
|
|
|
"Interpret ENTITY object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
|
|
|
|
(concat "\\"
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :name entity)
|
|
|
|
|
(when (org-element-property :use-brackets-p entity) "{}")))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-latex-or-entity-successor (limit)
|
|
|
|
|
"Search for the next latex-fragment or entity object.
|
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `entity' or
|
|
|
|
|
`latex-fragment' and CDR is beginning position."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((matchers (plist-get org-format-latex-options :matchers))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; ENTITY-RE matches both LaTeX commands and Org entities.
|
|
|
|
|
(entity-re
|
|
|
|
|
"\\\\\\(frac[13][24]\\|[a-zA-Z]+\\)\\($\\|[^[:alpha:]\n]\\)"))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(when (re-search-forward
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(concat (mapconcat (lambda (e) (nth 1 (assoc e org-latex-regexps)))
|
|
|
|
|
matchers "\\|")
|
|
|
|
|
"\\|" entity-re)
|
|
|
|
|
limit t)
|
|
|
|
|
(goto-char (match-beginning 0))
|
|
|
|
|
(if (looking-at entity-re)
|
|
|
|
|
;; Determine if it's a real entity or a LaTeX command.
|
|
|
|
|
(cons (if (org-entity-get (match-string 1)) 'entity 'latex-fragment)
|
|
|
|
|
(match-beginning 0))
|
|
|
|
|
;; No entity nor command: point is at a LaTeX fragment.
|
|
|
|
|
;; Determine its type to get the correct beginning position.
|
|
|
|
|
(cons 'latex-fragment
|
|
|
|
|
(catch 'return
|
|
|
|
|
(mapc (lambda (e)
|
|
|
|
|
(when (looking-at (nth 1 (assoc e org-latex-regexps)))
|
|
|
|
|
(throw 'return
|
|
|
|
|
(match-beginning
|
|
|
|
|
(nth 2 (assoc e org-latex-regexps))))))
|
|
|
|
|
matchers)
|
|
|
|
|
(point))))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Export Snippet
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-export-snippet-parser ()
|
|
|
|
|
"Parse export snippet at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `export-snippet' and CDR a plist with
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:begin', `:end', `:back-end', `:value' and `:post-blank' as
|
|
|
|
|
keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the snippet."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(looking-at "@\\([-A-Za-z0-9]+\\){")
|
|
|
|
|
(let* ((begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(back-end (org-match-string-no-properties 1))
|
|
|
|
|
(before-blank (progn (goto-char (scan-sexps (1- (match-end 0)) 1))))
|
|
|
|
|
(value (buffer-substring-no-properties
|
|
|
|
|
(match-end 0) (1- before-blank)))
|
|
|
|
|
(post-blank (skip-chars-forward " \t"))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(export-snippet
|
|
|
|
|
(:back-end ,back-end
|
|
|
|
|
:value ,value
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-export-snippet-interpreter (export-snippet contents)
|
|
|
|
|
"Interpret EXPORT-SNIPPET object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
|
|
|
|
(format "@%s{%s}"
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :back-end export-snippet)
|
|
|
|
|
(org-element-property :value export-snippet)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-export-snippet-successor (limit)
|
|
|
|
|
"Search for the next export-snippet object.
|
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `export-snippet' CDR is
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
its beginning position."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(catch 'exit
|
|
|
|
|
(while (re-search-forward "@[-A-Za-z0-9]+{" limit t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(when (let ((end (ignore-errors (scan-sexps (1- (point)) 1))))
|
|
|
|
|
(and end (eq (char-before end) ?})))
|
|
|
|
|
(throw 'exit (cons 'export-snippet (match-beginning 0))))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Footnote Reference
|
2011-12-01 09:42:06 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-footnote-reference-parser ()
|
|
|
|
|
"Parse footnote reference at point.
|
|
|
|
|
|
2012-04-06 17:50:00 -04:00
|
|
|
|
Return a list whose CAR is `footnote-reference' and CDR a plist
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
with `:label', `:type', `:inline-definition', `:begin', `:end'
|
|
|
|
|
and `:post-blank' as keywords."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
2012-04-06 17:50:00 -04:00
|
|
|
|
(looking-at org-footnote-re)
|
|
|
|
|
(let* ((begin (point))
|
|
|
|
|
(label (or (org-match-string-no-properties 2)
|
|
|
|
|
(org-match-string-no-properties 3)
|
|
|
|
|
(and (match-string 1)
|
|
|
|
|
(concat "fn:" (org-match-string-no-properties 1)))))
|
|
|
|
|
(type (if (or (not label) (match-string 1)) 'inline 'standard))
|
|
|
|
|
(inner-begin (match-end 0))
|
|
|
|
|
(inner-end
|
|
|
|
|
(let ((count 1))
|
|
|
|
|
(forward-char)
|
|
|
|
|
(while (and (> count 0) (re-search-forward "[][]" nil t))
|
|
|
|
|
(if (equal (match-string 0) "[") (incf count) (decf count)))
|
|
|
|
|
(1- (point))))
|
|
|
|
|
(post-blank (progn (goto-char (1+ inner-end))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(skip-chars-forward " \t")))
|
2012-04-06 17:50:00 -04:00
|
|
|
|
(end (point))
|
|
|
|
|
(inline-definition
|
|
|
|
|
(and (eq type 'inline)
|
|
|
|
|
(org-element-parse-secondary-string
|
|
|
|
|
(buffer-substring inner-begin inner-end)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(org-element-restriction 'footnote-reference)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(footnote-reference
|
|
|
|
|
(:label ,label
|
|
|
|
|
:type ,type
|
2012-04-06 17:50:00 -04:00
|
|
|
|
:inline-definition ,inline-definition
|
2012-03-19 16:38:12 -04:00
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2011-12-01 09:42:06 -05:00
|
|
|
|
(defun org-element-footnote-reference-interpreter (footnote-reference contents)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Interpret FOOTNOTE-REFERENCE object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((label (or (org-element-property :label footnote-reference) "fn:"))
|
|
|
|
|
(def
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(let ((inline-def
|
|
|
|
|
(org-element-property :inline-definition footnote-reference)))
|
|
|
|
|
(if (not inline-def) ""
|
|
|
|
|
(concat ":" (org-element-interpret-secondary inline-def))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(format "[%s]" (concat label def))))
|
|
|
|
|
|
|
|
|
|
(defun org-element-footnote-reference-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next footnote-reference object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-06 17:50:00 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `footnote-reference' and
|
|
|
|
|
CDR is beginning position."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(catch 'exit
|
|
|
|
|
(while (re-search-forward org-footnote-re limit t)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((beg (match-beginning 0))
|
|
|
|
|
(count 1))
|
|
|
|
|
(backward-char)
|
|
|
|
|
(while (re-search-forward "[][]" limit t)
|
|
|
|
|
(if (equal (match-string 0) "[") (incf count) (decf count))
|
|
|
|
|
(when (zerop count)
|
|
|
|
|
(throw 'exit (cons 'footnote-reference beg))))))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2011-12-01 09:42:06 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Inline Babel Call
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-inline-babel-call-parser ()
|
|
|
|
|
"Parse inline babel call at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `inline-babel-call' and CDR a plist
|
|
|
|
|
with `:begin', `:end', `:info' and `:post-blank' as keywords.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the babel call."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(unless (bolp) (backward-char))
|
|
|
|
|
(looking-at org-babel-inline-lob-one-liner-regexp)
|
|
|
|
|
(let ((info (save-match-data (org-babel-lob-get-info)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(begin (match-end 1))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 0))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(inline-babel-call
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:info ,info
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-inline-babel-call-interpreter (inline-babel-call contents)
|
|
|
|
|
"Interpret INLINE-BABEL-CALL object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let* ((babel-info (org-element-property :info inline-babel-call))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(main-source (car babel-info))
|
|
|
|
|
(post-options (nth 1 babel-info)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(concat "call_"
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(if (string-match "\\[\\(\\[.*?\\]\\)\\]" main-source)
|
|
|
|
|
;; Remove redundant square brackets.
|
|
|
|
|
(replace-match
|
|
|
|
|
(match-string 1 main-source) nil nil main-source)
|
|
|
|
|
main-source)
|
|
|
|
|
(and post-options (format "[%s]" post-options)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-inline-babel-call-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next inline-babel-call object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `inline-babel-call' and
|
|
|
|
|
CDR is beginning position."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
;; Use a simplified version of
|
|
|
|
|
;; org-babel-inline-lob-one-liner-regexp as regexp for more speed.
|
|
|
|
|
(when (re-search-forward
|
2011-12-09 08:38:36 -05:00
|
|
|
|
"\\(?:babel\\|call\\)_\\([^()\n]+?\\)\\(\\[\\(.*\\)\\]\\|\\(\\)\\)(\\([^\n]*\\))\\(\\[\\(.*?\\)\\]\\)?"
|
|
|
|
|
limit t)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(cons 'inline-babel-call (match-beginning 0)))))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Inline Src Block
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-inline-src-block-parser ()
|
|
|
|
|
"Parse inline source block at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `inline-src-block' and CDR a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
with `:begin', `:end', `:language', `:value', `:parameters' and
|
|
|
|
|
`:post-blank' as keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the inline src block."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(unless (bolp) (backward-char))
|
|
|
|
|
(looking-at org-babel-inline-src-block-regexp)
|
|
|
|
|
(let ((begin (match-beginning 1))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(language (org-match-string-no-properties 2))
|
|
|
|
|
(parameters (org-match-string-no-properties 4))
|
|
|
|
|
(value (org-match-string-no-properties 5))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 0))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(inline-src-block
|
|
|
|
|
(:language ,language
|
|
|
|
|
:value ,value
|
|
|
|
|
:parameters ,parameters
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(defun org-element-inline-src-block-interpreter (inline-src-block contents)
|
|
|
|
|
"Interpret INLINE-SRC-BLOCK object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
|
|
|
|
(let ((language (org-element-property :language inline-src-block))
|
|
|
|
|
(arguments (org-element-property :parameters inline-src-block))
|
|
|
|
|
(body (org-element-property :value inline-src-block)))
|
|
|
|
|
(format "src_%s%s{%s}"
|
|
|
|
|
language
|
|
|
|
|
(if arguments (format "[%s]" arguments) "")
|
|
|
|
|
body)))
|
2012-01-11 09:30:27 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-inline-src-block-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next inline-babel-call element.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `inline-babel-call' and
|
|
|
|
|
CDR is beginning position."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(when (re-search-forward org-babel-inline-src-block-regexp limit t)
|
|
|
|
|
(cons 'inline-src-block (match-beginning 1)))))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Latex Fragment
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-latex-fragment-parser ()
|
|
|
|
|
"Parse latex fragment at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `latex-fragment' and CDR a plist with
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:value', `:begin', `:end', and `:post-blank' as keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the latex fragment."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(substring-match
|
|
|
|
|
(catch 'exit
|
|
|
|
|
(mapc (lambda (e)
|
|
|
|
|
(let ((latex-regexp (nth 1 (assoc e org-latex-regexps))))
|
|
|
|
|
(when (or (looking-at latex-regexp)
|
|
|
|
|
(and (not (bobp))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(backward-char)
|
|
|
|
|
(looking-at latex-regexp))))
|
|
|
|
|
(throw 'exit (nth 2 (assoc e org-latex-regexps))))))
|
|
|
|
|
(plist-get org-format-latex-options :matchers))
|
|
|
|
|
;; None found: it's a macro.
|
|
|
|
|
(looking-at "\\\\[a-zA-Z]+\\*?\\(\\(\\[[^][\n{}]*\\]\\)\\|\\({[^{}\n]*}\\)\\)*")
|
|
|
|
|
0))
|
|
|
|
|
(value (match-string-no-properties substring-match))
|
|
|
|
|
(post-blank (progn (goto-char (match-end substring-match))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(latex-fragment
|
|
|
|
|
(:value ,value
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-latex-fragment-interpreter (latex-fragment contents)
|
|
|
|
|
"Interpret LATEX-FRAGMENT object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :value latex-fragment))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;;;; Line Break
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-line-break-parser ()
|
|
|
|
|
"Parse line break at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `line-break', and CDR a plist with
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:begin', `:end' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the line break."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((begin (point))
|
|
|
|
|
(end (save-excursion (forward-line) (point))))
|
|
|
|
|
`(line-break (:begin ,begin :end ,end :post-blank 0))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-line-break-interpreter (line-break contents)
|
|
|
|
|
"Interpret LINE-BREAK object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"\\\\\n")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-line-break-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next line-break object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `line-break' and CDR is
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
beginning position."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((beg (and (re-search-forward "[^\\\\]\\(\\\\\\\\\\)[ \t]*$" limit t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(goto-char (match-beginning 1)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; A line break can only happen on a non-empty line.
|
|
|
|
|
(when (and beg (re-search-backward "\\S-" (point-at-bol) t))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(cons 'line-break beg)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Link
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-link-parser ()
|
|
|
|
|
"Parse link at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `link' and CDR a plist with `:type',
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:path', `:raw-link', `:begin', `:end', `:contents-begin',
|
|
|
|
|
`:contents-end' and `:post-blank' as keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the link."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
end contents-begin contents-end link-end post-blank path type
|
|
|
|
|
raw-link link)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(cond
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; Type 1: Text targeted from a radio target.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
((and org-target-link-regexp (looking-at org-target-link-regexp))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(setq type "radio"
|
2012-03-19 16:38:12 -04:00
|
|
|
|
link-end (match-end 0)
|
|
|
|
|
path (org-match-string-no-properties 0)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Type 2: Standard link, i.e. [[http://orgmode.org][homepage]]
|
|
|
|
|
((looking-at org-bracket-link-regexp)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(setq contents-begin (match-beginning 3)
|
|
|
|
|
contents-end (match-end 3)
|
|
|
|
|
link-end (match-end 0)
|
|
|
|
|
;; RAW-LINK is the original link.
|
|
|
|
|
raw-link (org-match-string-no-properties 1)
|
|
|
|
|
link (org-link-expand-abbrev
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
" *\n *" " " (org-link-unescape raw-link) t t)))
|
|
|
|
|
;; Determine TYPE of link and set PATH accordingly.
|
|
|
|
|
(cond
|
|
|
|
|
;; File type.
|
|
|
|
|
((or (file-name-absolute-p link) (string-match "^\\.\\.?/" link))
|
|
|
|
|
(setq type "file" path link))
|
|
|
|
|
;; Explicit type (http, irc, bbdb...). See `org-link-types'.
|
|
|
|
|
((string-match org-link-re-with-space3 link)
|
|
|
|
|
(setq type (match-string 1 link) path (match-string 2 link)))
|
|
|
|
|
;; Id type: PATH is the id.
|
|
|
|
|
((string-match "^id:\\([-a-f0-9]+\\)" link)
|
|
|
|
|
(setq type "id" path (match-string 1 link)))
|
|
|
|
|
;; Code-ref type: PATH is the name of the reference.
|
|
|
|
|
((string-match "^(\\(.*\\))$" link)
|
|
|
|
|
(setq type "coderef" path (match-string 1 link)))
|
|
|
|
|
;; Custom-id type: PATH is the name of the custom id.
|
|
|
|
|
((= (aref link 0) ?#)
|
|
|
|
|
(setq type "custom-id" path (substring link 1)))
|
|
|
|
|
;; Fuzzy type: Internal link either matches a target, an
|
|
|
|
|
;; headline name or nothing. PATH is the target or headline's
|
|
|
|
|
;; name.
|
|
|
|
|
(t (setq type "fuzzy" path link))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Type 3: Plain link, i.e. http://orgmode.org
|
|
|
|
|
((looking-at org-plain-link-re)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(setq raw-link (org-match-string-no-properties 0)
|
|
|
|
|
type (org-match-string-no-properties 1)
|
|
|
|
|
path (org-match-string-no-properties 2)
|
|
|
|
|
link-end (match-end 0)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Type 4: Angular link, i.e. <http://orgmode.org>
|
|
|
|
|
((looking-at org-angle-link-re)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(setq raw-link (buffer-substring-no-properties
|
|
|
|
|
(match-beginning 1) (match-end 2))
|
|
|
|
|
type (org-match-string-no-properties 1)
|
|
|
|
|
path (org-match-string-no-properties 2)
|
|
|
|
|
link-end (match-end 0))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; In any case, deduce end point after trailing white space from
|
|
|
|
|
;; LINK-END variable.
|
|
|
|
|
(setq post-blank (progn (goto-char link-end) (skip-chars-forward " \t"))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
end (point))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(link
|
|
|
|
|
(:type ,type
|
|
|
|
|
:path ,path
|
|
|
|
|
:raw-link ,(or raw-link path)
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-link-interpreter (link contents)
|
|
|
|
|
"Interpret LINK object as Org syntax.
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
CONTENTS is the contents of the object, or nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((type (org-element-property :type link))
|
|
|
|
|
(raw-link (org-element-property :raw-link link)))
|
|
|
|
|
(if (string= type "radio") raw-link
|
|
|
|
|
(format "[[%s]%s]"
|
|
|
|
|
raw-link
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(if contents (format "[%s]" contents) "")))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-link-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next link object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `link' and CDR is
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
beginning position."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((link-regexp
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (not org-target-link-regexp) org-any-link-re
|
|
|
|
|
(concat org-any-link-re "\\|" org-target-link-regexp))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(when (re-search-forward link-regexp limit t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(cons 'link (match-beginning 0))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Macro
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-macro-parser ()
|
|
|
|
|
"Parse macro at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `macro' and CDR a plist with `:key',
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:args', `:begin', `:end', `:value' and `:post-blank' as
|
|
|
|
|
keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the macro."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(looking-at "{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\(([ \t\n]*\\([^\000]*?\\))\\)?}}}")
|
|
|
|
|
(let ((begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(key (downcase (org-match-string-no-properties 1)))
|
|
|
|
|
(value (org-match-string-no-properties 0))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 0))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point))
|
|
|
|
|
(args (let ((args (org-match-string-no-properties 3)) args2)
|
|
|
|
|
(when args
|
|
|
|
|
(setq args (org-split-string args ","))
|
|
|
|
|
(while args
|
|
|
|
|
(while (string-match "\\\\\\'" (car args))
|
|
|
|
|
;; Repair bad splits.
|
|
|
|
|
(setcar (cdr args) (concat (substring (car args) 0 -1)
|
|
|
|
|
"," (nth 1 args)))
|
|
|
|
|
(pop args))
|
|
|
|
|
(push (pop args) args2))
|
|
|
|
|
(mapcar 'org-trim (nreverse args2))))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(macro
|
|
|
|
|
(:key ,key
|
|
|
|
|
:value ,value
|
|
|
|
|
:args ,args
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-macro-interpreter (macro contents)
|
|
|
|
|
"Interpret MACRO object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :value macro))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-macro-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next macro object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is cons cell whose CAR is `macro' and CDR is
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
beginning position."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(when (re-search-forward
|
2011-12-09 08:38:36 -05:00
|
|
|
|
"{{{\\([a-zA-Z][-a-zA-Z0-9_]*\\)\\(([ \t\n]*\\([^\000]*?\\))\\)?}}}"
|
|
|
|
|
limit t)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(cons 'macro (match-beginning 0)))))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Radio-target
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-radio-target-parser ()
|
|
|
|
|
"Parse radio target at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `radio-target' and CDR a plist with
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
`:begin', `:end', `:contents-begin', `:contents-end', `:value'
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
and `:post-blank' as keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the radio target."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(looking-at org-radio-target-regexp)
|
|
|
|
|
(let ((begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(contents-begin (match-beginning 1))
|
|
|
|
|
(contents-end (match-end 1))
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
(value (org-match-string-no-properties 1))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(post-blank (progn (goto-char (match-end 0))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(radio-target
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
org-element: Remove some unneeded element properties
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-interpreter,
org-element-comment-block-parser,
org-element-export-block-interpreter,
org-element-src-block-interpreter,
org-element-example-block-interpreter): Use standard case for Org
syntax.
(org-element-inlinetask-parser): Remove `:raw-value' property.
(org-element-headline-interpreter,
org-element-inlinetask-interpreter): Rely on `:title' property instead
of `:raw-value'.
(org-element-item-parser): Remove `:raw-tag' property.
(org-element-item-interpreter): Do not use `:raw-tag' anymore. Rely
on `:tag' instead.
(org-element-verse-block-parser): Remove `:raw-value' property. Use
standard case for Org syntax, too.
(org-element-verse-block-interpreter): Rely on `:value' instead of
`:raw-value'.
(org-element-footnote-reference-parser): Remove `:raw-definition'
value.
(org-element-footnote-reference-interpreter): Use `:inline-definition'
property, when non-nil, instead of `:raw-definition'.
(org-element-radio-target-parser): Rename `:raw-value' into `:value'.
Most raw values don't add worthy information to an element, since they
can be retrieved with an interpretation of the secondary string they
represent.
2012-03-28 07:41:31 -04:00
|
|
|
|
:post-blank ,post-blank
|
|
|
|
|
:value ,value)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-radio-target-interpreter (target contents)
|
|
|
|
|
"Interpret TARGET object as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the object."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(concat "<<<" contents ">>>"))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-radio-target-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next radio-target object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `radio-target' and CDR
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
is beginning position."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(when (re-search-forward org-radio-target-regexp limit t)
|
|
|
|
|
(cons 'radio-target (match-beginning 0)))))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Statistics Cookie
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-statistics-cookie-parser ()
|
|
|
|
|
"Parse statistics cookie at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `statistics-cookie', and CDR a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
with `:begin', `:end', `:value' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the statistics-cookie."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(looking-at "\\[[0-9]*\\(%\\|/[0-9]*\\)\\]")
|
|
|
|
|
(let* ((begin (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(value (buffer-substring-no-properties
|
|
|
|
|
(match-beginning 0) (match-end 0)))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 0))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(statistics-cookie
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:value ,value
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-statistics-cookie-interpreter (statistics-cookie contents)
|
|
|
|
|
"Interpret STATISTICS-COOKIE object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :value statistics-cookie))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-statistics-cookie-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next statistics cookie object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `statistics-cookie' and
|
|
|
|
|
CDR is beginning position."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(when (re-search-forward "\\[[0-9]*\\(%\\|/[0-9]*\\)\\]" limit t)
|
|
|
|
|
(cons 'statistics-cookie (match-beginning 0)))))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Subscript
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-subscript-parser ()
|
|
|
|
|
"Parse subscript at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `subscript' and CDR a plist with
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:begin', `:end', `:contents-begin', `:contents-end',
|
|
|
|
|
`:use-brackets-p' and `:post-blank' as keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the underscore."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(unless (bolp) (backward-char))
|
|
|
|
|
(let ((bracketsp (if (looking-at org-match-substring-with-braces-regexp)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
t
|
|
|
|
|
(not (looking-at org-match-substring-regexp))))
|
|
|
|
|
(begin (match-beginning 2))
|
|
|
|
|
(contents-begin (or (match-beginning 5)
|
|
|
|
|
(match-beginning 3)))
|
|
|
|
|
(contents-end (or (match-end 5) (match-end 3)))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 0))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(subscript
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:use-brackets-p ,bracketsp
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-subscript-interpreter (subscript contents)
|
|
|
|
|
"Interpret SUBSCRIPT object as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the object."
|
|
|
|
|
(format
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (org-element-property :use-brackets-p subscript) "_{%s}" "_%s")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
contents))
|
|
|
|
|
|
|
|
|
|
(defun org-element-sub/superscript-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next sub/superscript object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is either `subscript' or
|
|
|
|
|
`superscript' and CDR is beginning position."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(when (re-search-forward org-match-substring-regexp limit t)
|
|
|
|
|
(cons (if (string= (match-string 2) "_") 'subscript 'superscript)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(match-beginning 2)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Superscript
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-superscript-parser ()
|
|
|
|
|
"Parse superscript at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `superscript' and CDR a plist with
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:begin', `:end', `:contents-begin', `:contents-end',
|
|
|
|
|
`:use-brackets-p' and `:post-blank' as keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the caret."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(unless (bolp) (backward-char))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(let ((bracketsp (if (looking-at org-match-substring-with-braces-regexp) t
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(not (looking-at org-match-substring-regexp))))
|
|
|
|
|
(begin (match-beginning 2))
|
|
|
|
|
(contents-begin (or (match-beginning 5)
|
|
|
|
|
(match-beginning 3)))
|
|
|
|
|
(contents-end (or (match-end 5) (match-end 3)))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 0))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(superscript
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:use-brackets-p ,bracketsp
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-superscript-interpreter (superscript contents)
|
|
|
|
|
"Interpret SUPERSCRIPT object as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the object."
|
|
|
|
|
(format
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (org-element-property :use-brackets-p superscript) "^{%s}" "^%s")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
contents))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;;;; Table Cell
|
|
|
|
|
|
|
|
|
|
(defun org-element-table-cell-parser ()
|
|
|
|
|
"Parse table cell at point.
|
|
|
|
|
|
|
|
|
|
Return a list whose CAR is `table-cell' and CDR is a plist
|
|
|
|
|
containing `:begin', `:end', `:contents-begin', `:contents-end'
|
|
|
|
|
and `:post-blank' keywords."
|
|
|
|
|
(looking-at "[ \t]*\\(.*?\\)[ \t]*|")
|
|
|
|
|
(let* ((begin (match-beginning 0))
|
|
|
|
|
(end (match-end 0))
|
|
|
|
|
(contents-begin (match-beginning 1))
|
|
|
|
|
(contents-end (match-end 1)))
|
|
|
|
|
`(table-cell
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:contents-begin ,contents-begin
|
|
|
|
|
:contents-end ,contents-end
|
|
|
|
|
:post-blank 0))))
|
|
|
|
|
|
|
|
|
|
(defun org-element-table-cell-interpreter (table-cell contents)
|
|
|
|
|
"Interpret TABLE-CELL element as Org syntax.
|
|
|
|
|
CONTENTS is the contents of the cell, or nil."
|
|
|
|
|
(concat " " contents " |"))
|
|
|
|
|
|
|
|
|
|
(defun org-element-table-cell-successor (limit)
|
|
|
|
|
"Search for the next table-cell object.
|
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
|
|
|
|
Return value is a cons cell whose CAR is `table-cell' and CDR is
|
|
|
|
|
beginning position."
|
|
|
|
|
(when (looking-at "[ \t]*.*?[ \t]+|") (cons 'table-cell (point))))
|
|
|
|
|
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Target
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-target-parser ()
|
|
|
|
|
"Parse target at point.
|
|
|
|
|
|
2012-04-08 12:19:17 -04:00
|
|
|
|
Return a list whose CAR is `target' and CDR a plist with
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
`:begin', `:end', `:value' and `:post-blank' as keywords.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
Assume point is at the target."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(looking-at org-target-regexp)
|
|
|
|
|
(let ((begin (point))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(value (org-match-string-no-properties 1))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(post-blank (progn (goto-char (match-end 0))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(target
|
|
|
|
|
(:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:value ,value
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-target-interpreter (target contents)
|
|
|
|
|
"Interpret TARGET object as Org syntax.
|
2012-04-08 12:19:17 -04:00
|
|
|
|
CONTENTS is nil."
|
|
|
|
|
(format "<<%s>>" (org-element-property :value target)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-target-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next target object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `target' and CDR is
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
beginning position."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(when (re-search-forward org-target-regexp limit t)
|
|
|
|
|
(cons 'target (match-beginning 0)))))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Time-stamp
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-time-stamp-parser ()
|
|
|
|
|
"Parse time stamp at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `time-stamp', and CDR a plist with
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:appt-type', `:type', `:begin', `:end', `:value' and
|
|
|
|
|
`:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the beginning of the time-stamp."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let* ((appt-type (cond
|
2011-12-09 08:38:36 -05:00
|
|
|
|
((looking-at (concat org-deadline-string " +"))
|
|
|
|
|
(goto-char (match-end 0))
|
|
|
|
|
'deadline)
|
|
|
|
|
((looking-at (concat org-scheduled-string " +"))
|
|
|
|
|
(goto-char (match-end 0))
|
|
|
|
|
'scheduled)
|
|
|
|
|
((looking-at (concat org-closed-string " +"))
|
|
|
|
|
(goto-char (match-end 0))
|
|
|
|
|
'closed)))
|
|
|
|
|
(begin (and appt-type (match-beginning 0)))
|
|
|
|
|
(type (cond
|
|
|
|
|
((looking-at org-tsr-regexp)
|
|
|
|
|
(if (match-string 2) 'active-range 'active))
|
|
|
|
|
((looking-at org-tsr-regexp-both)
|
|
|
|
|
(if (match-string 2) 'inactive-range 'inactive))
|
|
|
|
|
((looking-at (concat
|
|
|
|
|
"\\(<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(<%%\\(([^>\n]+)\\)>\\)"))
|
|
|
|
|
'diary)))
|
|
|
|
|
(begin (or begin (match-beginning 0)))
|
|
|
|
|
(value (buffer-substring-no-properties
|
|
|
|
|
(match-beginning 0) (match-end 0)))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 0))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(time-stamp
|
|
|
|
|
(:appt-type ,appt-type
|
|
|
|
|
:type ,type
|
|
|
|
|
:value ,value
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-time-stamp-interpreter (time-stamp contents)
|
|
|
|
|
"Interpret TIME-STAMP object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
|
|
|
|
(concat
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(case (org-element-property :appt-type time-stamp)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(closed (concat org-closed-string " "))
|
|
|
|
|
(deadline (concat org-deadline-string " "))
|
|
|
|
|
(scheduled (concat org-scheduled-string " ")))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :value time-stamp)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-time-stamp-successor (limit)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Search for the next time-stamp object.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
LIMIT bounds the search.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return value is a cons cell whose CAR is `time-stamp' and CDR is
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
beginning position."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(when (re-search-forward
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(concat "\\(?:" org-scheduled-string " +\\|"
|
|
|
|
|
org-deadline-string " +\\|" org-closed-string " +\\)?"
|
|
|
|
|
org-ts-regexp-both
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(?:<[0-9]+-[0-9]+-[0-9]+[^>\n]+?\\+[0-9]+[dwmy]>\\)"
|
|
|
|
|
"\\|"
|
|
|
|
|
"\\(?:<%%\\(?:([^>\n]+)\\)>\\)")
|
|
|
|
|
limit t)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(cons 'time-stamp (match-beginning 0)))))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;;;; Verbatim
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-verbatim-parser ()
|
|
|
|
|
"Parse verbatim object at point.
|
|
|
|
|
|
2012-04-27 09:02:22 -04:00
|
|
|
|
Return a list whose CAR is `verbatim' and CDR is a plist with
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`:marker', `:begin', `:end' and `:post-blank' keywords.
|
|
|
|
|
|
|
|
|
|
Assume point is at the first verbatim marker."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(unless (bolp) (backward-char 1))
|
|
|
|
|
(looking-at org-emph-re)
|
|
|
|
|
(let ((begin (match-beginning 2))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(marker (org-match-string-no-properties 3))
|
|
|
|
|
(value (org-match-string-no-properties 4))
|
|
|
|
|
(post-blank (progn (goto-char (match-end 2))
|
|
|
|
|
(skip-chars-forward " \t")))
|
|
|
|
|
(end (point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
`(verbatim
|
|
|
|
|
(:marker ,marker
|
|
|
|
|
:begin ,begin
|
|
|
|
|
:end ,end
|
|
|
|
|
:value ,value
|
|
|
|
|
:post-blank ,post-blank)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-verbatim-interpreter (verbatim contents)
|
|
|
|
|
"Interpret VERBATIM object as Org syntax.
|
|
|
|
|
CONTENTS is nil."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((marker (org-element-property :marker verbatim))
|
|
|
|
|
(value (org-element-property :value verbatim)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(concat marker value marker)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Definitions And Rules
|
|
|
|
|
|
|
|
|
|
;; Define elements, greater elements and specify recursive objects,
|
|
|
|
|
;; along with the affiliated keywords recognized. Also set up
|
|
|
|
|
;; restrictions on recursive objects combinations.
|
|
|
|
|
|
|
|
|
|
;; These variables really act as a control center for the parsing
|
|
|
|
|
;; process.
|
|
|
|
|
(defconst org-element-paragraph-separate
|
|
|
|
|
(concat "\f" "\\|" "^[ \t]*$" "\\|"
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; Headlines and inlinetasks.
|
|
|
|
|
org-outline-regexp-bol "\\|"
|
|
|
|
|
;; Comments, blocks (any type), keywords and babel calls.
|
|
|
|
|
"^[ \t]*#\\+" "\\|" "^#\\( \\|$\\)" "\\|"
|
|
|
|
|
;; Lists.
|
|
|
|
|
(org-item-beginning-re) "\\|"
|
|
|
|
|
;; Fixed-width, drawers (any type) and tables.
|
|
|
|
|
"^[ \t]*[:|]" "\\|"
|
|
|
|
|
;; Footnote definitions.
|
|
|
|
|
org-footnote-definition-re "\\|"
|
|
|
|
|
;; Horizontal rules.
|
|
|
|
|
"^[ \t]*-\\{5,\\}[ \t]*$" "\\|"
|
|
|
|
|
;; LaTeX environments.
|
|
|
|
|
"^[ \t]*\\\\\\(begin\\|end\\)")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Regexp to separate paragraphs in an Org buffer.")
|
|
|
|
|
|
|
|
|
|
(defconst org-element-all-elements
|
|
|
|
|
'(center-block comment comment-block drawer dynamic-block example-block
|
2011-12-09 08:38:36 -05:00
|
|
|
|
export-block fixed-width footnote-definition headline
|
|
|
|
|
horizontal-rule inlinetask item keyword latex-environment
|
|
|
|
|
babel-call paragraph plain-list property-drawer quote-block
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
quote-section section special-block src-block table table-row
|
2012-03-19 16:38:12 -04:00
|
|
|
|
verse-block)
|
|
|
|
|
"Complete list of element types.")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defconst org-element-greater-elements
|
|
|
|
|
'(center-block drawer dynamic-block footnote-definition headline inlinetask
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
item plain-list quote-block section special-block table)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"List of recursive element types aka Greater Elements.")
|
|
|
|
|
|
|
|
|
|
(defconst org-element-all-successors
|
|
|
|
|
'(export-snippet footnote-reference inline-babel-call inline-src-block
|
2011-12-09 08:38:36 -05:00
|
|
|
|
latex-or-entity line-break link macro radio-target
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
statistics-cookie sub/superscript table-cell target
|
|
|
|
|
text-markup time-stamp)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Complete list of successors.")
|
|
|
|
|
|
|
|
|
|
(defconst org-element-object-successor-alist
|
|
|
|
|
'((subscript . sub/superscript) (superscript . sub/superscript)
|
|
|
|
|
(emphasis . text-markup) (verbatim . text-markup)
|
|
|
|
|
(entity . latex-or-entity) (latex-fragment . latex-or-entity))
|
|
|
|
|
"Alist of translations between object type and successor name.
|
|
|
|
|
|
|
|
|
|
Sharing the same successor comes handy when, for example, the
|
|
|
|
|
regexp matching one object can also match the other object.")
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(defconst org-element-all-objects
|
|
|
|
|
'(emphasis entity export-snippet footnote-reference inline-babel-call
|
|
|
|
|
inline-src-block line-break latex-fragment link macro radio-target
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
statistics-cookie subscript superscript table-cell target
|
|
|
|
|
time-stamp verbatim)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Complete list of object types.")
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defconst org-element-recursive-objects
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
'(emphasis link macro subscript radio-target superscript table-cell)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"List of recursive object types.")
|
|
|
|
|
|
|
|
|
|
(defconst org-element-non-recursive-block-alist
|
2012-03-28 08:04:26 -04:00
|
|
|
|
'(("ASCII" . export-block)
|
|
|
|
|
("COMMENT" . comment-block)
|
|
|
|
|
("DOCBOOK" . export-block)
|
|
|
|
|
("EXAMPLE" . example-block)
|
|
|
|
|
("HTML" . export-block)
|
|
|
|
|
("LATEX" . export-block)
|
|
|
|
|
("ODT" . export-block)
|
|
|
|
|
("SRC" . src-block)
|
|
|
|
|
("VERSE" . verse-block))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Alist between non-recursive block name and their element type.")
|
|
|
|
|
|
|
|
|
|
(defconst org-element-affiliated-keywords
|
2012-03-28 08:04:26 -04:00
|
|
|
|
'("ATTR_ASCII" "ATTR_DOCBOOK" "ATTR_HTML" "ATTR_LATEX" "ATTR_ODT" "CAPTION"
|
|
|
|
|
"DATA" "HEADER" "HEADERS" "LABEL" "NAME" "PLOT" "RESNAME" "RESULT" "RESULTS"
|
|
|
|
|
"SOURCE" "SRCNAME" "TBLNAME")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"List of affiliated keywords as strings.")
|
|
|
|
|
|
|
|
|
|
(defconst org-element-keyword-translation-alist
|
2012-03-28 08:04:26 -04:00
|
|
|
|
'(("DATA" . "NAME") ("LABEL" . "NAME") ("RESNAME" . "NAME")
|
|
|
|
|
("SOURCE" . "NAME") ("SRCNAME" . "NAME") ("TBLNAME" . "NAME")
|
|
|
|
|
("RESULT" . "RESULTS") ("HEADERS" . "HEADER"))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Alist of usual translations for keywords.
|
|
|
|
|
The key is the old name and the value the new one. The property
|
|
|
|
|
holding their value will be named after the translated name.")
|
|
|
|
|
|
|
|
|
|
(defconst org-element-multiple-keywords
|
2012-03-28 08:04:26 -04:00
|
|
|
|
'("ATTR_ASCII" "ATTR_DOCBOOK" "ATTR_HTML" "ATTR_LATEX" "ATTR_ODT" "HEADER")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"List of affiliated keywords that can occur more that once in an element.
|
|
|
|
|
|
|
|
|
|
Their value will be consed into a list of strings, which will be
|
|
|
|
|
returned as the value of the property.
|
|
|
|
|
|
|
|
|
|
This list is checked after translations have been applied. See
|
|
|
|
|
`org-element-keyword-translation-alist'.")
|
|
|
|
|
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(defconst org-element-parsed-keywords '("AUTHOR" "CAPTION" "TITLE")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"List of keywords whose value can be parsed.
|
|
|
|
|
|
|
|
|
|
Their value will be stored as a secondary string: a list of
|
|
|
|
|
strings and objects.
|
|
|
|
|
|
|
|
|
|
This list is checked after translations have been applied. See
|
|
|
|
|
`org-element-keyword-translation-alist'.")
|
|
|
|
|
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(defconst org-element-dual-keywords '("CAPTION" "RESULTS")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"List of keywords which can have a secondary value.
|
|
|
|
|
|
|
|
|
|
In Org syntax, they can be written with optional square brackets
|
|
|
|
|
before the colons. For example, results keyword can be
|
|
|
|
|
associated to a hash value with the following:
|
|
|
|
|
|
2012-03-28 08:04:26 -04:00
|
|
|
|
#+RESULTS[hash-string]: some-source
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
This list is checked after translations have been applied. See
|
|
|
|
|
`org-element-keyword-translation-alist'.")
|
|
|
|
|
|
|
|
|
|
(defconst org-element-object-restrictions
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
`((emphasis entity export-snippet inline-babel-call inline-src-block link
|
2011-12-09 08:38:36 -05:00
|
|
|
|
radio-target sub/superscript target text-markup time-stamp)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(footnote-reference entity export-snippet footnote-reference
|
2012-03-19 16:38:12 -04:00
|
|
|
|
inline-babel-call inline-src-block latex-fragment
|
|
|
|
|
line-break link macro radio-target sub/superscript
|
|
|
|
|
target text-markup time-stamp)
|
|
|
|
|
(headline entity inline-babel-call inline-src-block latex-fragment link
|
|
|
|
|
macro radio-target statistics-cookie sub/superscript text-markup
|
|
|
|
|
time-stamp)
|
|
|
|
|
(inlinetask entity inline-babel-call inline-src-block latex-fragment link
|
|
|
|
|
macro radio-target sub/superscript text-markup time-stamp)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(item entity inline-babel-call latex-fragment macro radio-target
|
2012-03-19 16:38:12 -04:00
|
|
|
|
sub/superscript target text-markup)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(keyword entity latex-fragment macro sub/superscript text-markup)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(link entity export-snippet inline-babel-call inline-src-block
|
|
|
|
|
latex-fragment link sub/superscript text-markup)
|
|
|
|
|
(macro macro)
|
|
|
|
|
(paragraph ,@org-element-all-successors)
|
|
|
|
|
(radio-target entity export-snippet latex-fragment sub/superscript)
|
|
|
|
|
(subscript entity export-snippet inline-babel-call inline-src-block
|
|
|
|
|
latex-fragment sub/superscript text-markup)
|
|
|
|
|
(superscript entity export-snippet inline-babel-call inline-src-block
|
|
|
|
|
latex-fragment sub/superscript text-markup)
|
|
|
|
|
(table-cell entity export-snippet latex-fragment link macro radio-target
|
|
|
|
|
sub/superscript target text-markup time-stamp)
|
|
|
|
|
(table-row table-cell)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(verse-block entity footnote-reference inline-babel-call inline-src-block
|
|
|
|
|
latex-fragment line-break link macro radio-target
|
|
|
|
|
sub/superscript target text-markup time-stamp))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
"Alist of objects restrictions.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
CAR is an element or object type containing objects and CDR is
|
|
|
|
|
a list of successors that will be called within an element or
|
|
|
|
|
object of such type.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
For example, in a `radio-target' object, one can only find
|
|
|
|
|
entities, export snippets, latex-fragments, subscript and
|
|
|
|
|
superscript.
|
|
|
|
|
|
|
|
|
|
This alist also applies to secondary string. For example, an
|
|
|
|
|
`headline' type element doesn't directly contain objects, but
|
|
|
|
|
still has an entry since one of its properties (`:title') does.")
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(defconst org-element-secondary-value-alist
|
|
|
|
|
'((headline . :title)
|
|
|
|
|
(inlinetask . :title)
|
|
|
|
|
(item . :tag)
|
2012-04-25 16:15:29 -04:00
|
|
|
|
(footnote-reference . :inline-definition))
|
2012-03-28 09:33:20 -04:00
|
|
|
|
"Alist between element types and location of secondary value.")
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Accessors
|
|
|
|
|
;;
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Provide four accessors: `org-element-type', `org-element-property'
|
|
|
|
|
;; `org-element-contents' and `org-element-restriction'.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
|
|
|
|
(defun org-element-type (element)
|
|
|
|
|
"Return type of element ELEMENT.
|
|
|
|
|
|
|
|
|
|
The function returns the type of the element or object provided.
|
|
|
|
|
It can also return the following special value:
|
|
|
|
|
`plain-text' for a string
|
|
|
|
|
`org-data' for a complete document
|
|
|
|
|
nil in any other case."
|
|
|
|
|
(cond
|
|
|
|
|
((not (consp element)) (and (stringp element) 'plain-text))
|
|
|
|
|
((symbolp (car element)) (car element))))
|
|
|
|
|
|
|
|
|
|
(defun org-element-property (property element)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Extract the value from the PROPERTY of an ELEMENT."
|
|
|
|
|
(plist-get (nth 1 element) property))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(defun org-element-contents (element)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Extract contents from an ELEMENT."
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(and (consp element) (nthcdr 2 element)))
|
|
|
|
|
|
|
|
|
|
(defun org-element-restriction (element)
|
|
|
|
|
"Return restriction associated to ELEMENT.
|
|
|
|
|
ELEMENT can be an element, an object or a symbol representing an
|
|
|
|
|
element or object type."
|
|
|
|
|
(cdr (assq (if (symbolp element) element (org-element-type element))
|
|
|
|
|
org-element-object-restrictions)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;;; Parsing Element Starting At Point
|
|
|
|
|
|
|
|
|
|
;; `org-element-current-element' is the core function of this section.
|
|
|
|
|
;; It returns the Lisp representation of the element starting at
|
|
|
|
|
;; point. It uses `org-element--element-block-re' for quick access to
|
|
|
|
|
;; a common regexp.
|
|
|
|
|
|
|
|
|
|
(defconst org-element--element-block-re
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(format "[ \t]*#\\+BEGIN_\\(%s\\)\\(?: \\|$\\)"
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(mapconcat
|
|
|
|
|
'regexp-quote
|
|
|
|
|
(mapcar 'car org-element-non-recursive-block-alist) "\\|"))
|
|
|
|
|
"Regexp matching the beginning of a non-recursive block type.
|
|
|
|
|
Used internally by `org-element-current-element'. Do not modify
|
|
|
|
|
it directly, set `org-element-recursive-block-alist' instead.")
|
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(defun org-element-current-element (&optional granularity special structure)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Parse the element starting at point.
|
|
|
|
|
|
|
|
|
|
Return value is a list like (TYPE PROPS) where TYPE is the type
|
|
|
|
|
of the element and PROPS a plist of properties associated to the
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
element.
|
|
|
|
|
|
|
|
|
|
Possible types are defined in `org-element-all-elements'.
|
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
Optional argument GRANULARITY determines the depth of the
|
|
|
|
|
recursion. Allowed values are `headline', `greater-element',
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
`element', `object' or nil. When it is broader than `object' (or
|
2012-03-28 09:33:20 -04:00
|
|
|
|
nil), secondary values will not be parsed, since they only
|
|
|
|
|
contain objects.
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
Optional argument SPECIAL, when non-nil, can be either `item',
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
`section', `quote-section' or `table-row'. `item' allows to
|
|
|
|
|
parse item wise instead of plain-list wise, using STRUCTURE as
|
|
|
|
|
the current list structure. `section' (resp. `quote-section')
|
|
|
|
|
will try to parse a section (resp. a quote section) before
|
2012-04-27 09:02:22 -04:00
|
|
|
|
anything else, whereas `table-row' will look for rows within
|
|
|
|
|
a table.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
|
|
|
|
If STRUCTURE isn't provided but SPECIAL is set to `item', it will
|
|
|
|
|
be computed.
|
2012-02-23 19:23:25 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
Unlike to `org-element-at-point', this function assumes point is
|
|
|
|
|
always at the beginning of the element it has to parse. As such,
|
|
|
|
|
it is quicker than its counterpart, albeit more restrictive."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; If point is at an affiliated keyword, try moving to the
|
|
|
|
|
;; beginning of the associated element. If none is found, the
|
|
|
|
|
;; keyword is orphaned and will be treated as plain text.
|
|
|
|
|
(when (looking-at org-element--affiliated-re)
|
|
|
|
|
(let ((opoint (point)))
|
|
|
|
|
(while (looking-at org-element--affiliated-re) (forward-line))
|
|
|
|
|
(when (looking-at "[ \t]*$") (goto-char opoint))))
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(let ((case-fold-search t)
|
|
|
|
|
;; Determine if parsing depth allows for secondary strings
|
|
|
|
|
;; parsing. It only applies to elements referenced in
|
|
|
|
|
;; `org-element-secondary-value-alist'.
|
|
|
|
|
(raw-secondary-p (and granularity (not (eq granularity 'object)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(cond
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Item
|
|
|
|
|
((eq special 'item)
|
|
|
|
|
(org-element-item-parser (or structure (org-list-struct))
|
|
|
|
|
raw-secondary-p))
|
2012-04-27 09:02:22 -04:00
|
|
|
|
;; Quote Section.
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
((eq special 'quote-section) (org-element-quote-section-parser))
|
2012-04-27 09:02:22 -04:00
|
|
|
|
;; Table Row.
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
((eq special 'table-row) (org-element-table-row-parser))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; Headline.
|
|
|
|
|
((org-with-limited-levels (org-at-heading-p))
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(org-element-headline-parser raw-secondary-p))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Section (must be checked after headline)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
((eq special 'section) (org-element-section-parser))
|
|
|
|
|
;; Non-recursive block.
|
|
|
|
|
((when (looking-at org-element--element-block-re)
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(let ((type (upcase (match-string 1))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (save-excursion
|
|
|
|
|
(re-search-forward
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(format "[ \t]*#\\+END_%s\\(?: \\|$\\)" type) nil t))
|
2012-04-25 16:15:29 -04:00
|
|
|
|
(funcall
|
|
|
|
|
(intern
|
|
|
|
|
(format
|
|
|
|
|
"org-element-%s-parser"
|
|
|
|
|
(cdr (assoc type org-element-non-recursive-block-alist)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-paragraph-parser)))))
|
|
|
|
|
;; Inlinetask.
|
2012-03-28 09:33:20 -04:00
|
|
|
|
((org-at-heading-p) (org-element-inlinetask-parser raw-secondary-p))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; LaTeX Environment or Paragraph if incomplete.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
((looking-at "^[ \t]*\\\\begin{")
|
|
|
|
|
(if (save-excursion
|
|
|
|
|
(re-search-forward "^[ \t]*\\\\end{[^}]*}[ \t]*" nil t))
|
|
|
|
|
(org-element-latex-environment-parser)
|
|
|
|
|
(org-element-paragraph-parser)))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Property Drawer.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
((looking-at org-property-start-re)
|
|
|
|
|
(if (save-excursion (re-search-forward org-property-end-re nil t))
|
|
|
|
|
(org-element-property-drawer-parser)
|
|
|
|
|
(org-element-paragraph-parser)))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Recursive Block, or Paragraph if incomplete.
|
2012-03-28 08:04:26 -04:00
|
|
|
|
((looking-at "[ \t]*#\\+BEGIN_\\([-A-Za-z0-9]+\\)\\(?: \\|$\\)")
|
|
|
|
|
(let ((type (upcase (match-string 1))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(cond
|
|
|
|
|
((not (save-excursion
|
|
|
|
|
(re-search-forward
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(format "[ \t]*#\\+END_%s\\(?: \\|$\\)" type) nil t)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-paragraph-parser))
|
2012-03-28 08:04:26 -04:00
|
|
|
|
((string= type "CENTER") (org-element-center-block-parser))
|
|
|
|
|
((string= type "QUOTE") (org-element-quote-block-parser))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(t (org-element-special-block-parser)))))
|
|
|
|
|
;; Drawer.
|
|
|
|
|
((looking-at org-drawer-regexp)
|
|
|
|
|
(if (save-excursion (re-search-forward "^[ \t]*:END:[ \t]*$" nil t))
|
|
|
|
|
(org-element-drawer-parser)
|
|
|
|
|
(org-element-paragraph-parser)))
|
|
|
|
|
((looking-at "[ \t]*:\\( \\|$\\)") (org-element-fixed-width-parser))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Babel Call.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
((looking-at org-babel-block-lob-one-liner-regexp)
|
|
|
|
|
(org-element-babel-call-parser))
|
2012-04-27 09:28:01 -04:00
|
|
|
|
;; Dynamic Block or Paragraph if incomplete. This must be
|
|
|
|
|
;; checked before regular keywords since their regexp matches
|
|
|
|
|
;; dynamic blocks too.
|
|
|
|
|
((looking-at "[ \t]*#\\+BEGIN:\\(?: \\|$\\)")
|
|
|
|
|
(if (save-excursion
|
|
|
|
|
(re-search-forward "^[ \t]*#\\+END:\\(?: \\|$\\)" nil t))
|
|
|
|
|
(org-element-dynamic-block-parser)
|
|
|
|
|
(org-element-paragraph-parser)))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Keyword, or Paragraph if at an orphaned affiliated keyword.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
((looking-at "[ \t]*#\\+\\([a-z]+\\(:?_[a-z]+\\)*\\):")
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(let ((key (upcase (match-string 1))))
|
|
|
|
|
(if (or (string= key "TBLFM")
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(member key org-element-affiliated-keywords))
|
|
|
|
|
(org-element-paragraph-parser)
|
|
|
|
|
(org-element-keyword-parser))))
|
|
|
|
|
;; Footnote definition.
|
|
|
|
|
((looking-at org-footnote-definition-re)
|
|
|
|
|
(org-element-footnote-definition-parser))
|
|
|
|
|
;; Comment.
|
|
|
|
|
((looking-at "\\(#\\|[ \t]*#\\+\\(?: \\|$\\)\\)")
|
|
|
|
|
(org-element-comment-parser))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Horizontal Rule.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
((looking-at "[ \t]*-\\{5,\\}[ \t]*$")
|
|
|
|
|
(org-element-horizontal-rule-parser))
|
|
|
|
|
;; Table.
|
|
|
|
|
((org-at-table-p t) (org-element-table-parser))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; List or Item.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
((looking-at (org-item-re))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(org-element-plain-list-parser (or structure (org-list-struct))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; Default element: Paragraph.
|
|
|
|
|
(t (org-element-paragraph-parser))))))
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;; Most elements can have affiliated keywords. When looking for an
|
|
|
|
|
;; element beginning, we want to move before them, as they belong to
|
|
|
|
|
;; that element, and, in the meantime, collect information they give
|
|
|
|
|
;; into appropriate properties. Hence the following function.
|
|
|
|
|
|
|
|
|
|
;; Usage of optional arguments may not be obvious at first glance:
|
|
|
|
|
|
|
|
|
|
;; - TRANS-LIST is used to polish keywords names that have evolved
|
|
|
|
|
;; during Org history. In example, even though =result= and
|
|
|
|
|
;; =results= coexist, we want to have them under the same =result=
|
|
|
|
|
;; property. It's also true for "srcname" and "name", where the
|
|
|
|
|
;; latter seems to be preferred nowadays (thus the "name" property).
|
|
|
|
|
|
|
|
|
|
;; - CONSED allows to regroup multi-lines keywords under the same
|
|
|
|
|
;; property, while preserving their own identity. This is mostly
|
|
|
|
|
;; used for "attr_latex" and al.
|
|
|
|
|
|
|
|
|
|
;; - PARSED prepares a keyword value for export. This is useful for
|
|
|
|
|
;; "caption". Objects restrictions for such keywords are defined in
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; `org-element-object-restrictions'.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
;; - DUALS is used to take care of keywords accepting a main and an
|
|
|
|
|
;; optional secondary values. For example "results" has its
|
|
|
|
|
;; source's name as the main value, and may have an hash string in
|
|
|
|
|
;; optional square brackets as the secondary one.
|
|
|
|
|
|
|
|
|
|
;; A keyword may belong to more than one category.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
|
|
|
|
(defconst org-element--affiliated-re
|
|
|
|
|
(format "[ \t]*#\\+\\(%s\\):"
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (keyword)
|
|
|
|
|
(if (member keyword org-element-dual-keywords)
|
|
|
|
|
(format "\\(%s\\)\\(?:\\[\\(.*\\)\\]\\)?"
|
|
|
|
|
(regexp-quote keyword))
|
|
|
|
|
(regexp-quote keyword)))
|
|
|
|
|
org-element-affiliated-keywords "\\|"))
|
|
|
|
|
"Regexp matching any affiliated keyword.
|
|
|
|
|
|
|
|
|
|
Keyword name is put in match group 1. Moreover, if keyword
|
|
|
|
|
belongs to `org-element-dual-keywords', put the dual value in
|
|
|
|
|
match group 2.
|
|
|
|
|
|
|
|
|
|
Don't modify it, set `org-element-affiliated-keywords' instead.")
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-collect-affiliated-keywords (&optional key-re trans-list
|
2011-12-09 08:38:36 -05:00
|
|
|
|
consed parsed duals)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Collect affiliated keywords before point.
|
|
|
|
|
|
|
|
|
|
Optional argument KEY-RE is a regexp matching keywords, which
|
|
|
|
|
puts matched keyword in group 1. It defaults to
|
|
|
|
|
`org-element--affiliated-re'.
|
|
|
|
|
|
|
|
|
|
TRANS-LIST is an alist where key is the keyword and value the
|
|
|
|
|
property name it should be translated to, without the colons. It
|
|
|
|
|
defaults to `org-element-keyword-translation-alist'.
|
|
|
|
|
|
|
|
|
|
CONSED is a list of strings. Any keyword belonging to that list
|
|
|
|
|
will have its value consed. The check is done after keyword
|
|
|
|
|
translation. It defaults to `org-element-multiple-keywords'.
|
|
|
|
|
|
|
|
|
|
PARSED is a list of strings. Any keyword member of this list
|
|
|
|
|
will have its value parsed. The check is done after keyword
|
|
|
|
|
translation. If a keyword is a member of both CONSED and PARSED,
|
|
|
|
|
it's value will be a list of parsed strings. It defaults to
|
|
|
|
|
`org-element-parsed-keywords'.
|
|
|
|
|
|
|
|
|
|
DUALS is a list of strings. Any keyword member of this list can
|
|
|
|
|
have two parts: one mandatory and one optional. Its value is
|
|
|
|
|
a cons cell whose car is the former, and the cdr the latter. If
|
2012-03-19 16:38:12 -04:00
|
|
|
|
a keyword is a member of both PARSED and DUALS, both values will
|
|
|
|
|
be parsed. It defaults to `org-element-dual-keywords'.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
Return a list whose car is the position at the first of them and
|
|
|
|
|
cdr a plist of keywords and values."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(let ((case-fold-search t)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(key-re (or key-re org-element--affiliated-re))
|
|
|
|
|
(trans-list (or trans-list org-element-keyword-translation-alist))
|
|
|
|
|
(consed (or consed org-element-multiple-keywords))
|
|
|
|
|
(parsed (or parsed org-element-parsed-keywords))
|
|
|
|
|
(duals (or duals org-element-dual-keywords))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; RESTRICT is the list of objects allowed in parsed
|
|
|
|
|
;; keywords value.
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(restrict (org-element-restriction 'keyword))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
output)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(unless (bobp)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(while (and (not (bobp))
|
|
|
|
|
(progn (forward-line -1) (looking-at key-re)))
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(let* ((raw-kwd (upcase (or (match-string 2) (match-string 1))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; Apply translation to RAW-KWD. From there, KWD is
|
|
|
|
|
;; the official keyword.
|
|
|
|
|
(kwd (or (cdr (assoc raw-kwd trans-list)) raw-kwd))
|
|
|
|
|
;; Find main value for any keyword.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(value
|
|
|
|
|
(save-match-data
|
|
|
|
|
(org-trim
|
|
|
|
|
(buffer-substring-no-properties
|
|
|
|
|
(match-end 0) (point-at-eol)))))
|
|
|
|
|
;; If KWD is a dual keyword, find its secondary
|
|
|
|
|
;; value. Maybe parse it.
|
|
|
|
|
(dual-value
|
|
|
|
|
(and (member kwd duals)
|
|
|
|
|
(let ((sec (org-match-string-no-properties 3)))
|
|
|
|
|
(if (or (not sec) (not (member kwd parsed))) sec
|
|
|
|
|
(org-element-parse-secondary-string sec restrict)))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; Attribute a property name to KWD.
|
2012-03-28 08:04:26 -04:00
|
|
|
|
(kwd-sym (and kwd (intern (concat ":" (downcase kwd))))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; Now set final shape for VALUE.
|
|
|
|
|
(when (member kwd parsed)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(setq value (org-element-parse-secondary-string value restrict)))
|
|
|
|
|
(when (member kwd duals)
|
|
|
|
|
;; VALUE is mandatory. Set it to nil if there is none.
|
|
|
|
|
(setq value (and value (cons value dual-value))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(when (member kwd consed)
|
|
|
|
|
(setq value (cons value (plist-get output kwd-sym))))
|
|
|
|
|
;; Eventually store the new value in OUTPUT.
|
|
|
|
|
(setq output (plist-put output kwd-sym value))))
|
|
|
|
|
(unless (looking-at key-re) (forward-line 1)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(list (point) output))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; The Org Parser
|
|
|
|
|
|
|
|
|
|
;; The two major functions here are `org-element-parse-buffer', which
|
|
|
|
|
;; parses Org syntax inside the current buffer, taking into account
|
|
|
|
|
;; region, narrowing, or even visibility if specified, and
|
|
|
|
|
;; `org-element-parse-secondary-string', which parses objects within
|
|
|
|
|
;; a given string.
|
|
|
|
|
|
|
|
|
|
;; The (almost) almighty `org-element-map' allows to apply a function
|
|
|
|
|
;; on elements or objects matching some type, and accumulate the
|
|
|
|
|
;; resulting values. In an export situation, it also skips unneeded
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; parts of the parse tree.
|
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-parse-buffer (&optional granularity visible-only)
|
|
|
|
|
"Recursively parse the buffer and return structure.
|
|
|
|
|
If narrowing is in effect, only parse the visible part of the
|
|
|
|
|
buffer.
|
|
|
|
|
|
|
|
|
|
Optional argument GRANULARITY determines the depth of the
|
|
|
|
|
recursion. It can be set to the following symbols:
|
|
|
|
|
|
|
|
|
|
`headline' Only parse headlines.
|
2012-03-28 10:40:43 -04:00
|
|
|
|
`greater-element' Don't recurse into greater elements excepted
|
|
|
|
|
headlines and sections. Thus, elements
|
|
|
|
|
parsed are the top-level ones.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
`element' Parse everything but objects and plain text.
|
|
|
|
|
`object' Parse the complete buffer (default).
|
|
|
|
|
|
|
|
|
|
When VISIBLE-ONLY is non-nil, don't parse contents of hidden
|
|
|
|
|
elements.
|
|
|
|
|
|
|
|
|
|
Assume buffer is in Org mode."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(org-skip-whitespace)
|
|
|
|
|
(nconc (list 'org-data nil)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-element-parse-elements
|
|
|
|
|
(point-at-bol) (point-max)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; Start is section mode so text before the first headline
|
|
|
|
|
;; belongs to a section.
|
|
|
|
|
'section nil granularity visible-only nil))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-22 13:26:34 -04:00
|
|
|
|
(defun org-element-parse-secondary-string (string restriction)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Recursively parse objects in STRING and return structure.
|
|
|
|
|
|
|
|
|
|
RESTRICTION, when non-nil, is a symbol limiting the object types
|
2012-03-22 13:26:34 -04:00
|
|
|
|
that will be looked after."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(insert string)
|
|
|
|
|
(org-element-parse-objects (point-min) (point-max) nil restriction)))
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(defun org-element-map (data types fun &optional info first-match no-recursion)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"Map a function on selected elements or objects.
|
|
|
|
|
|
|
|
|
|
DATA is the parsed tree, as returned by, i.e,
|
|
|
|
|
`org-element-parse-buffer'. TYPES is a symbol or list of symbols
|
|
|
|
|
of elements or objects types. FUN is the function called on the
|
2012-03-19 16:38:12 -04:00
|
|
|
|
matching element or object. It must accept one arguments: the
|
|
|
|
|
element or object itself.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2011-12-24 08:07:47 -05:00
|
|
|
|
When optional argument INFO is non-nil, it should be a plist
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
holding export options. In that case, parts of the parse tree
|
2012-03-19 16:38:12 -04:00
|
|
|
|
not exportable according to that property list will be skipped.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
When optional argument FIRST-MATCH is non-nil, stop at the first
|
|
|
|
|
match for which FUN doesn't return nil, and return that value.
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
Optional argument NO-RECURSION is a symbol or a list of symbols
|
|
|
|
|
representing elements or objects types. `org-element-map' won't
|
|
|
|
|
enter any recursive element or object whose type belongs to that
|
|
|
|
|
list. Though, FUN can still be applied on them.
|
|
|
|
|
|
|
|
|
|
Nil values returned from FUN do not appear in the results."
|
|
|
|
|
;; Ensure TYPES and NO-RECURSION are a list, even of one element.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(unless (listp types) (setq types (list types)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(unless (listp no-recursion) (setq no-recursion (list no-recursion)))
|
2011-12-24 08:07:47 -05:00
|
|
|
|
;; Recursion depth is determined by --CATEGORY.
|
|
|
|
|
(let* ((--category
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(cond
|
|
|
|
|
((loop for type in types
|
|
|
|
|
always (memq type org-element-greater-elements))
|
|
|
|
|
'greater-elements)
|
|
|
|
|
((loop for type in types
|
|
|
|
|
always (memq type org-element-all-elements))
|
|
|
|
|
'elements)
|
|
|
|
|
(t 'objects)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; --RESTRICTS is a list of element types whose secondary
|
|
|
|
|
;; string could possibly contain an object with a type among
|
|
|
|
|
;; TYPES.
|
|
|
|
|
(--restricts
|
|
|
|
|
(and (eq --category 'objects)
|
|
|
|
|
(loop for el in org-element-secondary-value-alist
|
|
|
|
|
when
|
|
|
|
|
(loop for o in types
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
thereis (memq o (org-element-restriction (car el))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
collect (car el))))
|
2011-12-24 08:07:47 -05:00
|
|
|
|
--acc
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(--walk-tree
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(function
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(lambda (--data)
|
|
|
|
|
;; Recursively walk DATA. INFO, if non-nil, is
|
2011-12-24 08:07:47 -05:00
|
|
|
|
;; a plist holding contextual information.
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(mapc
|
2011-12-24 08:07:47 -05:00
|
|
|
|
(lambda (--blob)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(unless (and info (member --blob (plist-get info :ignore-list)))
|
|
|
|
|
(let ((--type (org-element-type --blob)))
|
|
|
|
|
;; Check if TYPE is matching among TYPES. If so,
|
|
|
|
|
;; apply FUN to --BLOB and accumulate return value
|
|
|
|
|
;; into --ACC (or exit if FIRST-MATCH is non-nil).
|
|
|
|
|
(when (memq --type types)
|
|
|
|
|
(let ((result (funcall fun --blob)))
|
|
|
|
|
(cond ((not result))
|
|
|
|
|
(first-match (throw 'first-match result))
|
|
|
|
|
(t (push result --acc)))))
|
|
|
|
|
;; If --BLOB has a secondary string that can
|
|
|
|
|
;; contain objects with their type among TYPES,
|
|
|
|
|
;; look into that string.
|
|
|
|
|
(when (memq --type --restricts)
|
2012-02-26 06:15:28 -05:00
|
|
|
|
(funcall
|
2012-03-19 16:38:12 -04:00
|
|
|
|
--walk-tree
|
|
|
|
|
`(org-data
|
|
|
|
|
nil
|
|
|
|
|
,@(org-element-property
|
|
|
|
|
(cdr (assq --type org-element-secondary-value-alist))
|
|
|
|
|
--blob))))
|
|
|
|
|
;; Now determine if a recursion into --BLOB is
|
|
|
|
|
;; possible. If so, do it.
|
|
|
|
|
(unless (memq --type no-recursion)
|
|
|
|
|
(when (or (and (memq --type org-element-greater-elements)
|
|
|
|
|
(not (eq --category 'greater-elements)))
|
|
|
|
|
(and (memq --type org-element-all-elements)
|
|
|
|
|
(not (eq --category 'elements)))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(org-element-contents --blob))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(funcall --walk-tree --blob))))))
|
|
|
|
|
(org-element-contents --data))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(catch 'first-match
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(funcall --walk-tree data)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Return value in a proper order.
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(nreverse --acc))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; The following functions are internal parts of the parser.
|
|
|
|
|
|
|
|
|
|
;; The first one, `org-element-parse-elements' acts at the element's
|
|
|
|
|
;; level.
|
|
|
|
|
|
|
|
|
|
;; The second one, `org-element-parse-objects' applies on all objects
|
|
|
|
|
;; of a paragraph or a secondary string. It uses
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; `org-element-get-candidates' to optimize the search of the next
|
|
|
|
|
;; object in the buffer.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; More precisely, that function looks for every allowed object type
|
|
|
|
|
;; first. Then, it discards failed searches, keeps further matches,
|
|
|
|
|
;; and searches again types matched behind point, for subsequent
|
|
|
|
|
;; calls. Thus, searching for a given type fails only once, and every
|
|
|
|
|
;; object is searched only once at top level (but sometimes more for
|
|
|
|
|
;; nested types).
|
2012-01-11 09:14:08 -05:00
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(defun org-element-parse-elements
|
|
|
|
|
(beg end special structure granularity visible-only acc)
|
|
|
|
|
"Parse elements between BEG and END positions.
|
|
|
|
|
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
SPECIAL prioritize some elements over the others. It can be set
|
|
|
|
|
to `quote-section', `section' `item' or `table-row', which will
|
|
|
|
|
focus search, respectively, on quote sections, sections, items
|
|
|
|
|
and table-rows. Moreover, when value is `item', STRUCTURE will
|
|
|
|
|
be used as the current list structure.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
2012-03-28 09:33:20 -04:00
|
|
|
|
GRANULARITY determines the depth of the recursion. See
|
|
|
|
|
`org-element-parse-buffer' for more information.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
When VISIBLE-ONLY is non-nil, don't parse contents of hidden
|
2012-03-19 16:38:12 -04:00
|
|
|
|
elements.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
Elements are accumulated into ACC."
|
|
|
|
|
(save-excursion
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(save-restriction
|
|
|
|
|
(narrow-to-region beg end)
|
|
|
|
|
(goto-char beg)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; When parsing only headlines, skip any text before first one.
|
|
|
|
|
(when (and (eq granularity 'headline) (not (org-at-heading-p)))
|
|
|
|
|
(org-with-limited-levels (outline-next-heading)))
|
|
|
|
|
;; Main loop start.
|
|
|
|
|
(while (not (eobp))
|
|
|
|
|
(push
|
|
|
|
|
;; Find current element's type and parse it accordingly to
|
|
|
|
|
;; its category.
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(let* ((element (org-element-current-element
|
|
|
|
|
granularity special structure))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(type (org-element-type element))
|
|
|
|
|
(cbeg (org-element-property :contents-begin element)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char (org-element-property :end element))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(cond
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Case 1. Simply accumulate element if VISIBLE-ONLY is
|
|
|
|
|
;; true and element is hidden or if it has no contents
|
|
|
|
|
;; anyway.
|
|
|
|
|
((or (and visible-only (org-element-property :hiddenp element))
|
|
|
|
|
(not cbeg)) element)
|
|
|
|
|
;; Case 2. Greater element: parse it between
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; `contents-begin' and `contents-end'. Make sure
|
|
|
|
|
;; GRANULARITY allows the recursion, or ELEMENT is an
|
|
|
|
|
;; headline, in which case going inside is mandatory, in
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; order to get sub-level headings.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
((and (memq type org-element-greater-elements)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(or (memq granularity '(element object nil))
|
|
|
|
|
(and (eq granularity 'greater-element)
|
|
|
|
|
(eq type 'section))
|
|
|
|
|
(eq type 'headline)))
|
2012-01-18 16:12:36 -05:00
|
|
|
|
(org-element-parse-elements
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
cbeg (org-element-property :contents-end element)
|
|
|
|
|
;; Possibly move to a special mode.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(case type
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(headline
|
|
|
|
|
(if (org-element-property :quotedp element) 'quote-section
|
|
|
|
|
'section))
|
|
|
|
|
(table 'table-row)
|
|
|
|
|
(plain-list 'item))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :structure element)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
granularity visible-only (nreverse element)))
|
|
|
|
|
;; Case 3. ELEMENT has contents. Parse objects inside,
|
|
|
|
|
;; if GRANULARITY allows it.
|
|
|
|
|
((and cbeg (memq granularity '(object nil)))
|
|
|
|
|
(org-element-parse-objects
|
|
|
|
|
cbeg (org-element-property :contents-end element)
|
|
|
|
|
(nreverse element) (org-element-restriction type)))
|
|
|
|
|
;; Case 4. Else, just accumulate ELEMENT.
|
|
|
|
|
(t element)))
|
|
|
|
|
acc)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Return result.
|
|
|
|
|
(nreverse acc)))
|
|
|
|
|
|
|
|
|
|
(defun org-element-parse-objects (beg end acc restriction)
|
|
|
|
|
"Parse objects between BEG and END and return recursive structure.
|
|
|
|
|
|
|
|
|
|
Objects are accumulated in ACC.
|
|
|
|
|
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
RESTRICTION is a list of object types which are allowed in the
|
|
|
|
|
current object."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(let ((get-next-object
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(function
|
|
|
|
|
(lambda (cand)
|
|
|
|
|
;; Return the parsing function associated to the nearest
|
|
|
|
|
;; object among list of candidates CAND.
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(let ((pos (apply 'min (mapcar 'cdr cand))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char pos)
|
|
|
|
|
(funcall
|
|
|
|
|
(intern
|
|
|
|
|
(format "org-element-%s-parser" (car (rassq pos cand))))))))))
|
|
|
|
|
next-object candidates)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char beg)
|
|
|
|
|
(while (setq candidates (org-element-get-next-object-candidates
|
2011-12-09 08:38:36 -05:00
|
|
|
|
end restriction candidates))
|
|
|
|
|
(setq next-object (funcall get-next-object candidates))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; 1. Text before any object. Untabify it.
|
|
|
|
|
(let ((obj-beg (org-element-property :begin next-object)))
|
|
|
|
|
(unless (= (point) obj-beg)
|
|
|
|
|
(push (replace-regexp-in-string
|
|
|
|
|
"\t" (make-string tab-width ? )
|
|
|
|
|
(buffer-substring-no-properties (point) obj-beg))
|
|
|
|
|
acc)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; 2. Object...
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((obj-end (org-element-property :end next-object))
|
|
|
|
|
(cont-beg (org-element-property :contents-begin next-object)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(push (if (and (memq (car next-object) org-element-recursive-objects)
|
|
|
|
|
cont-beg)
|
|
|
|
|
;; ... recursive. The CONT-BEG check is for
|
|
|
|
|
;; links, as some of them might not be recursive
|
|
|
|
|
;; (i.e. plain links).
|
|
|
|
|
(save-restriction
|
|
|
|
|
(narrow-to-region
|
|
|
|
|
cont-beg
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :contents-end next-object))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-element-parse-objects
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(point-min) (point-max)
|
|
|
|
|
(nreverse next-object)
|
|
|
|
|
;; Restrict allowed objects.
|
|
|
|
|
(org-element-restriction next-object)))
|
|
|
|
|
;; ... not recursive. Accumulate the object.
|
2011-12-09 08:38:36 -05:00
|
|
|
|
next-object)
|
|
|
|
|
acc)
|
|
|
|
|
(goto-char obj-end)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; 3. Text after last object. Untabify it.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(unless (= (point) end)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(push (replace-regexp-in-string
|
|
|
|
|
"\t" (make-string tab-width ? )
|
|
|
|
|
(buffer-substring-no-properties (point) end))
|
|
|
|
|
acc))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Result.
|
|
|
|
|
(nreverse acc))))
|
|
|
|
|
|
|
|
|
|
(defun org-element-get-next-object-candidates (limit restriction objects)
|
|
|
|
|
"Return an alist of candidates for the next object.
|
|
|
|
|
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
LIMIT bounds the search, and RESTRICTION narrows candidates to
|
|
|
|
|
some object types.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
Return value is an alist whose CAR is position and CDR the object
|
|
|
|
|
type, as a symbol.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
OBJECTS is the previous candidates alist."
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(let (next-candidates types-to-search)
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; If no previous result, search every object type in RESTRICTION.
|
|
|
|
|
;; Otherwise, keep potential candidates (old objects located after
|
|
|
|
|
;; point) and ask to search again those which had matched before.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (not objects) (setq types-to-search restriction)
|
|
|
|
|
(mapc (lambda (obj)
|
|
|
|
|
(if (< (cdr obj) (point)) (push (car obj) types-to-search)
|
|
|
|
|
(push obj next-candidates)))
|
|
|
|
|
objects))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Call the appropriate successor function for each type to search
|
|
|
|
|
;; and accumulate matches.
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(mapc
|
|
|
|
|
(lambda (type)
|
|
|
|
|
(let* ((successor-fun
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(intern
|
|
|
|
|
(format "org-element-%s-successor"
|
|
|
|
|
(or (cdr (assq type org-element-object-successor-alist))
|
|
|
|
|
type))))
|
|
|
|
|
(obj (funcall successor-fun limit)))
|
|
|
|
|
(and obj (push obj next-candidates))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
types-to-search)
|
|
|
|
|
;; Return alist.
|
|
|
|
|
next-candidates))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Towards A Bijective Process
|
|
|
|
|
|
|
|
|
|
;; The parse tree obtained with `org-element-parse-buffer' is really
|
|
|
|
|
;; a snapshot of the corresponding Org buffer. Therefore, it can be
|
|
|
|
|
;; interpreted and expanded into a string with canonical Org
|
|
|
|
|
;; syntax. Hence `org-element-interpret-data'.
|
|
|
|
|
;;
|
|
|
|
|
;; Data parsed from secondary strings, whose shape is slightly
|
|
|
|
|
;; different than the standard parse tree, is expanded with the
|
|
|
|
|
;; equivalent function `org-element-interpret-secondary'.
|
|
|
|
|
;;
|
|
|
|
|
;; Both functions rely internally on
|
|
|
|
|
;; `org-element-interpret--affiliated-keywords'.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-interpret-data (data &optional genealogy previous)
|
|
|
|
|
"Interpret a parse tree representing Org data.
|
|
|
|
|
|
|
|
|
|
DATA is the parse tree to interpret.
|
|
|
|
|
|
|
|
|
|
Optional arguments GENEALOGY and PREVIOUS are used for recursive
|
|
|
|
|
calls:
|
|
|
|
|
GENEALOGY is the list of its parents types.
|
|
|
|
|
PREVIOUS is the type of the element or object at the same level
|
|
|
|
|
interpreted before.
|
|
|
|
|
|
|
|
|
|
Return Org syntax as a string."
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (blob)
|
|
|
|
|
;; BLOB can be an element, an object, a string, or nil.
|
|
|
|
|
(cond
|
|
|
|
|
((not blob) nil)
|
|
|
|
|
((equal blob "") nil)
|
|
|
|
|
((stringp blob) blob)
|
|
|
|
|
(t
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let* ((type (org-element-type blob))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(interpreter
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (eq type 'org-data) 'identity
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(intern (format "org-element-%s-interpreter" type))))
|
|
|
|
|
(contents
|
|
|
|
|
(cond
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Elements or objects without contents.
|
|
|
|
|
((not (org-element-contents blob)) nil)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
;; Full Org document.
|
|
|
|
|
((eq type 'org-data)
|
|
|
|
|
(org-element-interpret-data blob genealogy previous))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
;; Greater elements.
|
2011-12-09 08:38:36 -05:00
|
|
|
|
((memq type org-element-greater-elements)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(org-element-interpret-data blob (cons type genealogy) nil))
|
|
|
|
|
(t
|
|
|
|
|
(org-element-interpret-data
|
|
|
|
|
(org-element-normalize-contents
|
|
|
|
|
blob
|
|
|
|
|
;; When normalizing first paragraph of an item or
|
|
|
|
|
;; a footnote-definition, ignore first line's
|
|
|
|
|
;; indentation.
|
|
|
|
|
(and (eq type 'paragraph)
|
|
|
|
|
(not previous)
|
|
|
|
|
(memq (car genealogy) '(footnote-definiton item))))
|
|
|
|
|
(cons type genealogy) nil))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(results (funcall interpreter blob contents)))
|
|
|
|
|
;; Update PREVIOUS.
|
|
|
|
|
(setq previous type)
|
2012-04-10 17:15:32 -04:00
|
|
|
|
;; Build white spaces. If no `:post-blank' property is
|
|
|
|
|
;; specified, assume its value is 0.
|
|
|
|
|
(let ((post-blank (or (org-element-property :post-blank blob) 0)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq type 'org-data) results)
|
|
|
|
|
((memq type org-element-all-elements)
|
|
|
|
|
(concat
|
|
|
|
|
(org-element-interpret--affiliated-keywords blob)
|
|
|
|
|
(org-element-normalize-string results)
|
|
|
|
|
(make-string post-blank 10)))
|
|
|
|
|
(t (concat results (make-string post-blank 32)))))))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-contents data) ""))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-interpret-secondary (secondary)
|
|
|
|
|
"Interpret SECONDARY string as Org syntax.
|
|
|
|
|
|
|
|
|
|
SECONDARY-STRING is a nested list as returned by
|
|
|
|
|
`org-element-parse-secondary-string'.
|
|
|
|
|
|
|
|
|
|
Return interpreted string."
|
|
|
|
|
;; Make SECONDARY acceptable for `org-element-interpret-data'.
|
|
|
|
|
(let ((s (if (listp secondary) secondary (list secondary))))
|
|
|
|
|
(org-element-interpret-data `(org-data nil ,@s) nil nil)))
|
|
|
|
|
|
|
|
|
|
;; Both functions internally use `org-element--affiliated-keywords'.
|
|
|
|
|
|
|
|
|
|
(defun org-element-interpret--affiliated-keywords (element)
|
|
|
|
|
"Return ELEMENT's affiliated keywords as Org syntax.
|
|
|
|
|
If there is no affiliated keyword, return the empty string."
|
|
|
|
|
(let ((keyword-to-org
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(function
|
|
|
|
|
(lambda (key value)
|
|
|
|
|
(let (dual)
|
|
|
|
|
(when (member key org-element-dual-keywords)
|
|
|
|
|
(setq dual (cdr value) value (car value)))
|
2012-04-10 17:15:32 -04:00
|
|
|
|
(concat "#+" key
|
|
|
|
|
(and dual
|
|
|
|
|
(format "[%s]"
|
|
|
|
|
(org-element-interpret-secondary dual)))
|
|
|
|
|
": "
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(if (member key org-element-parsed-keywords)
|
|
|
|
|
(org-element-interpret-secondary value)
|
|
|
|
|
value)
|
|
|
|
|
"\n"))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (key)
|
2012-04-10 17:15:32 -04:00
|
|
|
|
(let ((value (org-element-property (intern (concat ":" (downcase key)))
|
|
|
|
|
element)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(when value
|
|
|
|
|
(if (member key org-element-multiple-keywords)
|
|
|
|
|
(mapconcat (lambda (line)
|
|
|
|
|
(funcall keyword-to-org key line))
|
|
|
|
|
value "")
|
|
|
|
|
(funcall keyword-to-org key value)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Remove translated keywords.
|
|
|
|
|
(delq nil
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (key)
|
|
|
|
|
(and (not (assoc key org-element-keyword-translation-alist)) key))
|
|
|
|
|
org-element-affiliated-keywords))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
"")))
|
|
|
|
|
|
|
|
|
|
;; Because interpretation of the parse tree must return the same
|
|
|
|
|
;; number of blank lines between elements and the same number of white
|
|
|
|
|
;; space after objects, some special care must be given to white
|
|
|
|
|
;; spaces.
|
|
|
|
|
;;
|
|
|
|
|
;; The first function, `org-element-normalize-string', ensures any
|
|
|
|
|
;; string different from the empty string will end with a single
|
|
|
|
|
;; newline character.
|
|
|
|
|
;;
|
|
|
|
|
;; The second function, `org-element-normalize-contents', removes
|
|
|
|
|
;; global indentation from the contents of the current element.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defun org-element-normalize-string (s)
|
|
|
|
|
"Ensure string S ends with a single newline character.
|
|
|
|
|
|
|
|
|
|
If S isn't a string return it unchanged. If S is the empty
|
|
|
|
|
string, return it. Otherwise, return a new string with a single
|
|
|
|
|
newline character at its end."
|
|
|
|
|
(cond
|
|
|
|
|
((not (stringp s)) s)
|
|
|
|
|
((string= "" s) "")
|
|
|
|
|
(t (and (string-match "\\(\n[ \t]*\\)*\\'" s)
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(replace-match "\n" nil nil s)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-normalize-contents (element &optional ignore-first)
|
|
|
|
|
"Normalize plain text in ELEMENT's contents.
|
|
|
|
|
|
|
|
|
|
ELEMENT must only contain plain text and objects.
|
|
|
|
|
|
|
|
|
|
If optional argument IGNORE-FIRST is non-nil, ignore first line's
|
|
|
|
|
indentation to compute maximal common indentation.
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
Return the normalized element that is element with global
|
|
|
|
|
indentation removed from its contents. The function assumes that
|
|
|
|
|
indentation is not done with TAB characters."
|
|
|
|
|
(let (ind-list
|
|
|
|
|
(collect-inds
|
|
|
|
|
(function
|
|
|
|
|
;; Return list of indentations within BLOB. This is done by
|
|
|
|
|
;; walking recursively BLOB and updating IND-LIST along the
|
|
|
|
|
;; way. FIRST-FLAG is non-nil when the first string hasn't
|
|
|
|
|
;; been seen yet. It is required as this string is the only
|
|
|
|
|
;; one whose indentation doesn't happen after a newline
|
|
|
|
|
;; character.
|
|
|
|
|
(lambda (blob first-flag)
|
|
|
|
|
(mapc
|
|
|
|
|
(lambda (object)
|
|
|
|
|
(when (and first-flag (stringp object))
|
|
|
|
|
(setq first-flag nil)
|
|
|
|
|
(string-match "\\`\\( *\\)" object)
|
|
|
|
|
(let ((len (length (match-string 1 object))))
|
|
|
|
|
;; An indentation of zero means no string will be
|
|
|
|
|
;; modified. Quit the process.
|
|
|
|
|
(if (zerop len) (throw 'zero (setq ind-list nil))
|
|
|
|
|
(push len ind-list))))
|
|
|
|
|
(cond
|
|
|
|
|
((stringp object)
|
|
|
|
|
(let ((start 0))
|
2012-04-25 14:40:13 -04:00
|
|
|
|
;; Avoid matching blank or empty lines.
|
|
|
|
|
(while (and (string-match "\n\\( *\\)\\(.\\)" object start)
|
|
|
|
|
(not (equal (match-string 2 object) " ")))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(setq start (match-end 0))
|
|
|
|
|
(push (length (match-string 1 object)) ind-list))))
|
|
|
|
|
((memq (org-element-type object) org-element-recursive-objects)
|
|
|
|
|
(funcall collect-inds object first-flag))))
|
|
|
|
|
(org-element-contents blob))))))
|
|
|
|
|
;; Collect indentation list in ELEMENT. Possibly remove first
|
|
|
|
|
;; value if IGNORE-FIRST is non-nil.
|
|
|
|
|
(catch 'zero (funcall collect-inds element (not ignore-first)))
|
|
|
|
|
(if (not ind-list) element
|
|
|
|
|
;; Build ELEMENT back, replacing each string with the same
|
|
|
|
|
;; string minus common indentation.
|
|
|
|
|
(let ((build
|
|
|
|
|
(function
|
|
|
|
|
(lambda (blob mci first-flag)
|
|
|
|
|
;; Return BLOB with all its strings indentation
|
|
|
|
|
;; shortened from MCI white spaces. FIRST-FLAG is
|
|
|
|
|
;; non-nil when the first string hasn't been seen
|
|
|
|
|
;; yet.
|
|
|
|
|
(nconc
|
|
|
|
|
(list (org-element-type blob) (nth 1 blob))
|
|
|
|
|
(mapcar
|
|
|
|
|
(lambda (object)
|
|
|
|
|
(when (and first-flag (stringp object))
|
|
|
|
|
(setq first-flag nil)
|
|
|
|
|
(setq object
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
(format "\\` \\{%d\\}" mci) "" object)))
|
|
|
|
|
(cond
|
|
|
|
|
((stringp object)
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
(format "\n \\{%d\\}" mci) "\n" object))
|
2012-04-25 14:40:13 -04:00
|
|
|
|
((memq (org-element-type object)
|
|
|
|
|
org-element-recursive-objects)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(funcall build object mci first-flag))
|
|
|
|
|
(t object)))
|
|
|
|
|
(org-element-contents blob)))))))
|
|
|
|
|
(funcall build element (apply 'min ind-list) (not ignore-first))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; The Toolbox
|
|
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; The first move is to implement a way to obtain the smallest element
|
|
|
|
|
;; containing point. This is the job of `org-element-at-point'. It
|
|
|
|
|
;; basically jumps back to the beginning of section containing point
|
|
|
|
|
;; and moves, element after element, with
|
|
|
|
|
;; `org-element-current-element' until the container is found.
|
2012-03-28 09:33:20 -04:00
|
|
|
|
;;
|
|
|
|
|
;; Note: When using `org-element-at-point', secondary values are never
|
|
|
|
|
;; parsed since the function focuses on elements, not on objects.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
|
|
|
|
(defun org-element-at-point (&optional keep-trail)
|
|
|
|
|
"Determine closest element around point.
|
|
|
|
|
|
|
|
|
|
Return value is a list like (TYPE PROPS) where TYPE is the type
|
|
|
|
|
of the element and PROPS a plist of properties associated to the
|
|
|
|
|
element. Possible types are defined in
|
|
|
|
|
`org-element-all-elements'.
|
|
|
|
|
|
|
|
|
|
As a special case, if point is at the very beginning of a list or
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
sub-list, returned element will be that list instead of the first
|
|
|
|
|
item. In the same way, if point is at the beginning of the first
|
|
|
|
|
row of a table, returned element will be the table instead of the
|
|
|
|
|
first row.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
|
|
|
|
If optional argument KEEP-TRAIL is non-nil, the function returns
|
|
|
|
|
a list of of elements leading to element at point. The list's
|
|
|
|
|
CAR is always the element at point. Its last item will be the
|
|
|
|
|
element's parent, unless element was either the first in its
|
|
|
|
|
section (in which case the last item in the list is the first
|
|
|
|
|
element of section) or an headline (in which case the list
|
|
|
|
|
contains that headline as its single element). Elements
|
|
|
|
|
in-between, if any, are siblings of the element at point."
|
|
|
|
|
(org-with-wide-buffer
|
|
|
|
|
;; If at an headline, parse it. It is the sole element that
|
2012-03-28 09:33:20 -04:00
|
|
|
|
;; doesn't require to know about context. Be sure to disallow
|
|
|
|
|
;; secondary string parsing, though.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (org-with-limited-levels (org-at-heading-p))
|
2012-03-28 09:33:20 -04:00
|
|
|
|
(if (not keep-trail) (org-element-headline-parser t)
|
|
|
|
|
(list (org-element-headline-parser t)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; Otherwise move at the beginning of the section containing
|
|
|
|
|
;; point.
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(let ((origin (point)) element type special-flag trail struct prevs)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-with-limited-levels
|
|
|
|
|
(if (org-before-first-heading-p) (goto-char (point-min))
|
|
|
|
|
(org-back-to-heading)
|
|
|
|
|
(forward-line)))
|
|
|
|
|
(org-skip-whitespace)
|
|
|
|
|
(beginning-of-line)
|
|
|
|
|
;; Starting parsing successively each element with
|
|
|
|
|
;; `org-element-current-element'. Skip those ending before
|
|
|
|
|
;; original position.
|
|
|
|
|
(catch 'exit
|
|
|
|
|
(while t
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(setq element (org-element-current-element
|
|
|
|
|
'element special-flag struct)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
type (car element))
|
|
|
|
|
(when keep-trail (push element trail))
|
|
|
|
|
(cond
|
|
|
|
|
;; 1. Skip any element ending before point or at point.
|
|
|
|
|
((let ((end (org-element-property :end element)))
|
|
|
|
|
(when (<= end origin)
|
|
|
|
|
(if (> (point-max) end) (goto-char end)
|
|
|
|
|
(throw 'exit (or trail element))))))
|
|
|
|
|
;; 2. An element containing point is always the element at
|
|
|
|
|
;; point.
|
|
|
|
|
((not (memq type org-element-greater-elements))
|
|
|
|
|
(throw 'exit (if keep-trail trail element)))
|
|
|
|
|
;; 3. At a plain list.
|
|
|
|
|
((eq type 'plain-list)
|
|
|
|
|
(setq struct (org-element-property :structure element)
|
|
|
|
|
prevs (or prevs (org-list-prevs-alist struct)))
|
|
|
|
|
(let ((beg (org-element-property :contents-begin element)))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(if (<= origin beg) (throw 'exit (or trail element))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; Find the item at this level containing ORIGIN.
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(let ((items (org-list-get-all-items beg struct prevs))
|
|
|
|
|
parent)
|
|
|
|
|
(catch 'local
|
|
|
|
|
(mapc
|
|
|
|
|
(lambda (pos)
|
|
|
|
|
(cond
|
|
|
|
|
;; Item ends before point: skip it.
|
|
|
|
|
((<= (org-list-get-item-end pos struct) origin))
|
|
|
|
|
;; Item contains point: store is in PARENT.
|
|
|
|
|
((<= pos origin) (setq parent pos))
|
|
|
|
|
;; We went too far: return PARENT.
|
|
|
|
|
(t (throw 'local nil)))) items))
|
|
|
|
|
;; No parent: no item contained point, though the
|
|
|
|
|
;; plain list does. Point is in the blank lines
|
|
|
|
|
;; after the list: return plain list.
|
|
|
|
|
(if (not parent) (throw 'exit (or trail element))
|
|
|
|
|
(setq special-flag 'item)
|
|
|
|
|
(goto-char parent))))))
|
|
|
|
|
;; 4. At a table.
|
|
|
|
|
((eq type 'table)
|
|
|
|
|
(if (eq (org-element-property :type element) 'table.el)
|
|
|
|
|
(throw 'exit (or trail element))
|
|
|
|
|
(let ((beg (org-element-property :contents-begin element))
|
|
|
|
|
(end (org-element-property :contents-end element)))
|
|
|
|
|
(if (or (<= origin beg) (>= origin end))
|
|
|
|
|
(throw 'exit (or trail element))
|
|
|
|
|
(when keep-trail (setq trail (list element)))
|
|
|
|
|
(setq special-flag 'table-row)
|
|
|
|
|
(narrow-to-region beg end)))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
;; 4. At any other greater element type, if point is
|
|
|
|
|
;; within contents, move into it. Otherwise, return
|
|
|
|
|
;; that element.
|
|
|
|
|
(t
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(when (eq type 'item) (setq special-flag nil))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((beg (org-element-property :contents-begin element))
|
|
|
|
|
(end (org-element-property :contents-end element)))
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
(if (or (not beg) (not end) (> beg origin) (< end origin))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(throw 'exit (or trail element))
|
|
|
|
|
;; Reset trail, since we found a parent.
|
|
|
|
|
(when keep-trail (setq trail (list element)))
|
|
|
|
|
(narrow-to-region beg end)
|
|
|
|
|
(goto-char beg)))))))))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Once the local structure around point is well understood, it's easy
|
|
|
|
|
;; to implement some replacements for `forward-paragraph'
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; `backward-paragraph', namely `org-element-forward' and
|
|
|
|
|
;; `org-element-backward'.
|
|
|
|
|
|
|
|
|
|
;; Also, `org-transpose-elements' mimics the behaviour of
|
|
|
|
|
;; `transpose-words', at the element's level, whereas
|
|
|
|
|
;; `org-element-drag-forward', `org-element-drag-backward', and
|
|
|
|
|
;; `org-element-up' generalize, respectively, functions
|
|
|
|
|
;; `org-subtree-down', `org-subtree-up' and `outline-up-heading'.
|
|
|
|
|
|
|
|
|
|
;; `org-element-unindent-buffer' will, as its name almost suggests,
|
|
|
|
|
;; smartly remove global indentation from buffer, making it possible
|
|
|
|
|
;; to use Org indent mode on a file created with hard indentation.
|
|
|
|
|
|
|
|
|
|
;; `org-element-nested-p' and `org-element-swap-A-B' are used
|
|
|
|
|
;; internally by some of the previously cited tools.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(defsubst org-element-nested-p (elem-A elem-B)
|
|
|
|
|
"Non-nil when elements ELEM-A and ELEM-B are nested."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((beg-A (org-element-property :begin elem-A))
|
|
|
|
|
(beg-B (org-element-property :begin elem-B))
|
|
|
|
|
(end-A (org-element-property :end elem-A))
|
|
|
|
|
(end-B (org-element-property :end elem-B)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(or (and (>= beg-A beg-B) (<= end-A end-B))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(and (>= beg-B beg-A) (<= end-B end-A)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-swap-A-B (elem-A elem-B)
|
|
|
|
|
"Swap elements ELEM-A and ELEM-B.
|
|
|
|
|
|
2012-03-22 14:32:09 -04:00
|
|
|
|
Leave point at the end of ELEM-A."
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char (org-element-property :begin elem-A))
|
2012-03-22 14:32:09 -04:00
|
|
|
|
(let* ((beg-A (org-element-property :begin elem-A))
|
|
|
|
|
(end-A (save-excursion
|
|
|
|
|
(goto-char (org-element-property :end elem-A))
|
|
|
|
|
(skip-chars-backward " \r\t\n")
|
|
|
|
|
(point-at-eol)))
|
|
|
|
|
(beg-B (org-element-property :begin elem-B))
|
|
|
|
|
(end-B (save-excursion
|
|
|
|
|
(goto-char (org-element-property :end elem-B))
|
|
|
|
|
(skip-chars-backward " \r\t\n")
|
|
|
|
|
(point-at-eol)))
|
|
|
|
|
(body-A (buffer-substring beg-A end-A))
|
|
|
|
|
(body-B (delete-and-extract-region beg-B end-B)))
|
|
|
|
|
(goto-char beg-B)
|
|
|
|
|
(insert body-A)
|
|
|
|
|
(goto-char beg-A)
|
|
|
|
|
(delete-region beg-A end-A)
|
|
|
|
|
(insert body-B)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char (org-element-property :end elem-B))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-backward ()
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Move backward by one element.
|
|
|
|
|
Move to the previous element at the same level, when possible."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(interactive)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (save-excursion (skip-chars-backward " \r\t\n") (bobp))
|
|
|
|
|
(error "Cannot move further up")
|
|
|
|
|
(let* ((trail (org-element-at-point 'keep-trail))
|
|
|
|
|
(element (car trail))
|
|
|
|
|
(beg (org-element-property :begin element)))
|
|
|
|
|
;; Move to beginning of current element if point isn't there.
|
|
|
|
|
(if (/= (point) beg) (goto-char beg)
|
|
|
|
|
(let ((type (org-element-type element)))
|
|
|
|
|
(cond
|
|
|
|
|
;; At an headline: move to previous headline at the same
|
|
|
|
|
;; level, a parent, or BOB.
|
|
|
|
|
((eq type 'headline)
|
|
|
|
|
(let ((dest (save-excursion (org-backward-same-level 1) (point))))
|
|
|
|
|
(if (= (point-min) dest) (error "Cannot move further up")
|
|
|
|
|
(goto-char dest))))
|
|
|
|
|
;; At an item: try to move to the previous item, if any.
|
|
|
|
|
((and (eq type 'item)
|
|
|
|
|
(let* ((struct (org-element-property :structure element))
|
|
|
|
|
(prev (org-list-get-prev-item
|
|
|
|
|
beg struct (org-list-prevs-alist struct))))
|
|
|
|
|
(when prev (goto-char prev)))))
|
|
|
|
|
;; In any other case, find the previous element in the
|
|
|
|
|
;; trail and move to its beginning. If no previous element
|
|
|
|
|
;; can be found, move to headline.
|
|
|
|
|
(t (let ((prev (nth 1 trail)))
|
|
|
|
|
(if prev (goto-char (org-element-property :begin prev))
|
|
|
|
|
(org-back-to-heading))))))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-drag-backward ()
|
|
|
|
|
"Drag backward element at point."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let* ((pos (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(elem (org-element-at-point)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(when (= (progn (goto-char (point-min))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-skip-whitespace)
|
|
|
|
|
(point-at-bol))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :end elem))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(error "Cannot drag element backward"))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char (org-element-property :begin elem))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(org-element-backward)
|
|
|
|
|
(let ((prev-elem (org-element-at-point)))
|
|
|
|
|
(when (or (org-element-nested-p elem prev-elem)
|
2012-03-22 14:32:09 -04:00
|
|
|
|
(and (eq (org-element-type elem) 'headline)
|
|
|
|
|
(not (eq (org-element-type prev-elem) 'headline))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(goto-char pos)
|
|
|
|
|
(error "Cannot drag element backward"))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Compute new position of point: it's shifted by PREV-ELEM
|
|
|
|
|
;; body's length.
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(let ((size-prev (- (org-element-property :end prev-elem)
|
|
|
|
|
(org-element-property :begin prev-elem))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-element-swap-A-B prev-elem elem)
|
|
|
|
|
(goto-char (- pos size-prev))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-drag-forward ()
|
|
|
|
|
"Move forward element at point."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let* ((pos (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(elem (org-element-at-point)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(when (= (point-max) (org-element-property :end elem))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(error "Cannot drag element forward"))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char (org-element-property :end elem))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(let ((next-elem (org-element-at-point)))
|
|
|
|
|
(when (or (org-element-nested-p elem next-elem)
|
2012-03-22 14:32:09 -04:00
|
|
|
|
(and (eq (org-element-type next-elem) 'headline)
|
|
|
|
|
(not (eq (org-element-type elem) 'headline))))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(goto-char pos)
|
|
|
|
|
(error "Cannot drag element forward"))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
;; Compute new position of point: it's shifted by NEXT-ELEM
|
|
|
|
|
;; body's length (without final blanks) and by the length of
|
|
|
|
|
;; blanks between ELEM and NEXT-ELEM.
|
|
|
|
|
(let ((size-next (- (save-excursion
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char (org-element-property :end next-elem))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(skip-chars-backward " \r\t\n")
|
|
|
|
|
(forward-line)
|
|
|
|
|
(point))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :begin next-elem)))
|
|
|
|
|
(size-blank (- (org-element-property :end elem)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(save-excursion
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char (org-element-property :end elem))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(skip-chars-backward " \r\t\n")
|
|
|
|
|
(forward-line)
|
|
|
|
|
(point)))))
|
|
|
|
|
(org-element-swap-A-B elem next-elem)
|
|
|
|
|
(goto-char (+ pos size-next size-blank))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-forward ()
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Move forward by one element.
|
|
|
|
|
Move to the next element at the same level, when possible."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(interactive)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (eobp) (error "Cannot move further down")
|
|
|
|
|
(let* ((trail (org-element-at-point 'keep-trail))
|
|
|
|
|
(element (car trail))
|
|
|
|
|
(type (org-element-type element))
|
|
|
|
|
(end (org-element-property :end element)))
|
|
|
|
|
(cond
|
|
|
|
|
;; At an headline, move to next headline at the same level.
|
|
|
|
|
((eq type 'headline) (goto-char end))
|
|
|
|
|
;; At an item. Move to the next item, if possible.
|
|
|
|
|
((and (eq type 'item)
|
|
|
|
|
(let* ((struct (org-element-property :structure element))
|
|
|
|
|
(prevs (org-list-prevs-alist struct))
|
|
|
|
|
(beg (org-element-property :begin element))
|
|
|
|
|
(next-item (org-list-get-next-item beg struct prevs)))
|
|
|
|
|
(when next-item (goto-char next-item)))))
|
|
|
|
|
;; In any other case, move to element's end, unless this
|
|
|
|
|
;; position is also the end of its parent's contents, in which
|
|
|
|
|
;; case, directly jump to parent's end.
|
|
|
|
|
(t
|
|
|
|
|
(let ((parent
|
|
|
|
|
;; Determine if TRAIL contains the real parent of ELEMENT.
|
|
|
|
|
(and (> (length trail) 1)
|
|
|
|
|
(let* ((parent-candidate (car (last trail))))
|
|
|
|
|
(and (memq (org-element-type parent-candidate)
|
|
|
|
|
org-element-greater-elements)
|
|
|
|
|
(>= (org-element-property
|
|
|
|
|
:contents-end parent-candidate) end)
|
|
|
|
|
parent-candidate)))))
|
|
|
|
|
(cond ((not parent) (goto-char end))
|
|
|
|
|
((= (org-element-property :contents-end parent) end)
|
|
|
|
|
(goto-char (org-element-property :end parent)))
|
|
|
|
|
(t (goto-char end)))))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-mark-element ()
|
|
|
|
|
"Put point at beginning of this element, mark at end.
|
|
|
|
|
|
|
|
|
|
Interactively, if this command is repeated or (in Transient Mark
|
|
|
|
|
mode) if the mark is active, it marks the next element after the
|
|
|
|
|
ones already marked."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let (deactivate-mark)
|
|
|
|
|
(if (or (and (eq last-command this-command) (mark t))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(and transient-mark-mode mark-active))
|
|
|
|
|
(set-mark
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (mark))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char (org-element-property :end (org-element-at-point)))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(let ((element (org-element-at-point)))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(end-of-line)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(push-mark (org-element-property :end element) t t)
|
|
|
|
|
(goto-char (org-element-property :begin element))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-narrow-to-element ()
|
|
|
|
|
"Narrow buffer to current element."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((elem (org-element-at-point)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq (car elem) 'headline)
|
|
|
|
|
(narrow-to-region
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :begin elem)
|
|
|
|
|
(org-element-property :end elem)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
((memq (car elem) org-element-greater-elements)
|
|
|
|
|
(narrow-to-region
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :contents-begin elem)
|
|
|
|
|
(org-element-property :contents-end elem)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(t
|
|
|
|
|
(narrow-to-region
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :begin elem)
|
|
|
|
|
(org-element-property :end elem))))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-transpose-elements ()
|
|
|
|
|
"Transpose current and previous elements, keeping blank lines between.
|
|
|
|
|
Point is moved after both elements."
|
|
|
|
|
(interactive)
|
|
|
|
|
(org-skip-whitespace)
|
|
|
|
|
(let ((pos (point))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(cur (org-element-at-point)))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(when (= (save-excursion (goto-char (point-min))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-skip-whitespace)
|
|
|
|
|
(point-at-bol))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :begin cur))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(error "No previous element"))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(goto-char (org-element-property :begin cur))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(forward-line -1)
|
|
|
|
|
(let ((prev (org-element-at-point)))
|
|
|
|
|
(when (org-element-nested-p cur prev)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(goto-char pos)
|
|
|
|
|
(error "Cannot transpose nested elements"))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(org-element-swap-A-B prev cur))))
|
|
|
|
|
|
|
|
|
|
(defun org-element-unindent-buffer ()
|
|
|
|
|
"Un-indent the visible part of the buffer.
|
|
|
|
|
Relative indentation \(between items, inside blocks, etc.\) isn't
|
|
|
|
|
modified."
|
|
|
|
|
(interactive)
|
|
|
|
|
(unless (eq major-mode 'org-mode)
|
|
|
|
|
(error "Cannot un-indent a buffer not in Org mode"))
|
|
|
|
|
(let* ((parse-tree (org-element-parse-buffer 'greater-element))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
unindent-tree ; For byte-compiler.
|
|
|
|
|
(unindent-tree
|
|
|
|
|
(function
|
|
|
|
|
(lambda (contents)
|
|
|
|
|
(mapc (lambda (element)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(if (eq (org-element-type element) 'headline)
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(funcall unindent-tree
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-contents element))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(save-excursion
|
|
|
|
|
(save-restriction
|
|
|
|
|
(narrow-to-region
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(org-element-property :begin element)
|
|
|
|
|
(org-element-property :end element))
|
2011-12-09 08:38:36 -05:00
|
|
|
|
(org-do-remove-indentation)))))
|
|
|
|
|
(reverse contents))))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(funcall unindent-tree (org-element-contents parse-tree))))
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(defun org-element-up ()
|
2012-03-19 16:38:12 -04:00
|
|
|
|
"Move to upper element."
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
(interactive)
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(cond
|
|
|
|
|
((bobp) (error "No surrounding element"))
|
|
|
|
|
((org-with-limited-levels (org-at-heading-p))
|
|
|
|
|
(or (org-up-heading-safe) (error "No surronding element")))
|
|
|
|
|
(t
|
|
|
|
|
(let* ((trail (org-element-at-point 'keep-trail))
|
|
|
|
|
(element (car trail))
|
|
|
|
|
(type (org-element-type element)))
|
|
|
|
|
(cond
|
|
|
|
|
;; At an item, with a parent in the list: move to that parent.
|
|
|
|
|
((and (eq type 'item)
|
|
|
|
|
(let* ((beg (org-element-property :begin element))
|
|
|
|
|
(struct (org-element-property :structure element))
|
|
|
|
|
(parents (org-list-parents-alist struct))
|
|
|
|
|
(parentp (org-list-get-parent beg struct parents)))
|
|
|
|
|
(and parentp (goto-char parentp)))))
|
|
|
|
|
;; Determine parent in the trail.
|
|
|
|
|
(t
|
|
|
|
|
(let ((parent
|
|
|
|
|
(and (> (length trail) 1)
|
|
|
|
|
(let ((parentp (car (last trail))))
|
|
|
|
|
(and (memq (org-element-type parentp)
|
|
|
|
|
org-element-greater-elements)
|
|
|
|
|
(>= (org-element-property :contents-end parentp)
|
|
|
|
|
(org-element-property :end element))
|
|
|
|
|
parentp)))))
|
|
|
|
|
(cond
|
|
|
|
|
;; When parent is found move to its beginning.
|
|
|
|
|
(parent (goto-char (org-element-property :begin parent)))
|
|
|
|
|
;; If no parent was found, move to headline above, if any
|
|
|
|
|
;; or return an error.
|
|
|
|
|
((org-before-first-heading-p) (error "No surrounding element"))
|
|
|
|
|
(t (org-back-to-heading))))))))))
|
|
|
|
|
|
|
|
|
|
(defun org-element-down ()
|
|
|
|
|
"Move to inner element."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((element (org-element-at-point)))
|
2012-03-09 13:47:50 -05:00
|
|
|
|
(cond
|
org-element: Split tables into table-row elements and table-cell objects
* contrib/lisp/org-element.el (org-element-table-parser): Split tables
into table-row elements and table-cell objects.
(org-element-table-interpreter): Adapt interpreter to new code.
(org-element-table-row-parser, org-element-table-row-interpreter,
org-element-table-cell-parser, org-element-table-cell-interpreter,
org-element-table-cell-successor, org-element-table-row-successor,
org-element-restriction): New functions.
(org-element-headline-parser,
org-element-inlinetask-parser, org-element-item-parser,
org-element-verse-block-parser,
org-element-footnote-reference-parser,
org-element-collect-affiliated-keywords, org-element-parse-objects):
Use new function
(org-element-all-objects): Add new objects.
(org-element-target-parser): Small change to docstring.
(org-element-object-restrictions): Merge `org-element-string-restrictions'
into it.
(org-element-string-restrictions): Remove variable.
(org-element-parse-elements): Parse objects in non-recursive elements
with contents.
(org-element-normalize-string): Small refactoring.
(org-element-at-point): Handle table navigation.
* testing/lisp/test-org-element.el: Add tests.
2012-04-11 13:02:03 -04:00
|
|
|
|
((memq (org-element-type element) '(plain-list table))
|
|
|
|
|
(goto-char (org-element-property :contents-begin element))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
(forward-char))
|
|
|
|
|
((memq (org-element-type element) org-element-greater-elements)
|
|
|
|
|
;; If contents are hidden, first disclose them.
|
|
|
|
|
(when (org-element-property :hiddenp element) (org-cycle))
|
|
|
|
|
(goto-char (org-element-property :contents-begin element)))
|
|
|
|
|
(t (error "No inner element")))))
|
2012-03-09 13:47:50 -05:00
|
|
|
|
|
org-element: Parser for Org syntax
* contrib/lisp/org-element.el (org-element-center-block-parser,
org-element-center-block-interpreter, org-element-drawer-parser,
org-element-drawer-interpreter, org-element-dynamic-block-parser,
org-element-dynamic-block-interpreter,
org-element-footnote-definition-parser,
org-element-headline-parser, org-element-headline-interpreter,
org-element-inlinetask-parser, org-element-inlinetask-interpreter,
org-element-item-parser, org-element-item-interpreter,
org-element-plain-list-parser, org-element-plain-list-interpreter,
org-element-quote-block-parser,
org-element-quote-block-interpreter,
org-element-special-block-parser,
org-element-special-block-interpreter,
org-element-babel-call-parser, org-element-babel-call-interpreter,
org-element-comment-parser, org-element-comment-interpreter,
org-element-comment-block-parser,
org-element-comment-block-interpreter,
org-element-example-block-parser,
org-element-example-block-interpreter,
org-element-export-block-parser,
org-element-export-block-interpreter,
org-element-fixed-width-parser,
org-element-fixed-width-interpreter,
org-element-horizontal-rule-parser,
org-element-horizontal-rule-interpreter,
org-element-keyword-parser, org-element-keyword-interpreter,
org-element-latex-environment-parser,
org-element-latex-environment-interpreter,
org-element-paragraph-parser, org-element-paragraph-interpreter,
org-element-property-drawer-parser,
org-element-property-drawer-interpreter,
org-element-quote-section-parser,
org-element-quote-section-interpreter,
org-element-src-block-parser, org-element-src-block-interpreter,
org-element-table-parser, org-element-table-interpreter,
org-element-verse-block-parser,
org-element-verse-block-interpreter, org-element-emphasis-parser,
org-element-emphasis-interpreter,
org-element-text-markup-successor, org-element-entity-parser,
org-element-entity-interpreter,
org-element-latex-or-entity-successor,
org-element-export-snippet-parser,
org-element-export-snippet-interpreter,
org-element-export-snippet-successor,
org-element-footnote-reference-parser,
org-element-footnote-definition-interpreter,
org-element-footnote-reference-interpreter,
org-element-footnote-reference-successor,
org-element-inline-babel-call-parser,
org-element-inline-babel-call-interpreter,
org-element-inline-babel-call-successor,
org-element-inline-src-block-parser,
org-element-inline-src-block-successor,
org-element-latex-fragment-parser,
org-element-latex-fragment-interpreter,
org-element-line-break-parser, org-element-line-break-interpreter,
org-element-line-break-successor, org-element-link-parser,
org-element-link-interpreter, org-element-link-successor,
org-element-macro-parser, org-element-macro-interpreter,
org-element-macro-successor, org-element-radio-target-parser,
org-element-radio-target-interpreter,
org-element-radio-target-successor,
org-element-statistics-cookie-parser,
org-element-statistics-cookie-interpreter,
org-element-statistics-cookie-successor,
org-element-subscript-parser, org-element-subscript-interpreter,
org-element-sub/superscript-successor,
org-element-superscript-parser,
org-element-superscript-interpreter, org-element-target-parser,
org-element-target-interpreter, org-element-target-successor,
org-element-time-stamp-parser, org-element-time-stamp-interpreter,
org-element-time-stamp-successor, org-element-verbatim-parser,
org-element-verbatim-interpreter, org-element-get-property,
org-element-get-contents, org-element-at-point,
org-element-guess-type, org-element-collect-affiliated-keywords,
org-element-parse-buffer, org-element-parse-secondary-string,
org-element-map, org-element-parse-elements,
org-element-parse-objects, org-element-get-next-object-candidates,
org-element-interpret-data, org-element-interpret-secondary,
org-element-interpret--affiliated-keywords,
org-element-normalize-string, org-element-normalize-contents,
org-element-swap-A-B, org-element-backward,
org-element-drag-backward, org-element-drag-forward,
org-element-forward, org-element-mark-element,
org-narrow-to-element, org-transpose-elements,
org-element-unindent-buffer, org-element-up): New functions.
(org-element-paragraph-separate, org-element-all-elements,
org-element-greater-elements, org-element-all-successors,
org-element-object-successor-alist, org-element-recursive-objects,
org-element-non-recursive-block-alist,
org-element-affiliated-keywords,
org-element-keyword-translation-alist,
org-element-multiple-keywords, org-element-parsed-keywords,
org-element-dual-keywords, org-element-object-restrictions,
org-element-string-restrictions, org-element--affiliated-re,
org-element--element-block-types): New variables.
2011-11-21 02:11:47 -05:00
|
|
|
|
|
|
|
|
|
(provide 'org-element)
|
|
|
|
|
;;; org-element.el ends here
|