Created
December 18, 2015 10:09
-
-
Save jupp0r/08ca64b7c14c6093bba2 to your computer and use it in GitHub Desktop.
Using gpg-agent with emacs under OS X
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 characters
;; read gpg-agent environment | |
(defun read-env-line (line) | |
"read a env line and post to environment" | |
(let ((key-value-pair (split-string line "=" t))) | |
(setenv (car key-value-pair) (car (last key-value-pair)))) | |
) | |
(defvar gpg-agent-info-file) | |
(setq gpg-agent-info-file (concat (getenv "HOME") "/.gpg-agent-info")) | |
(when | |
(file-exists-p gpg-agent-info-file) | |
(with-temp-buffer | |
(progn | |
(insert-file-contents gpg-agent-info-file) | |
(mapc 'read-env-line (split-string (buffer-string) "\n" t))) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment