更新了,貌似还是这样子。
块引用 Debugger entered–Lisp error: (wrong-type-argument integer-or-marker-p nil) buffer-substring(nil nil) (substring-no-properties (buffer-substring text-begin text-end)) (string-trim (substring-no-properties (buffer-substring text-begin text-end)) “\n” “\n”) (let* ((stars) (paragraph (org-element-map headline 'paragraph #'identity nil 'first-match ‘no-recursion)) (text-begin (org-element-property :contents-begin paragraph)) (text-end (org-element-property :contents-end paragraph)) (text (string-trim (substring-no-properties (buffer-substring text-begin text-end)) “\n” “\n”))) (let ((–dotimes-limit-- (org-element-property :level headline)) (–dotimes-counter-- 0)) (while (< --dotimes-counter-- --dotimes-limit–) (let ((i --dotimes-counter–)) (setq stars (concat stars “*”))) (setq --dotimes-counter-- (1+ --dotimes-counter–)))) (concat stars (if plantuml-mindmap-contains-org-content (progn “:”)) " " (if plantuml-org-headline-bold (progn “”)) (if plantuml-add-index-number (progn (concat (number-to-string (car (org-num–current-numbering … nil))) ". "))) (org-element-property :raw-value headline) (if plantuml-org-headline-bold (progn “”)) (if plantuml-mindmap-contains-org-content (progn (concat “:\n\n” text “;”))))) plantuml–headline-txt((headline (:raw-value “test” :begin 6 :end 14 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 6 :title (#(“test” 0 4 (:parent #1))) :parent (headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 (:parent #39))) :parent (org-data nil #39)) #1 (headline (:raw-value “测试一下” :begin 14 :end 22 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 14 :title (#(“测试一下” 0 4 …)) :parent #39)) (headline (:raw-value “更新了” :begin 22 :end 32 :pre-blank 0 :contents-begin 29 :contents-end 32 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 22 :title (#(“更新了” 0 3 …)) :parent #39) (section (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #44) (paragraph (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #47) #(“看看\n” 0 3 …)))) (headline (:raw-value “效果如何” :begin 32 :end 49 :pre-blank 0 :contents-begin 40 :contents-end 49 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#(“效果如何” 0 4 …)) :parent #39) (section (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #45) (paragraph (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #48) #(“看1\n看2\n看3\n” 0 9 …)))))))) (closure (t) (x) (plantuml–headline-txt x))((headline (:raw-value “test” :begin 6 :end 14 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 6 :title (#(“test” 0 4 (:parent #1))) :parent (headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 (:parent #39))) :parent (org-data nil #39)) #1 (headline (:raw-value “测试一下” :begin 14 :end 22 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 14 :title (#(“测试一下” 0 4 …)) :parent #39)) (headline (:raw-value “更新了” :begin 22 :end 32 :pre-blank 0 :contents-begin 29 :contents-end 32 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 22 :title (#(“更新了” 0 3 …)) :parent #39) (section (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #44) (paragraph (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #47) #(“看看\n” 0 3 …)))) (headline (:raw-value “效果如何” :begin 32 :end 49 :pre-blank 0 :contents-begin 40 :contents-end 49 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#(“效果如何” 0 4 …)) :parent #39) (section (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #45) (paragraph (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #48) #(“看1\n看2\n看3\n” 0 9 …)))))))) #f(compiled-function (–data) #<bytecode 0x157a929020a9>)((headline (:raw-value “test” :begin 6 :end 14 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 6 :title (#(“test” 0 4 (:parent #1))) :parent (headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 (:parent #39))) :parent (org-data nil #39)) #1 (headline (:raw-value “测试一下” :begin 14 :end 22 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 14 :title (#(“测试一下” 0 4 …)) :parent #39)) (headline (:raw-value “更新了” :begin 22 :end 32 :pre-blank 0 :contents-begin 29 :contents-end 32 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 22 :title (#(“更新了” 0 3 …)) :parent #39) (section (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #44) (paragraph (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #47) #(“看看\n” 0 3 …)))) (headline (:raw-value “效果如何” :begin 32 :end 49 :pre-blank 0 :contents-begin 40 :contents-end 49 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#(“效果如何” 0 4 …)) :parent #39) (section (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #45) (paragraph (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #48) #(“看1\n看2\n看3\n” 0 9 …)))))))) mapc(#f(compiled-function (–data) #<bytecode 0x157a929020a9>) ((headline (:raw-value “test” :begin 6 :end 14 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 6 :title (#(“test” 0 4 (:parent #3))) :parent (headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 …)) :parent (org-data nil #41)) . #2))) (headline (:raw-value “测试一下” :begin 14 :end 22 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 14 :title (#(“测试一下” 0 4 (:parent #4))) :parent (headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 …)) :parent (org-data nil #42)) . #2))) (headline (:raw-value “更新了” :begin 22 :end 32 :pre-blank 0 :contents-begin 29 :contents-end 32 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 22 :title (#(“更新了” 0 3 (:parent #5))) :parent (headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 …)) :parent (org-data nil #43)) . #2)) (section (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #5) (paragraph (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #8) #(“看看\n” 0 3 (:parent #11))))) (headline (:raw-value “效果如何” :begin 32 :end 49 :pre-blank 0 :contents-begin 40 :contents-end 49 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#(“效果如何” 0 4 (:parent #6))) :parent (headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 …)) :parent (org-data nil #44)) . #2)) (section (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #6) (paragraph (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #9) #(“看1\n看2\n看3\n” 0 9 (:parent #12))))))) #f(compiled-function (–data) #<bytecode 0x157a929020a9>)((headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 (:parent #1))) :parent (org-data nil #1)) (headline (:raw-value “test” :begin 6 :end 14 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 6 :title (#(“test” 0 4 (:parent #4))) :parent #1)) (headline (:raw-value “测试一下” :begin 14 :end 22 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 14 :title (#(“测试一下” 0 4 (:parent #5))) :parent #1)) (headline (:raw-value “更新了” :begin 22 :end 32 :pre-blank 0 :contents-begin 29 :contents-end 32 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 22 :title (#(“更新了” 0 3 (:parent #6))) :parent #1) (section (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #6) (paragraph (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #9) #(“看看\n” 0 3 (:parent #12))))) (headline (:raw-value “效果如何” :begin 32 :end 49 :pre-blank 0 :contents-begin 40 :contents-end 49 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#(“效果如何” 0 4 (:parent #7))) :parent #1) (section (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #7) (paragraph (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #10) #(“看1\n看2\n看3\n” 0 9 (:parent #13))))))) mapc(#f(compiled-function (–data) #<bytecode 0x157a929020a9>) ((headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 (:parent #3))) :parent (org-data nil . #2)) (headline (:raw-value “test” :begin 6 :end 14 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 6 :title (#(“test” 0 4 (:parent #6))) :parent #3)) (headline (:raw-value “测试一下” :begin 14 :end 22 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 14 :title (#(“测试一下” 0 4 (:parent #7))) :parent #3)) (headline (:raw-value “更新了” :begin 22 :end 32 :pre-blank 0 :contents-begin 29 :contents-end 32 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 22 :title (#(“更新了” 0 3 (:parent #8))) :parent #3) (section (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #8) (paragraph (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #11) #(“看看\n” 0 3 (:parent #14))))) (headline (:raw-value “效果如何” :begin 32 :end 49 :pre-blank 0 :contents-begin 40 :contents-end 49 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#(“效果如何” 0 4 (:parent #9))) :parent #3) (section (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #9) (paragraph (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #12) #(“看1\n看2\n看3\n” 0 9 (:parent #15)))))))) #f(compiled-function (–data) #<bytecode 0x157a929020a9>)((org-data nil (headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 (:parent #4))) :parent #1) (headline (:raw-value “test” :begin 6 :end 14 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 6 :title (#(“test” 0 4 (:parent #7))) :parent #4)) (headline (:raw-value “测试一下” :begin 14 :end 22 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 14 :title (#(“测试一下” 0 4 (:parent #8))) :parent #4)) (headline (:raw-value “更新了” :begin 22 :end 32 :pre-blank 0 :contents-begin 29 :contents-end 32 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 22 :title (#(“更新了” 0 3 (:parent #9))) :parent #4) (section (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #9) (paragraph (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #12) #(“看看\n” 0 3 (:parent #15))))) (headline (:raw-value “效果如何” :begin 32 :end 49 :pre-blank 0 :contents-begin 40 :contents-end 49 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#(“效果如何” 0 4 (:parent #10))) :parent #4) (section (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #10) (paragraph (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #13) #(“看1\n看2\n看3\n” 0 9 (:parent #16)))))))) org-element-map((org-data nil (headline (:raw-value “测试” :begin 1 :end 49 :pre-blank 0 :contents-begin 6 :contents-end 49 :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 1 :title (#(“测试” 0 2 (:parent #4))) :parent #1) (headline (:raw-value “test” :begin 6 :end 14 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 6 :title (#(“test” 0 4 (:parent #7))) :parent #4)) (headline (:raw-value “测试一下” :begin 14 :end 22 :pre-blank 0 :contents-begin nil :contents-end nil :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 14 :title (#(“测试一下” 0 4 (:parent #8))) :parent #4)) (headline (:raw-value “更新了” :begin 22 :end 32 :pre-blank 0 :contents-begin 29 :contents-end 32 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 22 :title (#(“更新了” 0 3 (:parent #9))) :parent #4) (section (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #9) (paragraph (:begin 29 :end 32 :contents-begin 29 :contents-end 32 :post-blank 0 :post-affiliated 29 :parent #12) #(“看看\n” 0 3 (:parent #15))))) (headline (:raw-value “效果如何” :begin 32 :end 49 :pre-blank 0 :contents-begin 40 :contents-end 49 :level 2 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#(“效果如何” 0 4 (:parent #10))) :parent #4) (section (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #10) (paragraph (:begin 40 :end 49 :contents-begin 40 :contents-end 49 :post-blank 0 :post-affiliated 40 :parent #13) #(“看1\n看2\n看3\n” 0 9 (:parent #16))))))) headline (closure (t) (x) (plantuml–headline-txt x))) (seq-reduce #’(lambda (a b) (concat a “\n” b)) (org-element-map (org-element-parse-buffer) ‘headline #’(lambda (x) (plantuml–headline-txt x))) nil) plantuml–parse-headlines() (plantuml–run-command “mindmap” (plantuml–parse-headlines)) plantuml-org-to-mindmap() funcall-interactively(plantuml-org-to-mindmap) call-interactively(plantuml-org-to-mindmap record nil) command-execute(plantuml-org-to-mindmap record) execute-extended-command(nil “plantuml-org-to-mindmap” “plantuml-min”) funcall-interactively(execute-extended-command nil “plantuml-org-to-mindmap” “plantuml-min”) call-interactively(execute-extended-command nil nil) command-execute(execute-extended-command)