aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/epg-config.el16
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index 74ab65113e7..daa9a5abd17 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -183,10 +183,18 @@ version requirement is met."
183(defun epg-config--make-gpg-configuration (program) 183(defun epg-config--make-gpg-configuration (program)
184 (let (config groups type args) 184 (let (config groups type args)
185 (with-temp-buffer 185 (with-temp-buffer
186 (apply #'call-process program nil (list t nil) nil 186 ;; The caller might have bound coding-system-for-* to something
187 (append (if epg-gpg-home-directory 187 ;; like 'no-conversion, but the below needs to call PROGRAM
188 (list "--homedir" epg-gpg-home-directory)) 188 ;; expecting human-readable text in both directions (since we
189 '("--with-colons" "--list-config"))) 189 ;; are going to parse the output as text), so let Emacs guess
190 ;; the encoding of that text by its usual encoding-detection
191 ;; machinery.
192 (let ((coding-system-for-read 'undecided)
193 (coding-system-for-write 'undecided))
194 (apply #'call-process program nil (list t nil) nil
195 (append (if epg-gpg-home-directory
196 (list "--homedir" epg-gpg-home-directory))
197 '("--with-colons" "--list-config"))))
190 (goto-char (point-min)) 198 (goto-char (point-min))
191 (while (re-search-forward "^cfg:\\([^:]+\\):\\(.*\\)" nil t) 199 (while (re-search-forward "^cfg:\\([^:]+\\):\\(.*\\)" nil t)
192 (setq type (intern (match-string 1)) 200 (setq type (intern (match-string 1))