emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9004011: Port tls.el to older Emacs


From: Paul Eggert
Subject: [Emacs-diffs] master 9004011: Port tls.el to older Emacs
Date: Tue, 01 Sep 2015 01:16:52 +0000

branch: master
commit 9004011ec0876d74209814417f939a348e107d61
Author: Katsumi Yamaoka <address@hidden>
Commit: Paul Eggert <address@hidden>

    Port tls.el to older Emacs
    
    * lisp/net/tls.el (tls-format-message):
    Alias to format-message, or format if not available.
    (open-tls-stream): Use it.
---
 lisp/net/tls.el |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/net/tls.el b/lisp/net/tls.el
index 1226916..46891be 100644
--- a/lisp/net/tls.el
+++ b/lisp/net/tls.el
@@ -174,6 +174,12 @@ Used by `tls-certificate-information'."
   :type 'string
   :group 'tls)
 
+(eval-and-compile
+  (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 +281,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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]