From 79d585c2befb81ac5480a9577eaeb6e8915cae23 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 22 Feb 2021 16:54:59 -0500 Subject: * lisp/obsolete: Use lexical-binding Use lexical-binding in all the lisp/obsolete/*.el files. While at it, removed redundant :group arguments and used #' to quote functions. Commented out the key bindings which the #' revealed to lead to non-existing commands, and replaced those revealed to be obsolete. * lisp/obsolete/cl-compat.el: Use cl-lib. * lisp/obsolete/cust-print.el: Assume `defalias` exists. (with-custom-print): Use `declare`. * lisp/obsolete/iswitchb.el (iswitchb-init-XEmacs-trick) (iswitchb-xemacs-backspacekey): Remove functions. * lisp/obsolete/landmark.el (landmark, landmark-nslify-wts): Prefer `apply` to `eval`. * lisp/obsolete/longlines.el (longlines-mode): Don't use `add-to-list` on a hook. * lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region): Use `clear-string`. * lisp/obsolete/pgg-pgp.el (pgg-pgp-encrypt-region): Remove oddly unused var `passphrase`. (pgg-pgp-verify-region): Declare var `jam-zcat-filename-list`. * lisp/obsolete/pgg-pgp5.el (pgg-pgp5-encrypt-region): Remove oddly unused var `passphrase`. (pgg-pgp5-verify-region): Declare var `jam-zcat-filename-list`. * lisp/obsolete/pgg.el: Remove some XEmacs compatibility code. (pgg-run-at-time, pgg-cancel-timer, pgg-clear-string): Remove functions. Use their core equivalent instead. * lisp/obsolete/rcompile.el (remote-compile): Remove unused vars `l`, `l-host`, `l-user`, and `localname`. * lisp/obsolete/starttls.el (starttls-any-program-available): Use `define-obsolete-function-alias`. * lisp/obsolete/tls.el (tls-format-message): Delete function, use `format-message` instead. * lisp/obsolete/url-ns.el (url-ns-prefs): Use `with-current-buffer` and `dlet`. * lisp/obsolete/vip.el (vip-escape-to-emacs): Remove unused var `key`. (vip-command-argument, vip-read-string, ex-delete, ex-line): Remove unused var `conditions`. (ex-map): Use a closure instead of `eval`. (ex-set): Make it an alias of `set-variable`. (ex-substitute): Remove unused var `cont`. * lisp/obsolete/abbrevlist.el: * lisp/obsolete/bruce.el: * lisp/obsolete/cc-compat.el: * lisp/obsolete/cl-compat.el: * lisp/obsolete/cl.el: * lisp/obsolete/complete.el: * lisp/obsolete/crisp.el: * lisp/obsolete/cust-print.el: * lisp/obsolete/erc-compat.el: * lisp/obsolete/erc-hecomplete.el: * lisp/obsolete/eudcb-ph.el: * lisp/obsolete/fast-lock.el: * lisp/obsolete/gs.el: * lisp/obsolete/gulp.el: * lisp/obsolete/html2text.el: * lisp/obsolete/info-edit.el: * lisp/obsolete/iswitchb.el: * lisp/obsolete/landmark.el: * lisp/obsolete/lazy-lock.el: * lisp/obsolete/longlines.el: * lisp/obsolete/mailpost.el: * lisp/obsolete/mantemp.el: * lisp/obsolete/meese.el: * lisp/obsolete/messcompat.el: * lisp/obsolete/metamail.el: * lisp/obsolete/mouse-sel.el: * lisp/obsolete/nnir.el: * lisp/obsolete/old-emacs-lock.el: * lisp/obsolete/otodo-mode.el: * lisp/obsolete/patcomp.el: * lisp/obsolete/pc-mode.el: * lisp/obsolete/pc-select.el: * lisp/obsolete/pgg-def.el: * lisp/obsolete/pgg-gpg.el: * lisp/obsolete/pgg-parse.el: * lisp/obsolete/pgg-pgp.el: * lisp/obsolete/pgg-pgp5.el: * lisp/obsolete/pgg.el: * lisp/obsolete/rcompile.el: * lisp/obsolete/s-region.el: * lisp/obsolete/sb-image.el: * lisp/obsolete/sregex.el: * lisp/obsolete/starttls.el: * lisp/obsolete/sup-mouse.el: * lisp/obsolete/terminal.el: * lisp/obsolete/tls.el: * lisp/obsolete/tpu-edt.el: * lisp/obsolete/tpu-extras.el: * lisp/obsolete/tpu-mapper.el: * lisp/obsolete/url-ns.el: * lisp/obsolete/vc-arch.el: * lisp/obsolete/vi.el: * lisp/obsolete/vip.el: * lisp/obsolete/ws-mode.el: * lisp/obsolete/yow.el: Use lexical-binding. --- lisp/obsolete/tls.el | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'lisp/obsolete/tls.el') diff --git a/lisp/obsolete/tls.el b/lisp/obsolete/tls.el index 67a497f9412..5cba18d7897 100644 --- a/lisp/obsolete/tls.el +++ b/lisp/obsolete/tls.el @@ -1,4 +1,4 @@ -;;; tls.el --- TLS/SSL support via wrapper around GnuTLS +;;; tls.el --- TLS/SSL support via wrapper around GnuTLS -*- lexical-binding: t; -*- ;; Copyright (C) 1996-1999, 2002-2021 Free Software Foundation, Inc. @@ -70,8 +70,7 @@ Client data stream begins after the last character this matches. The default matches the output of \"gnutls-cli\" (version 2.0.1)." :version "22.2" - :type 'regexp - :group 'tls) + :type 'regexp) (defcustom tls-program '("gnutls-cli --x509cafile %t -p %p %h" @@ -104,22 +103,19 @@ successful negotiation." (repeat :inline t :tag "Other" (string))) (list :tag "List of commands" (repeat :tag "Command" (string)))) - :version "26.1" ; remove s_client - :group 'tls) + :version "26.1") (defcustom tls-process-connection-type nil "Value for `process-connection-type' to use when starting TLS process." :version "22.1" - :type 'boolean - :group 'tls) + :type 'boolean) (defcustom tls-success "- Handshake was completed\\|SSL handshake has read " "Regular expression indicating completed TLS handshakes. The default is what GnuTLS's \"gnutls-cli\" outputs." ;; or OpenSSL's \"openssl s_client\" :version "22.1" - :type 'regexp - :group 'tls) + :type 'regexp) (defcustom tls-checktrust nil "Indicate if certificates should be checked against trusted root certs. @@ -137,8 +133,7 @@ consider trustworthy, e.g.: :type '(choice (const :tag "Always" t) (const :tag "Never" nil) (const :tag "Ask" ask)) - :version "23.1" ;; No Gnus - :group 'tls) + :version "23.1") (defcustom tls-untrusted "- Peer's certificate is NOT trusted\\|Verify return code: \\([^0] \\|.[^ ]\\)" @@ -147,8 +142,7 @@ The default is what GnuTLS's \"gnutls-cli\" returns in the event of unsuccessful verification." ;; or OpenSSL's \"openssl s_client\" :type 'regexp - :version "23.1" ;; No Gnus - :group 'tls) + :version "23.1") (defcustom tls-hostmismatch "# The hostname in the certificate does NOT match" @@ -158,20 +152,13 @@ name of the host you are connecting to, gnutls-cli issues a warning to this effect. There is no such feature in openssl. Set this to nil if you want to ignore host name mismatches." :type 'regexp - :version "23.1" ;; No Gnus - :group 'tls) + :version "23.1") (defcustom tls-certtool-program "certtool" "Name of GnuTLS certtool. Used by `tls-certificate-information'." :version "22.1" - :type 'string - :group 'tls) - -(defalias 'tls-format-message - (if (fboundp 'format-message) 'format-message - ;; for Emacs < 25, and XEmacs, don't worry about quote translation. - 'format)) + :type 'string) (defun tls-certificate-information (der) "Parse X.509 certificate in DER format into an assoc list." @@ -272,7 +259,7 @@ 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 - (tls-format-message "\ + (format-message "\ The certificate presented by `%s' is NOT trusted. Accept anyway? " host))))) (and tls-hostmismatch (save-excursion -- cgit v1.2.3