mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-25 01:02:52 +00:00
org-element: Fix comments in paragraph separator regexp
* lisp/org-element.el (org-element-paragraph-separate): Fix comments in paragraph separator regexp. Optimize it.
This commit is contained in:
parent
1737d3c4ee
commit
d856b29b3b
|
@ -123,23 +123,36 @@
|
||||||
;; process.
|
;; process.
|
||||||
|
|
||||||
(defconst org-element-paragraph-separate
|
(defconst org-element-paragraph-separate
|
||||||
(concat "^[ \t]*$" "\\|"
|
(concat "^\\(?:"
|
||||||
;; Headlines and inlinetasks.
|
;; Headlines, inlinetasks.
|
||||||
org-outline-regexp-bol "\\|"
|
org-outline-regexp "\\|"
|
||||||
;; Comments, blocks (any type), keywords and babel calls.
|
|
||||||
"^[ \t]*#\\+" "\\|" "^#\\(?: \\|$\\)" "\\|"
|
|
||||||
;; Lists.
|
|
||||||
(org-item-beginning-re) "\\|"
|
|
||||||
;; Fixed-width, drawers (any type) and tables.
|
|
||||||
"^[ \t]*[:|]" "\\|"
|
|
||||||
;; Footnote definitions.
|
;; Footnote definitions.
|
||||||
org-footnote-definition-re "\\|"
|
"\\[\\(?:[0-9]+\\|fn:[-_[:word:]]+\\)\\]" "\\|"
|
||||||
|
"[ \t]*\\(?:"
|
||||||
|
;; Empty lines.
|
||||||
|
"$" "\\|"
|
||||||
|
;; Comments, blocks (any type), keywords, Babel calls,
|
||||||
|
;; drawers (any type) and tables.
|
||||||
|
"[|#]" "\\|"
|
||||||
|
;; Fixed width areas.
|
||||||
|
":\\(?:[ \t]\\|$\\)" "\\|"
|
||||||
;; Horizontal rules.
|
;; Horizontal rules.
|
||||||
"^[ \t]*-\\{5,\\}[ \t]*$" "\\|"
|
"-\\{5,\\}[ \t]*$" "\\|"
|
||||||
;; LaTeX environments.
|
;; LaTeX environments.
|
||||||
"^[ \t]*\\\\\\(begin\\|end\\)" "\\|"
|
"\\\\\\(begin\\|end\\)" "\\|"
|
||||||
;; Planning and Clock lines.
|
;; Planning and Clock lines.
|
||||||
org-planning-or-clock-line-re)
|
(regexp-opt (list org-scheduled-string
|
||||||
|
org-deadline-string
|
||||||
|
org-closed-string
|
||||||
|
org-clock-string))
|
||||||
|
"\\|"
|
||||||
|
;; Lists.
|
||||||
|
(let ((term (case org-plain-list-ordered-item-terminator
|
||||||
|
(t "[.)]") (?\) ")") (?. "\\.") (otherwise "[.)]")))
|
||||||
|
(alpha (and org-alphabetical-lists "\\|[A-Za-z]")))
|
||||||
|
(concat "\\(?:[-+*]\\|\\(?:[0-9]+" alpha "\\)" term "\\)"
|
||||||
|
"\\(?:[ \t]\\|$\\)"))
|
||||||
|
"\\)\\)")
|
||||||
"Regexp to separate paragraphs in an Org buffer.")
|
"Regexp to separate paragraphs in an Org buffer.")
|
||||||
|
|
||||||
(defconst org-element-all-elements
|
(defconst org-element-all-elements
|
||||||
|
|
Loading…
Reference in a new issue