org-download
org-download copied to clipboard
setting download-dir in a setup file?
Is there any chance of adding an org-style setting for org-download-image-dir so that I can specify a path in a setup file? This would be helpful in projects that use a common setup for a bunch of different files.
Thanks for the cool tool, which I am finally using!
@titaniumbones
you can redefine org-download-image-dir where org-download function call :
for example:
I map C-M-y for org-download-paste-clipboard in doom :
(defun zz/org-download-paste-clipboard (&optional use-default-filename)
(interactive "P")
(require 'org-download)
(setq org-download-image-dir (concat "images/" (file-name-sans-extension (buffer-name))))
(let ((file
(if (not use-default-filename)
(read-string (format "Filename [%s]: " org-download-screenshot-basename)
nil nil org-download-screenshot-basename)
nil)))
(org-download-clipboard file)))
(map! :map org-mode-map
"C-M-y" #'zz/org-download-paste-clipboard )
every time , call zz/org-download-paste-clipboard , at the same time org-download-image-dir change :
(setq org-download-image-dir (concat "images/" (file-name-sans-extension (buffer-name))))