使用plantuml生成mindmap 以及数据结构图

echo @'
This is some 
demo content that contains 
special charedcters like !@$%^&()):"{}][;']
'@ > myscript.txt

看起来可以这样,把多行放在 @‘ ’@ 之间:

echo @' %s '@  | java -jar %s -t%s -pipe > %s

话说,powershell 里有 | pipeline 吗?

有pipeline 我在 cmd.exe 上试成功了 但是没有用 cat <<EOF

在powershell 试过了 也不行的

那看来要支持 windows 还是得写临时文件

把你的代码改成了兼容全平台的了, 但是改动挺大的, 介意提个PR吗? :rofl:

提一个吧,我看看。

己提, ZSBD

我看了一下,是不是可以考虑,不同的平台使用不同的命令。或者使用一个配置项来让用户选择。我希望在 linux / mac 下尽量不会生成临时文件。

我觉得 ~/.emacs.d/.local/cache 下面那么多临时文件, 也不差这两个文件了, 而且这两个文件正常来说也不大,在特定的场合还是有点用的, 比如DEBUG的时候, 用户还可以直接用命令行去跑临时文件

我在mac下使用 fish shell ,也不支持 cat <<EOF 语法

那看来 @wcq062821 的做法是对的,还是生成临时文件最稳妥。

创建了一个最简单的org文件,运行M-x plantuml-org-to-mindmap-open 会出错 substring-no-properties: Wrong type argument: integer-or-marker-p, nil 请问为什么呢

