Merge branch 'maint'
This commit is contained in:
commit
9a10da6acc
|
@ -3003,14 +3003,14 @@ Return code as a string."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(save-restriction
|
(save-restriction
|
||||||
;; Narrow buffer to an appropriate region or subtree for
|
;; Narrow buffer to an appropriate region or subtree for
|
||||||
;; parsing. If parsing subtree, be sure to remove main headline
|
;; parsing. If parsing subtree, be sure to remove main
|
||||||
;; too.
|
;; headline, planning data and property drawer.
|
||||||
(cond ((org-region-active-p)
|
(cond ((org-region-active-p)
|
||||||
(narrow-to-region (region-beginning) (region-end)))
|
(narrow-to-region (region-beginning) (region-end)))
|
||||||
(subtreep
|
(subtreep
|
||||||
(org-narrow-to-subtree)
|
(org-narrow-to-subtree)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(forward-line)
|
(org-end-of-meta-data)
|
||||||
(narrow-to-region (point) (point-max))))
|
(narrow-to-region (point) (point-max))))
|
||||||
;; Initialize communication channel with original buffer
|
;; Initialize communication channel with original buffer
|
||||||
;; attributes, unavailable in its copy.
|
;; attributes, unavailable in its copy.
|
||||||
|
|
|
@ -878,34 +878,20 @@ Paragraph <2012-03-29 Thu>[2012-03-29 Thu]"
|
||||||
|
|
||||||
(ert-deftest test-org-export/export-scope ()
|
(ert-deftest test-org-export/export-scope ()
|
||||||
"Test all export scopes."
|
"Test all export scopes."
|
||||||
(org-test-with-temp-text "
|
|
||||||
* Head1
|
|
||||||
** Head2
|
|
||||||
text
|
|
||||||
*** Head3"
|
|
||||||
;; Subtree.
|
;; Subtree.
|
||||||
(forward-line 3)
|
(should
|
||||||
(should (equal (org-export-as (org-test-default-backend) 'subtree)
|
(equal "text\n*** H3\n"
|
||||||
"text\n*** Head3\n"))
|
(org-test-with-temp-text "* H1\n<point>** H2\ntext\n*** H3"
|
||||||
;; Visible.
|
(org-export-as (org-test-default-backend) 'subtree))))
|
||||||
(goto-char (point-min))
|
(should
|
||||||
(forward-line)
|
(equal "text\n*** H3\n"
|
||||||
(org-cycle)
|
(org-test-with-temp-text "* H1\n** H2\n<point>text\n*** H3"
|
||||||
(should (equal (org-export-as (org-test-default-backend) nil 'visible)
|
(org-export-as (org-test-default-backend) 'subtree))))
|
||||||
"* Head1\n"))
|
|
||||||
;; Region.
|
|
||||||
(goto-char (point-min))
|
|
||||||
(forward-line 3)
|
|
||||||
(transient-mark-mode 1)
|
|
||||||
(push-mark (point) t t)
|
|
||||||
(goto-char (point-at-eol))
|
|
||||||
(should (equal (org-export-as (org-test-default-backend)) "text\n")))
|
|
||||||
;; Subtree with a code block calling another block outside.
|
;; Subtree with a code block calling another block outside.
|
||||||
(let ((org-export-babel-evaluate t))
|
|
||||||
(should
|
(should
|
||||||
(equal ": 3\n"
|
(equal ": 3\n"
|
||||||
(org-test-with-temp-text "
|
(org-test-with-temp-text "
|
||||||
* Head1
|
<point>* Head1
|
||||||
#+BEGIN_SRC emacs-lisp :noweb yes :exports results
|
#+BEGIN_SRC emacs-lisp :noweb yes :exports results
|
||||||
<<test>>
|
<<test>>
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
@ -914,8 +900,36 @@ text
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
\(+ 1 2)
|
\(+ 1 2)
|
||||||
#+END_SRC"
|
#+END_SRC"
|
||||||
(forward-line 1)
|
(let ((org-export-babel-evaluate t))
|
||||||
(org-export-as (org-test-default-backend) 'subtree)))))
|
(org-export-as (org-test-default-backend) 'subtree)))))
|
||||||
|
;; Subtree export should ignore leading planning line and property
|
||||||
|
;; drawer.
|
||||||
|
(should
|
||||||
|
(equal "Text\n"
|
||||||
|
(org-test-with-temp-text "
|
||||||
|
<point>* H
|
||||||
|
SCHEDULED: <2012-03-29 Thu>
|
||||||
|
:PROPERTIES:
|
||||||
|
:A: 1
|
||||||
|
:END:
|
||||||
|
Text"
|
||||||
|
(org-export-as (org-test-default-backend)
|
||||||
|
'subtree nil nil
|
||||||
|
'(:with-planning t :with-properties t)))))
|
||||||
|
;; Visible.
|
||||||
|
(should
|
||||||
|
(equal "* H1\n"
|
||||||
|
(org-test-with-temp-text "* H1\n** H2\ntext\n*** H3"
|
||||||
|
(org-cycle)
|
||||||
|
(org-export-as (org-test-default-backend) nil 'visible))))
|
||||||
|
;; Region.
|
||||||
|
(should
|
||||||
|
(equal "text\n"
|
||||||
|
(org-test-with-temp-text "* H1\n** H2\n<point>text\n*** H3"
|
||||||
|
(transient-mark-mode 1)
|
||||||
|
(push-mark (point) t t)
|
||||||
|
(end-of-line)
|
||||||
|
(org-export-as (org-test-default-backend)))))
|
||||||
;; Body only.
|
;; Body only.
|
||||||
(let ((backend (org-test-default-backend)))
|
(let ((backend (org-test-default-backend)))
|
||||||
(setf (org-export-backend-transcoders backend)
|
(setf (org-export-backend-transcoders backend)
|
||||||
|
|
Loading…
Reference in New Issue