formatted and added message

This commit is contained in:
Jason Tian 2024-08-20 10:12:08 +08:00
parent f100b66f0e
commit 96852f7c47

View file

@ -14,16 +14,17 @@
Version 2023-08-04"
(interactive)
(let* ((link-info (org-element-context))
(path (org-element-property :path link-info))
(abs-path (if (string-prefix-p "file:" path)
(file-truename (replace-regexp-in-string "^file:" "" path))
(file-truename path)))
(default-decrypt-path (concat abs-path ".clear")))
(path (org-element-property :path link-info))
(abs-path (if (string-prefix-p "file:" path)
(file-truename (replace-regexp-in-string "^file:" "" path))
(file-truename path)))
(default-decrypt-path (concat abs-path ".clear")))
(if (file-exists-p abs-path)
(let ((decrypt-path (read-file-name
(let ((decrypt-path (read-file-name
(format "Enter target path (default %s): " default-decrypt-path)
nil nil nil default-decrypt-path)))
(epa-decrypt-file abs-path decrypt-path))
(epa-decrypt-file abs-path decrypt-path)
(message "%s is decrypted to %s" abs-path decrypt-path))
(message "File not found: %s" abs-path))))
;; END }}
@ -34,4 +35,4 @@ Version 2023-08-04"
;; Local Variables:
;; coding: utf-8
;; End:
;;; init-gpg.el ends here
;;; init-gpg.el ends here