DnD: Create directory when `org-yank-image-save-method' is a directory
* lisp/org.el (org--dnd-attach-file): Make sure that target directory is created before copying file when `org-yank-image-save-method' is set to specific directory (not 'attach). Reported-by: ISouthRain <isouthrain@qq.com> Link: https://orgmode.org/list/tencent_AABB2DEBF7ABFBC795348C288E0EBFCFDD0A@qq.com
This commit is contained in:
parent
96113f3b59
commit
d7b5c19daa
|
@ -20941,6 +20941,9 @@ SEPARATOR is the string to insert after each link."
|
|||
('private (or org-yank-dnd-default-attach-method
|
||||
org-attach-method)))))
|
||||
(if separatep
|
||||
(progn
|
||||
(unless (file-directory-p org-yank-image-save-method)
|
||||
(make-directory org-yank-image-save-method t))
|
||||
(funcall
|
||||
(pcase method
|
||||
('cp #'copy-file)
|
||||
|
@ -20949,7 +20952,7 @@ SEPARATOR is the string to insert after each link."
|
|||
('lns #'make-symbolic-link))
|
||||
filename
|
||||
(expand-file-name (file-name-nondirectory filename)
|
||||
org-yank-image-save-method))
|
||||
org-yank-image-save-method)))
|
||||
(org-attach-attach filename nil method))
|
||||
(insert
|
||||
(org-link-make-string
|
||||
|
|
Loading…
Reference in New Issue