forked from mirrors/org-mode
org-get-outline-path: Drop COMMENT keywords from the outline path
* lisp/org.el (org--get-outline-path-1): Remove comment keyword from title when current heading is commented. * testing/lisp/test-org.el (test-org/get-outline-path): Add test.
This commit is contained in:
parent
a19a72f7d3
commit
92c53f23d3
|
@ -7500,6 +7500,8 @@ Assume buffer is widened and point is on a headline."
|
|||
(replace-regexp-in-string
|
||||
"\\[[0-9]+%\\]\\|\\[[0-9]+/[0-9]+\\]" ""
|
||||
(match-string-no-properties 4))))))))
|
||||
(when (org-element-property :commentedp (org-element-at-point))
|
||||
(setq heading (replace-regexp-in-string (format "^%s[ \t]*" org-comment-string) "" heading)))
|
||||
(if (org-up-heading-safe)
|
||||
(let ((path (cons heading (org--get-outline-path-1 use-cache))))
|
||||
(when use-cache
|
||||
|
|
|
@ -2780,7 +2780,16 @@ test <point>
|
|||
(org-get-outline-path)))
|
||||
(should
|
||||
(org-test-with-temp-text "* \n** H<point>"
|
||||
(org-get-outline-path))))
|
||||
(org-get-outline-path)))
|
||||
;; Remove COMMENTED keywords.
|
||||
(should
|
||||
(equal '("This" "is")
|
||||
(org-test-with-temp-text
|
||||
"* COMMENT This
|
||||
** COMMENT is
|
||||
*** test<point>
|
||||
"
|
||||
(org-get-outline-path)))))
|
||||
|
||||
(ert-deftest test-org/format-outline-path ()
|
||||
"Test `org-format-outline-path' specifications."
|
||||
|
|
Loading…
Reference in New Issue