1
0
Fork 0

feat: add gpg-decrypt-buffer function

Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
Lucas Sta Maria 2023-08-08 23:10:24 -07:00
parent 8e3e9f7f55
commit 25ebb11f07
No known key found for this signature in database
GPG key ID: F07FB16A826E3B47

View file

@ -70,5 +70,16 @@
(redraw-display)
(term gpg-encrypt-command))))
(defun gpg-decrypt-buffer (&optional filename)
"Decrypt the current file FILENAME with GPG."
(interactive)
(let* ((filename (or filename
buffer-file-name
(read-string "Decrypt file: ")))
(buf (get-buffer-create "*gpg-decrypt*")))
(switch-to-buffer buf)
(insert (shell-command-to-string (concat "gpg --decrypt " filename)))))
(provide 'gpgconfig)
;;; gpgconfig.el ends here