diff options
author | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:32 +0200 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:32 +0200 |
commit | efc77ab6f5e8883fc38d8c6f75b6db54a0965c15 (patch) | |
tree | a34b12897145816f4ab7fbeb2fe6db437651e98e /lisp/org-element.el | |
parent | 52fbfeb04b10aa78f24f339a352fe1161c0b37e4 (diff) |
Imported Upstream version 8.2.5h
Diffstat (limited to 'lisp/org-element.el')
-rw-r--r-- | lisp/org-element.el | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el index 6162383..77b2bc2 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -1,6 +1,6 @@ ;;; org-element.el --- Parser And Applications for Org syntax -;; Copyright (C) 2012-2013 Free Software Foundation, Inc. +;; Copyright (C) 2012-2014 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou <n.goaziou at gmail dot com> ;; Keywords: outlines, hypermedia, calendar, wp @@ -239,19 +239,6 @@ application to open them.") By default, all keywords setting attributes (i.e. \"ATTR_LATEX\") are affiliated keywords and need not to be in this list.") -(defconst org-element--affiliated-re - (format "[ \t]*#\\+%s:" - ;; Regular affiliated keywords. - (format "\\(%s\\|ATTR_[-_A-Za-z0-9]+\\)\\(?:\\[\\(.*\\)\\]\\)?" - (regexp-opt 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.") - (defconst org-element-keyword-translation-alist '(("DATA" . "NAME") ("LABEL" . "NAME") ("RESNAME" . "NAME") ("SOURCE" . "NAME") ("SRCNAME" . "NAME") ("TBLNAME" . "NAME") @@ -298,6 +285,31 @@ This list is checked after translations have been applied. See Any keyword in this list will have its value parsed and stored as a secondary string.") +(defconst org-element--affiliated-re + (format "[ \t]*#\\+\\(?:%s\\):\\(?: \\|$\\)" + (concat + ;; Dual affiliated keywords. + (format "\\(?1:%s\\)\\(?:\\[\\(.*\\)\\]\\)?" + (regexp-opt org-element-dual-keywords)) + "\\|" + ;; Regular affiliated keywords. + (format "\\(?1:%s\\)" + (regexp-opt + (org-remove-if + #'(lambda (keyword) + (member keyword org-element-dual-keywords)) + org-element-affiliated-keywords))) + "\\|" + ;; Export attributes. + "\\(?1:ATTR_[-_A-Za-z0-9]+\\)")) + "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.") + (defconst org-element-object-restrictions (let* ((standard-set (remq 'plain-link (remq 'table-cell org-element-all-successors))) @@ -2906,12 +2918,8 @@ CONTENTS is nil." Return value is a cons cell whose CAR is `inline-babel-call' and CDR is beginning position." (save-excursion - ;; Use a simplified version of - ;; `org-babel-inline-lob-one-liner-regexp'. - (when (re-search-forward - "call_\\([^()\n]+?\\)\\(?:\\[.*?\\]\\)?([^\n]*?)\\(\\[.*?\\]\\)?" - nil t) - (cons 'inline-babel-call (match-beginning 0))))) + (when (re-search-forward org-babel-inline-lob-one-liner-regexp nil t) + (cons 'inline-babel-call (match-end 1))))) ;;;; Inline Src Block |