- (or (and (not force) (alist-get protocol epg--configurations))
- ;; If the executable value is already set with M-x
- ;; customize, use it without checking.
- (if (get symbol 'saved-value)
- (let ((configuration (funcall constructor (symbol-value symbol))))
- (push (cons protocol configuration) epg--configurations)
- configuration)
- (catch 'found
- (dolist (program-version alist)
- (let ((executable (executable-find (car program-version))))
- (when executable
- (let ((configuration
- (funcall constructor executable)))
- (when (ignore-errors
- (epg-check-configuration configuration
- (cdr program-version))
- t)
- (push (cons protocol configuration) epg--configurations)
- (throw 'found configuration))))))))))))
+ (let ((constructor
+ (alist-get protocol epg-config--configuration-constructor-alist)))
+ (or (and (not no-cache) (alist-get protocol epg--configurations))
+ ;; If the executable value is already set with M-x
+ ;; customize, use it without checking.
+ (if (and symbol (get symbol 'saved-value))
+ (let ((configuration
+ (funcall constructor (symbol-value symbol))))
+ (push (cons protocol configuration) epg--configurations)
+ configuration)
+ (catch 'found
+ (dolist (program-version alist)
+ (let ((executable (executable-find (car program-version))))
+ (when executable
+ (let ((configuration
+ (funcall constructor executable)))
+ (when (ignore-errors
+ (epg-check-configuration configuration
+ (cdr program-version))
+ t)
+ (unless no-cache
+ (push (cons protocol configuration)
+ epg--configurations))
+ (throw 'found configuration)))))))))))))