]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve an error about the message signer
authorKarl Fogel <kfogel@red-bean.com>
Mon, 4 Nov 2019 20:39:14 +0000 (14:39 -0600)
committerKarl Fogel <kfogel@red-bean.com>
Sat, 9 Nov 2019 20:30:09 +0000 (15:30 -0500)
* lisp/gnus/mml-sec.el (mml-secure-epg-sign): Don't suggest setting
  `mml-secure-smime-sign-with-sender' if it's already non-nil.

lisp/gnus/mml-sec.el

index c7a2d4664e8f2be9714206f605256260bcf137e7..a1f5b6386b222425d6a07077a35ef1e2be19c35f 100644 (file)
@@ -945,7 +945,15 @@ If no one is selected, symmetric encryption will be performed.  "
         (signers (mml-secure-signers context signer-names))
         signature micalg)
     (unless signers
-      (error "Couldn't find any signer names.  Perhaps `mml-secure-smime-sign-with-sender' should be set?"))
+      (let ((maybe-msg
+             (if mml-secure-smime-sign-with-sender
+                 "."
+               "; try setting `mml-secure-smime-sign-with-sender'.")))
+        ;; If `mml-secure-smime-sign-with-sender' is already non-nil
+        ;; then there's no point advising the user to examine it.  If
+        ;; there are any other variables worth examining, please
+        ;; improve this error message by having it mention them.
+        (error "Couldn't find any signer names%s" maybe-msg)))
     (when (eq 'OpenPGP protocol)
       (setf (epg-context-armor context) t)
       (setf (epg-context-textmode context) t)