My Emacs settings
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
488 B

(defun apg ()
"Insert a random password at point. Requires apg in the $PATH"
(let ((password))
(let ((buffer "*passwords*"))
(shell-command "apg -m 15" buffer)
(switch-to-buffer buffer)
(let ((beg (point))
(end (progn (end-of-line) (point))))
(setq password (buffer-substring beg end)))
(kill-buffer buffer)))
(insert password)))
(provide 'init-apg)