Last active
April 3, 2021 17:06
Revisions
-
et2010 revised this gist
Apr 3, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ (old-path (org-element-property :path link))) (read-string "PATH: " old-path nil old-path)))) (let ((old-path (org-element-property :path (org-element-context)))) (mkdir (file-name-directory path) t) (rename-file old-path path) (save-excursion (goto-char (point-min)) -
et2010 created this gist
Apr 3, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ (defun et/rename-org-link-file (path) (interactive (list (let* ((link (org-element-context)) (old-path (org-element-property :path link))) (read-string "PATH: " old-path nil old-path)))) (let ((old-path (org-element-property :path (org-element-context)))) (rename-file old-path path) (save-excursion (goto-char (point-min)) (while (search-forward old-path nil t) (replace-match path))) (message (format "Rename %s to %s" old-path path))) )