mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-22 20:10:43 +00:00
Merge branch 'master' into max-sticky-agenda
This commit is contained in:
commit
c8aa1d99e1
|
@ -3859,6 +3859,17 @@ modified."
|
|||
((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)))
|
||||
(cond
|
||||
((eq (org-element-type element) 'plain-list)
|
||||
(forward-char))
|
||||
((memq (org-element-type element) org-element-greater-elements)
|
||||
(goto-char (org-element-property :contents-begin element)))
|
||||
(t (error "No inner element")))))
|
||||
|
||||
|
||||
(provide 'org-element)
|
||||
;;; org-element.el ends here
|
||||
|
|
|
@ -398,7 +398,7 @@ form
|
|||
(start-line file link source-name params body comment)"
|
||||
(let* ((start-line (nth 0 spec))
|
||||
(file (nth 1 spec))
|
||||
(link (org-link-escape (nth 2 spec)))
|
||||
(link (nth 2 spec))
|
||||
(source-name (nth 3 spec))
|
||||
(body (nth 5 spec))
|
||||
(comment (nth 6 spec))
|
||||
|
|
|
@ -312,6 +312,21 @@ Outside."
|
|||
(org-element-up)
|
||||
(should (looking-at "\\* Top"))))
|
||||
|
||||
(ert-deftest test-org-elemnet/down-element ()
|
||||
"Test `org-element-down' specifications."
|
||||
;; 1. Error when the element hasn't got a recursive type.
|
||||
(org-test-with-temp-text "Paragraph."
|
||||
(should-error (org-element-down)))
|
||||
;; 2. When at a plain-list, move to first item.
|
||||
(org-test-with-temp-text "- Item 1\n - Item 1.1\n - Item 2.2"
|
||||
(goto-line 2)
|
||||
(org-element-down)
|
||||
(should (looking-at " - Item 1.1")))
|
||||
;; 3. Otherwise, move inside the greater element.
|
||||
(org-test-with-temp-text "#+BEGIN_CENTER\nParagraph.\n#+END_CENTER"
|
||||
(org-element-down)
|
||||
(should (looking-at "Paragraph"))))
|
||||
|
||||
|
||||
(provide 'test-org-element)
|
||||
;;; test-org-element.el ends here
|
||||
|
|
Loading…
Reference in a new issue