org-download

a fork of abo-abo's org-download
git clone https://git.trogloxene.org/org-download.git
Log | Files | Refs | README

commit a7b15e14a14b2cd228fa369b6a566a272b2fe6b2
parent c75095778c02e70fc7efa2aac5c77936b56d04db
Author: Wanderson Ferreira <iagwanderson@gmail.com>
Date:   Sun, 12 Nov 2017 14:09:16 -0200

org-download.el (org-download-rename-at-point): Add

Fixes #60
Fixes #61

Diffstat:
Morg-download.el | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/org-download.el b/org-download.el @@ -341,6 +341,19 @@ It's inserted before the image link and is used to annotate it.") (org-attach-attach filename nil 'none)) (org-download-insert-link link filename))))) +(defun org-download-rename-at-point () + "Rename image at point." + (interactive) + (let* ((dir-path (org-download--dir)) + (current-name (file-name-nondirectory (ffap-file-at-point))) + (current-path (concat dir-path "/" current-name)) + (ext (file-name-extension current-name)) + (new-name (read-string "Rename file at point to: ")) + (new-path (concat dir-path "/" new-name "." ext))) + (rename-file current-path new-path) + (message "File successfully renamed...") + (org-download-replace-all current-name (concat new-name "." ext)))) + (defun org-download-rename-last-file () "Rename the last downloaded file saved in your computer." (interactive)