From e032ef05613bbf637e0e448a1c8de45bca9b3ad6 Mon Sep 17 00:00:00 2001 From: imymirror <2633610394@qq.com> Date: Tue, 15 Dec 2020 13:55:47 +0800 Subject: [PATCH 1/2] add an example for README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 8fdd4c5..1de5ca2 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,29 @@ Customize `org-download-backend` to choose between `url-retrieve` ## Pasting from the clipboard If you have the image stored in the clipboard, use `org-download-clipboard`. + +here is an example. shortcut `C-M-y` will have the image stored from the clipboard in the path `images/$currentfilename/%Y%m%d-%H%M%S_$imagename.png` + +``` +(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))) + +(after! org + (setq org-download-method 'directory) + (setq org-download-image-dir "images/") + (setq org-download-heading-lvl nil) + (setq org-download-timestamp "%Y%m%d-%H%M%S_") + (setq org-image-actual-width nil) + (setq org-src-window-setup 'split-window-right) + (setq org-download-annotate-function (lambda (_link) "")) +(map! :map org-mode-map + "C-M-y" #'zz/org-download-paste-clipboard )) +``` \ No newline at end of file From aa2f14fe3c778924867ca2a8f9fdee391d54f9c0 Mon Sep 17 00:00:00 2001 From: imymirror <2633610394@qq.com> Date: Tue, 15 Dec 2020 15:05:20 +0800 Subject: [PATCH 2/2] add hide anonotate config. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 1de5ca2..64ffe54 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,11 @@ optionally add a timestamp to the file name. Customize `org-download-backend` to choose between `url-retrieve` (the default) or `wget` or `curl`. +if you don't want to show the `#+DOWNLOAD` anonotate, use this: +``` +(setq org-download-annotate-function (lambda (_link) "")) +``` + ## Set up ```elisp