From: Katsumi Yamaoka Date: Tue, 1 Sep 2015 01:14:15 +0000 (-0700) Subject: Port tls.el to older Emacs X-Git-Tag: emacs-25.0.90~1230^2~6 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9004011ec0876d74209814417f939a348e107d61;p=emacs.git 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. --- diff --git a/lisp/net/tls.el b/lisp/net/tls.el index 1226916275c..46891be38e6 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))