tls.el: Compilation fix
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 31 Aug 2015 23:41:00 +0000 (23:41 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 31 Aug 2015 23:41:00 +0000 (23:41 +0000)
* tls.el (tls-format-message):
Alias to format-message, or format if not available.
(open-tls-stream): Use it.

lisp/ChangeLog
lisp/tls.el

index 17d81a2..137dd34 100644 (file)
@@ -1,3 +1,9 @@
+2015-08-31  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * tls.el (tls-format-message):
+       Alias to format-message, or format if not available.
+       (open-tls-stream): Use it.
+
 2015-08-31  Paul Eggert  <eggert@cs.ucla.edu>
 
        * gnus-agent.el (gnus-agent-possibly-synchronize-flags-server):
index 1226916..a068675 100644 (file)
@@ -174,6 +174,11 @@ Used by `tls-certificate-information'."
   :type 'string
   :group 'tls)
 
+(if (fboundp 'format-message)
+    (defalias 'tls-format-message 'format-message)
+  ;; for Emacs < 25, and XEmacs, don't worry about quote translation.
+  (defalias 'tls-format-message 'format))
+
 (defun tls-certificate-information (der)
   "Parse X.509 certificate in DER format into an assoc list."
   (let ((certificate (concat "-----BEGIN CERTIFICATE-----\n"
@@ -275,8 +280,8 @@ Fourth arg PORT is an integer specifying a port to connect to."
                             (message "The certificate presented by `%s' is \
 NOT trusted." host))
                        (not (yes-or-no-p
-                             (format-message "The certificate presented by `%s' is \
-NOT trusted. Accept anyway? " host)))))
+                             (tls-format-message "\
+The certificate presented by `%s' is NOT trusted. Accept anyway? " host)))))
                  (and tls-hostmismatch
                       (save-excursion
                         (goto-char (point-min))