(setq debug-on-error t) ,然后运行报错时,看看完整的 Backtrace 是什么?

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 "<b>")) (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 "</b>")) (if plantuml-mindmap-contains-org-content (progn (concat ":\n\n" text ";")))))
  plantuml--headline-txt((headline (:raw-value "jfdfj" :begin 178 :end 186 :pre-blank 0 :contents-begin nil :contents-end nil :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 178 :title (#("jfdfj" 0 5 (:parent #1))) :parent (org-data nil (section (:begin 1 :end 178 :contents-begin 1 :contents-end 178 :post-blank 0 :post-affiliated 1 :parent #39) (property-drawer (:begin 1 :end 68 :contents-begin 14 :contents-end 62 :post-blank 0 :post-affiliated 1 :parent #42) (node-property (:key "ID" :value "6F20BD69-C4B7-4947-AF75-EBB661B29F22" :begin 14 :end 62 :post-blank 0 :post-affiliated 14 :parent #45))) (keyword (:key "TITLE" :value "test" :begin 68 :end 82 :post-blank 0 :post-affiliated 68 :parent #42)) (keyword (:key "AUTHOR" :value "Jun Gao" :begin 82 :end 100 :post-blank 0 :post-affiliated 82 :parent #42)) (keyword (:key "DATE" :value "[2022-10-24 一 11:30]" :begin 100 :end 129 :post-blank 0 :post-affiliated 100 :parent #42)) (keyword (:key "HUGO_BASE_DIR" :value "~/notes" :begin 129 :end 154 :post-blank 0 :post-affiliated 129 :parent #42)) (keyword (:key "HUGO_SECTION" :value "ch/docs" :begin 154 :end 178 :post-blank 0 :post-affiliated 154 :parent #42))) #1 (headline (:raw-value "kfdofk" :begin 186 :end 202 :pre-blank 0 :contents-begin 195 :contents-end 202 :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 186 :title (#("kfdofk" 0 6 ...)) :parent #39) (headline (:raw-value "jfk" :begin 195 :end 202 :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 195 :title (...) :parent #44)))))))
  (closure (t) (x) (plantuml--headline-txt x))((headline (:raw-value "jfdfj" :begin 178 :end 186 :pre-blank 0 :contents-begin nil :contents-end nil :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 178 :title (#("jfdfj" 0 5 (:parent #1))) :parent (org-data nil (section (:begin 1 :end 178 :contents-begin 1 :contents-end 178 :post-blank 0 :post-affiliated 1 :parent #39) (property-drawer (:begin 1 :end 68 :contents-begin 14 :contents-end 62 :post-blank 0 :post-affiliated 1 :parent #42) (node-property (:key "ID" :value "6F20BD69-C4B7-4947-AF75-EBB661B29F22" :begin 14 :end 62 :post-blank 0 :post-affiliated 14 :parent #45))) (keyword (:key "TITLE" :value "test" :begin 68 :end 82 :post-blank 0 :post-affiliated 68 :parent #42)) (keyword (:key "AUTHOR" :value "Jun Gao" :begin 82 :end 100 :post-blank 0 :post-affiliated 82 :parent #42)) (keyword (:key "DATE" :value "[2022-10-24 一 11:30]" :begin 100 :end 129 :post-blank 0 :post-affiliated 100 :parent #42)) (keyword (:key "HUGO_BASE_DIR" :value "~/notes" :begin 129 :end 154 :post-blank 0 :post-affiliated 129 :parent #42)) (keyword (:key "HUGO_SECTION" :value "ch/docs" :begin 154 :end 178 :post-blank 0 :post-affiliated 154 :parent #42))) #1 (headline (:raw-value "kfdofk" :begin 186 :end 202 :pre-blank 0 :contents-begin 195 :contents-end 202 :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 186 :title (#("kfdofk" 0 6 ...)) :parent #39) (headline (:raw-value "jfk" :begin 195 :end 202 :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 195 :title (...) :parent #44)))))))
  #f(compiled-function (--data) #<bytecode 0x1c880fee51ad8122>)((headline (:raw-value "jfdfj" :begin 178 :end 186 :pre-blank 0 :contents-begin nil :contents-end nil :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 178 :title (#("jfdfj" 0 5 (:parent #1))) :parent (org-data nil (section (:begin 1 :end 178 :contents-begin 1 :contents-end 178 :post-blank 0 :post-affiliated 1 :parent #39) (property-drawer (:begin 1 :end 68 :contents-begin 14 :contents-end 62 :post-blank 0 :post-affiliated 1 :parent #42) (node-property (:key "ID" :value "6F20BD69-C4B7-4947-AF75-EBB661B29F22" :begin 14 :end 62 :post-blank 0 :post-affiliated 14 :parent #45))) (keyword (:key "TITLE" :value "test" :begin 68 :end 82 :post-blank 0 :post-affiliated 68 :parent #42)) (keyword (:key "AUTHOR" :value "Jun Gao" :begin 82 :end 100 :post-blank 0 :post-affiliated 82 :parent #42)) (keyword (:key "DATE" :value "[2022-10-24 一 11:30]" :begin 100 :end 129 :post-blank 0 :post-affiliated 100 :parent #42)) (keyword (:key "HUGO_BASE_DIR" :value "~/notes" :begin 129 :end 154 :post-blank 0 :post-affiliated 129 :parent #42)) (keyword (:key "HUGO_SECTION" :value "ch/docs" :begin 154 :end 178 :post-blank 0 :post-affiliated 154 :parent #42))) #1 (headline (:raw-value "kfdofk" :begin 186 :end 202 :pre-blank 0 :contents-begin 195 :contents-end 202 :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 186 :title (#("kfdofk" 0 6 ...)) :parent #39) (headline (:raw-value "jfk" :begin 195 :end 202 :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 195 :title (...) :parent #44)))))))
  mapc(#f(compiled-function (--data) #<bytecode 0x1c880fee51ad8122>) ((section (:begin 1 :end 178 :contents-begin 1 :contents-end 178 :post-blank 0 :post-affiliated 1 :parent (org-data nil . #2)) (property-drawer (:begin 1 :end 68 :contents-begin 14 :contents-end 62 :post-blank 0 :post-affiliated 1 :parent #3) (node-property (:key "ID" :value "6F20BD69-C4B7-4947-AF75-EBB661B29F22" :begin 14 :end 62 :post-blank 0 :post-affiliated 14 :parent #6))) (keyword (:key "TITLE" :value "test" :begin 68 :end 82 :post-blank 0 :post-affiliated 68 :parent #3)) (keyword (:key "AUTHOR" :value "Jun Gao" :begin 82 :end 100 :post-blank 0 :post-affiliated 82 :parent #3)) (keyword (:key "DATE" :value "[2022-10-24 一 11:30]" :begin 100 :end 129 :post-blank 0 :post-affiliated 100 :parent #3)) (keyword (:key "HUGO_BASE_DIR" :value "~/notes" :begin 129 :end 154 :post-blank 0 :post-affiliated 129 :parent #3)) (keyword (:key "HUGO_SECTION" :value "ch/docs" :begin 154 :end 178 :post-blank 0 :post-affiliated 154 :parent #3))) (headline (:raw-value "jfdfj" :begin 178 :end 186 :pre-blank 0 :contents-begin nil :contents-end nil :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 178 :title (#("jfdfj" 0 5 (:parent #4))) :parent (org-data nil . #2))) (headline (:raw-value "kfdofk" :begin 186 :end 202 :pre-blank 0 :contents-begin 195 :contents-end 202 :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 186 :title (#("kfdofk" 0 6 (:parent #5))) :parent (org-data nil . #2)) (headline (:raw-value "jfk" :begin 195 :end 202 :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 195 :title (#("jfk" 0 3 (:parent #8))) :parent #5)))))
  #f(compiled-function (--data) #<bytecode 0x1c880fee51ad8122>)((org-data nil (section (:begin 1 :end 178 :contents-begin 1 :contents-end 178 :post-blank 0 :post-affiliated 1 :parent #1) (property-drawer (:begin 1 :end 68 :contents-begin 14 :contents-end 62 :post-blank 0 :post-affiliated 1 :parent #4) (node-property (:key "ID" :value "6F20BD69-C4B7-4947-AF75-EBB661B29F22" :begin 14 :end 62 :post-blank 0 :post-affiliated 14 :parent #7))) (keyword (:key "TITLE" :value "test" :begin 68 :end 82 :post-blank 0 :post-affiliated 68 :parent #4)) (keyword (:key "AUTHOR" :value "Jun Gao" :begin 82 :end 100 :post-blank 0 :post-affiliated 82 :parent #4)) (keyword (:key "DATE" :value "[2022-10-24 一 11:30]" :begin 100 :end 129 :post-blank 0 :post-affiliated 100 :parent #4)) (keyword (:key "HUGO_BASE_DIR" :value "~/notes" :begin 129 :end 154 :post-blank 0 :post-affiliated 129 :parent #4)) (keyword (:key "HUGO_SECTION" :value "ch/docs" :begin 154 :end 178 :post-blank 0 :post-affiliated 154 :parent #4))) (headline (:raw-value "jfdfj" :begin 178 :end 186 :pre-blank 0 :contents-begin nil :contents-end nil :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 178 :title (#("jfdfj" 0 5 (:parent #5))) :parent #1)) (headline (:raw-value "kfdofk" :begin 186 :end 202 :pre-blank 0 :contents-begin 195 :contents-end 202 :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 186 :title (#("kfdofk" 0 6 (:parent #6))) :parent #1) (headline (:raw-value "jfk" :begin 195 :end 202 :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 195 :title (#("jfk" 0 3 (:parent #9))) :parent #6)))))
  org-element-map((org-data nil (section (:begin 1 :end 178 :contents-begin 1 :contents-end 178 :post-blank 0 :post-affiliated 1 :parent #1) (property-drawer (:begin 1 :end 68 :contents-begin 14 :contents-end 62 :post-blank 0 :post-affiliated 1 :parent #4) (node-property (:key "ID" :value "6F20BD69-C4B7-4947-AF75-EBB661B29F22" :begin 14 :end 62 :post-blank 0 :post-affiliated 14 :parent #7))) (keyword (:key "TITLE" :value "test" :begin 68 :end 82 :post-blank 0 :post-affiliated 68 :parent #4)) (keyword (:key "AUTHOR" :value "Jun Gao" :begin 82 :end 100 :post-blank 0 :post-affiliated 82 :parent #4)) (keyword (:key "DATE" :value "[2022-10-24 一 11:30]" :begin 100 :end 129 :post-blank 0 :post-affiliated 100 :parent #4)) (keyword (:key "HUGO_BASE_DIR" :value "~/notes" :begin 129 :end 154 :post-blank 0 :post-affiliated 129 :parent #4)) (keyword (:key "HUGO_SECTION" :value "ch/docs" :begin 154 :end 178 :post-blank 0 :post-affiliated 154 :parent #4))) (headline (:raw-value "jfdfj" :begin 178 :end 186 :pre-blank 0 :contents-begin nil :contents-end nil :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 178 :title (#("jfdfj" 0 5 (:parent #5))) :parent #1)) (headline (:raw-value "kfdofk" :begin 186 :end 202 :pre-blank 0 :contents-begin 195 :contents-end 202 :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 186 :title (#("kfdofk" 0 6 (:parent #6))) :parent #1) (headline (:raw-value "jfk" :begin 195 :end 202 :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 195 :title (#("jfk" 0 3 (:parent #9))) :parent #6)))) 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)
  counsel-M-x-action("plantuml-org-to-mindmap")
  ivy-call()
  #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1de06699ed3763be>)("M-x " [## magit-section-show-headings AND calendar-forward-week tramp-sudoedit-file-name-handler tramp-completion-handle-file-name-all-completions Set\ Slice ivy-explorer speedbar-check-vc-this-line eglot-reconnect ivy-default-view-name help-follow-symbol elfeed-search-face-alist japanese-hiragana-two-byte gnus-article-nndoc-name dired-unmark-all-marks znc uniquify-rename-buffer speedbar-file-regexp elfeed-db-update-hook elfeed-entry-id--cmacro raw-text-dos message-expand-name-databases efile neo-util--kill-buffers-for-path nnoo-map-functions Hiragino\ Kaku\ Gothic\ StdN compilation-error-list :where which-key--stop-timer EXPLAIN vc-annotate tramp-sudoedit-handle-set-file-acl xref--push-markers vc-bzr-shelve-menu nswbuff 0 nnimap-status-message gnus-summary-limit-to-marks org-agenda-menu-show-matcher nnmail-message-id-cache-file magit-filename flycheck-previous-error :kill-buffer org-get-org-file research xref-group counsel--async-filter tramp-handle-make-auto-save-file-name ls-lisp-handle-switches ...] :predicate #f(compiled-function (sym) #<bytecode -0x9f622b86b49cadc>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  apply(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1de06699ed3763be>) ("M-x " [## magit-section-show-headings AND calendar-forward-week tramp-sudoedit-file-name-handler tramp-completion-handle-file-name-all-completions Set\ Slice ivy-explorer speedbar-check-vc-this-line eglot-reconnect ivy-default-view-name help-follow-symbol elfeed-search-face-alist japanese-hiragana-two-byte gnus-article-nndoc-name dired-unmark-all-marks znc uniquify-rename-buffer speedbar-file-regexp elfeed-db-update-hook elfeed-entry-id--cmacro raw-text-dos message-expand-name-databases efile neo-util--kill-buffers-for-path nnoo-map-functions Hiragino\ Kaku\ Gothic\ StdN compilation-error-list :where which-key--stop-timer EXPLAIN vc-annotate tramp-sudoedit-handle-set-file-acl xref--push-markers vc-bzr-shelve-menu nswbuff 0 nnimap-status-message gnus-summary-limit-to-marks org-agenda-menu-show-matcher nnmail-message-id-cache-file magit-filename flycheck-previous-error :kill-buffer org-get-org-file research xref-group counsel--async-filter tramp-handle-make-auto-save-file-name ls-lisp-handle-switches ...] :predicate #f(compiled-function (sym) #<bytecode -0x9f622b86b49cadc>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x))
  ivy-posframe--read(#f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1de06699ed3763be>) "M-x " [## magit-section-show-headings AND calendar-forward-week tramp-sudoedit-file-name-handler tramp-completion-handle-file-name-all-completions Set\ Slice ivy-explorer speedbar-check-vc-this-line eglot-reconnect ivy-default-view-name help-follow-symbol elfeed-search-face-alist japanese-hiragana-two-byte gnus-article-nndoc-name dired-unmark-all-marks znc uniquify-rename-buffer speedbar-file-regexp elfeed-db-update-hook elfeed-entry-id--cmacro raw-text-dos message-expand-name-databases efile neo-util--kill-buffers-for-path nnoo-map-functions Hiragino\ Kaku\ Gothic\ StdN compilation-error-list :where which-key--stop-timer EXPLAIN vc-annotate tramp-sudoedit-handle-set-file-acl xref--push-markers vc-bzr-shelve-menu nswbuff 0 nnimap-status-message gnus-summary-limit-to-marks org-agenda-menu-show-matcher nnmail-message-id-cache-file magit-filename flycheck-previous-error :kill-buffer org-get-org-file research xref-group counsel--async-filter tramp-handle-make-auto-save-file-name ls-lisp-handle-switches ...] :predicate #f(compiled-function (sym) #<bytecode -0x9f622b86b49cadc>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  apply(ivy-posframe--read #f(compiled-function (arg1 arg2 &rest rest) "Read a string in the minibuffer, with completion.\n\nPROMPT is a string, normally ending in a colon and a space.\n`ivy-count-format' is prepended to PROMPT during completion.\n\nCOLLECTION is either a list of strings, a function, an alist, or\na hash table, supplied for `minibuffer-completion-table'.\n\nPREDICATE is applied to filter out the COLLECTION immediately.\nThis argument is for compatibility with `completing-read'.\n\nWhen REQUIRE-MATCH is non-nil, only members of COLLECTION can be\nselected.\n\nIf INITIAL-INPUT is non-nil, then insert that input in the\nminibuffer initially.\n\nHISTORY is a name of a variable to hold the completion session\nhistory.\n\nKEYMAP is composed with `ivy-minibuffer-map'.\n\nPRESELECT, when non-nil, determines which one of the candidates\nmatching INITIAL-INPUT to select initially.  An integer stands\nfor the position of the desired candidate in the collection,\ncounting from zero.  Otherwise, use the first occurrence of\nPRESELECT in the collection.  Comparison is first done with\n`equal'.  If that fails, and when applicable, match PRESELECT as\na regular expression.\n\nDEF is for compatibility with `completing-read'.\n\nUPDATE-FN is called each time the candidate list is re-displayed.\n\nWhen SORT is non-nil, `ivy-sort-functions-alist' determines how\nto sort candidates before displaying them.\n\nACTION is a function to call after selecting a candidate.\nIt takes one argument, the selected candidate. If COLLECTION is\nan alist, the argument is a cons cell, otherwise it's a string.\n\nMULTI-ACTION, when non-nil, is called instead of ACTION when\nthere are marked candidates. It takes the list of candidates as\nits only argument. When it's nil, ACTION is called on each marked\ncandidate.\n\nUNWIND is a function of no arguments to call before exiting.\n\nRE-BUILDER is a function transforming input text into a regex\npattern.\n\nMATCHER is a function which can override how candidates are\nfiltered based on user input.  It takes a regex pattern and a\nlist of candidates, and returns the list of matching candidates.\n\nDYNAMIC-COLLECTION is a boolean specifying whether the list of\ncandidates is updated after each input by calling COLLECTION.\n\nEXTRA-PROPS is a plist that can be used to store\ncollection-specific session-specific data.\n\nCALLER is a symbol to uniquely identify the caller to `ivy-read'.\nIt is used, along with COLLECTION, to determine which\ncustomizations apply to the current completion session." #<bytecode 0x1de06699ed3763be>) ("M-x " [## magit-section-show-headings AND calendar-forward-week tramp-sudoedit-file-name-handler tramp-completion-handle-file-name-all-completions Set\ Slice ivy-explorer speedbar-check-vc-this-line eglot-reconnect ivy-default-view-name help-follow-symbol elfeed-search-face-alist japanese-hiragana-two-byte gnus-article-nndoc-name dired-unmark-all-marks znc uniquify-rename-buffer speedbar-file-regexp elfeed-db-update-hook elfeed-entry-id--cmacro raw-text-dos message-expand-name-databases efile neo-util--kill-buffers-for-path nnoo-map-functions Hiragino\ Kaku\ Gothic\ StdN compilation-error-list :where which-key--stop-timer EXPLAIN vc-annotate tramp-sudoedit-handle-set-file-acl xref--push-markers vc-bzr-shelve-menu nswbuff 0 nnimap-status-message gnus-summary-limit-to-marks org-agenda-menu-show-matcher nnmail-message-id-cache-file magit-filename flycheck-previous-error :kill-buffer org-get-org-file research xref-group counsel--async-filter tramp-handle-make-auto-save-file-name ls-lisp-handle-switches ...] :predicate #f(compiled-function (sym) #<bytecode -0x9f622b86b49cadc>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x))
  ivy-read("M-x " [## magit-section-show-headings AND calendar-forward-week tramp-sudoedit-file-name-handler tramp-completion-handle-file-name-all-completions Set\ Slice ivy-explorer speedbar-check-vc-this-line eglot-reconnect ivy-default-view-name help-follow-symbol elfeed-search-face-alist japanese-hiragana-two-byte gnus-article-nndoc-name dired-unmark-all-marks znc uniquify-rename-buffer speedbar-file-regexp elfeed-db-update-hook elfeed-entry-id--cmacro raw-text-dos message-expand-name-databases efile neo-util--kill-buffers-for-path nnoo-map-functions Hiragino\ Kaku\ Gothic\ StdN compilation-error-list :where which-key--stop-timer EXPLAIN vc-annotate tramp-sudoedit-handle-set-file-acl xref--push-markers vc-bzr-shelve-menu nswbuff 0 nnimap-status-message gnus-summary-limit-to-marks org-agenda-menu-show-matcher nnmail-message-id-cache-file magit-filename flycheck-previous-error :kill-buffer org-get-org-file research xref-group counsel--async-filter tramp-handle-make-auto-save-file-name ls-lisp-handle-switches ...] :predicate #f(compiled-function (sym) #<bytecode -0x9f622b86b49cadc>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

应该是个bug,我个人的使用习惯是把某个org 文章,导出结构的mindMap 没有考虑到只有 headline,没有内容的 org 文件。你可以现在你可以在 head 下增加内容试试。我试着修复这个问题。 例如:

通过变量 =plantuml-mindmap-contains-org-content= 可以决定,是否把每个head下的内容导出到 mindMap 文件当中。

Mac M1 上生成的 svg 是 zero byte。有没有什么解决的头绪? @ginqi7

brew install plantuml

emacs -q 执行下面的配置

(add-to-list 'load-path (expand-file-name "~/.emacs.d/packages/plantuml-emacs/"))
(require 'plantuml)
(setq plantuml-jar-path "/opt/homebrew/Cellar/plantuml/1.2022.8/")

样本文件用的仓库中的 org-example.org

把 plantuml-jar-path 设定为完整的 jar 包路径试试看。代码里会使用 java -jar 的形式运行 plantuml

(setq plantuml-jar-path "/opt/homebrew/Cellar/plantuml/1.2022.8/libexec/plantuml.jar")

也是碰到了这个问题,有修复bug后麻烦通知一声,谢谢大佬

谢谢,是需要设置完整的路径。

最新的代码应该已经修复了这个问题。更新一下试试看。

增加内容之后确实可以生成svg文件了,但是svg文件是0字节的,Message里也没有报错,这是为什么呢


"cat <<EOF | java -jar ~/.emacs.d/lisp/plantuml.jar -tsvg -pipe > /Users/didi/notes/content-org/images/20221024172206.svg 
@startmindmap 
!theme plain 
skinparam defaultFontName somefont

*: <b>1. hhhh</b>:

jdifdjfi;
**: <b>1. ffjdif</b>:

fdjiffj;
*: <b>2. hfdifhdif</b>:

fjdif;
@endmindmap
EOF"

(Shell command succeeded with no output)
Reverting buffer ‘20221024172206.svg’.