[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24783: 25.1 launchs gpg-agent --homedir as ~/.emacs.d/elpa/gnupg
From: |
npostavs |
Subject: |
bug#24783: 25.1 launchs gpg-agent --homedir as ~/.emacs.d/elpa/gnupg |
Date: |
Sat, 12 Nov 2016 09:14:16 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
Fkqqrr <fkqqrr@riseup.net> writes:
> I am running Emacs 25.1 under Gentoo.
>
> Each time I run `list-packages', Emacs 25.1 launchs Gnupg-2.1 gpg-agent,
> but the `--homedir' argument is set to `~/.emacs.d/elpa/gnupg' though I
> have it to `~/.gnupg' in `~/.gnupg/gpg-agent.conf'.
>
According to `(gnupg) Agent Options':
'--homedir DIR'
Set the name of the home directory to DIR. If this option is not
used, the home directory defaults to '~/.gnupg'. It is only
recognized when given on the command line.
So setting this in gpg-agent.conf wouldn't work (which makes sense,
since you need to know the homedir in order to find the configuration
file).
>
> However if `gpg-agent' is launched before `list-package', Emacs 25.1
> will respect that.
There is some code package.el that changes the gpg homedir:
(defun package-import-keyring (&optional file)
"Import keys from FILE."
(interactive "fFile: ")
(setq file (expand-file-name file))
(let ((context (epg-make-context 'OpenPGP))
(homedir (expand-file-name "gnupg" package-user-dir)))
(with-file-modes 448
(make-directory homedir t))
(setf (epg-context-home-directory context) homedir)
(message "Importing %s..." (file-name-nondirectory file))
(epg-import-keys-from-file context file)
(message "Importing %s...done" (file-name-nondirectory file))))
Perhaps this setf should be a letf instead?
- bug#24783: 25.1 launchs gpg-agent --homedir as ~/.emacs.d/elpa/gnupg,
npostavs <=