]> code.delx.au - gnu-emacs/commitdiff
Simplify some rococo Gnus code that loads or tests for other libraries.
authorGlenn Morris <rgm@gnu.org>
Thu, 17 Mar 2016 07:14:11 +0000 (00:14 -0700)
committerGlenn Morris <rgm@gnu.org>
Thu, 17 Mar 2016 07:14:11 +0000 (00:14 -0700)
* lisp/gnus/gnus-art.el (gnus-treat-ansi-sequences): Simplify default.
* lisp/gnus/mml-smime.el (epg): Simply require it.
(mml-smime-use): Simplify the default.  Doc fix.
* lisp/gnus/mml2015.el (epg-config): Require it.
(mml2015-use): Simplify the default.
* lisp/gnus/smime.el (password-cache): Simply require it.
(password-read-and-add): Remove declaration.

lisp/gnus/gnus-art.el
lisp/gnus/mml-smime.el
lisp/gnus/mml2015.el
lisp/gnus/smime.el

index 4d8cb802b4803775e8babbe1201d0a0f42ad6b0e..ca4758286425bb5a511964f98a08e564247f46d0 100644 (file)
@@ -1393,7 +1393,7 @@ predicate.  See Info node `(gnus)Customizing Articles'."
   :type gnus-article-treat-custom)
 (put 'gnus-treat-overstrike 'highlight t)
 
-(defcustom gnus-treat-ansi-sequences (if (locate-library "ansi-color") t)
+(defcustom gnus-treat-ansi-sequences t
   "Treat ANSI SGR control sequences.
 Valid values are nil, t, `head', `first', `last', an integer or a
 predicate.  See Info node `(gnus)Customizing Articles'."
index 02e602ce77fc133822ec80462e280e2fff7e8e6b..e473a6d3ff3c9b1828cd262a60af52c7d5064e98 100644 (file)
 (autoload 'message-narrow-to-headers "message")
 (autoload 'message-fetch-field "message")
 
-;; Prefer epg over openssl if it is available as epg uses GnuPG's gpgsm,
+;; Prefer epg over openssl as epg uses GnuPG's gpgsm,
 ;; which features full-fledged certificate management, while openssl requires
 ;; major manual efforts for certificate revocation and expiry and has bugs
 ;; as documented under man smime(1).
-(ignore-errors (require 'epg))
+(require 'epg)
 
-(defcustom mml-smime-use (if (featurep 'epg) 'epg 'openssl)
+(defcustom mml-smime-use 'epg
   "Whether to use OpenSSL or EasyPG (EPG) to handle S/MIME messages.
-Defaults to EPG if it's available.
-If you think about using OpenSSL, please read the BUGS section in the manual
-for the `smime' command coming with OpenSSL first.  EasyPG is recommended."
+If you're thinking about using OpenSSL, please first read the BUGS section
+in the manual for the `smime' command that comes with OpenSSL.
+We recommend EasyPG."
   :group 'mime-security
   :type '(choice (const :tag "EPG" epg)
                  (const :tag "OpenSSL" openssl)))
index 309f1a77ff0004577bd9d70909be0af052cb1525..0d64849673e695ff36b69b0f213653d5a04a7a45 100644 (file)
@@ -37,6 +37,7 @@
 (require 'mm-util)
 (require 'mml)
 (require 'mml-sec)
+(require 'epg-config)
 
 (defvar mc-pgp-always-sign)
 
 ;; Maybe this should be in eg mml-sec.el (and have a different name).
 ;; Then mml1991 would not need to require mml2015, and mml1991-use
 ;; could be removed.
-(defvar mml2015-use (or
-                    (progn
-                      (ignore-errors (require 'epg-config))
-                      (and (fboundp 'epg-check-configuration)
-                          'epg))
-                    (progn
-                      (let ((abs-file (locate-library "pgg")))
-                        ;; Don't load PGG if it is marked as obsolete
-                        ;; (Emacs 24).
-                        (when (and abs-file
-                                   (not (string-match "/obsolete/[^/]*\\'"
-                                                      abs-file)))
-                          (ignore-errors (require 'pgg))
-                          (and (fboundp 'pgg-sign-region)
-                               'pgg))))
-                    (progn (ignore-errors
-                             (load "mc-toplev"))
-                           (and (fboundp 'mc-encrypt-generic)
-                                (fboundp 'mc-sign-generic)
-                                (fboundp 'mc-cleanup-recipient-headers)
-                                'mailcrypt)))
+(defvar mml2015-use 'epg
   "The package used for PGP/MIME.
 Valid packages include `epg', `pgg' and `mailcrypt'.")
 
index 44841a7142277fd58729cddab778762dc3bb3368..9bec58a46f25bfa77b044f7401d2f3be77a8f3c5 100644 (file)
 
 (require 'dig)
 
-(if (locate-library "password-cache")
-    (require 'password-cache)
-  (require 'password))
+(require 'password-cache)
 
 (eval-when-compile (require 'cl))
 
@@ -231,9 +229,6 @@ must be set in `ldap-host-parameters-alist'."
 
 (defvar smime-details-buffer "*OpenSSL output*")
 
-;; Password dialog function
-(declare-function password-read-and-add "password-cache" (prompt &optional key))
-
 (defun smime-ask-passphrase (&optional cache-key)
   "Asks the passphrase to unlock the secret key.
 If `cache-key' and `password-cache' is non-nil then cache the