* lisp/url/url-dav.el: Use lexical-binding.
(url-dav-process-DAV:prop): Remove unused var `handler-func`.
(url-dav-lock-resource): Remove unused var `child-url`.
(url-dav-active-locks): Remove unused var `properties`.
(url-dav-delete-directory): Remove unused var `props`.
(url-dav-file-name-completion): Remove unused var `result`.
* lisp/url/url-expand.el (url-expand-file-name): Use \s
* lisp/url/url-file.el (url-file): Improve regexp.
* lisp/url/url-gw.el: Use lexical-binding.
(url-open-stream): Remove unused var `cur-retries`, `retry`, `errobj`.
* lisp/url/url-imap.el: Use lexical-binding.
(imap-username, imap-password): Declare.
* lisp/url/url-mailto.el: Use lexical-binding.
(url-mailto): Remove unused var `func`. Use `push`.
* lisp/url/url-news.el: Use lexical-binding.
(url-news): Remove unused var `article-brackets`.
* lisp/url/url-cid.el:
* lisp/url/url-cache.el:
* lisp/url/url-about.el:
* lisp/url/url-tramp.el:
* lisp/url/url-proxy.el:
* lisp/url/url-privacy.el:
* lisp/url/url-nfs.el:
* lisp/url/url-ldap.el:
* lisp/url/url-misc.el:
* lisp/url/url-methods.el: Use lexical-binding.
-;;; url-about.el --- Show internal URLs
+;;; url-about.el --- Show internal URLs -*- lexical-binding: t; -*-
;; Copyright (C) 2001, 2004-2021 Free Software Foundation, Inc.
(defvar url-scheme-registry)
-(defun url-about-protocols (url)
+(defun url-about-protocols (_url)
(url-probe-protocols)
(insert "<html>\n"
" <head>\n"
"ynchronous<br>\n"
(if (url-scheme-get-property k 'default-port)
(format "Default Port: %d<br>\n"
- (url-scheme-get-property k 'default-port)) "")
+ (url-scheme-get-property k 'default-port))
+ "")
(if (assoc k url-proxy-services)
(format "Proxy: %s<br>\n" (assoc k url-proxy-services)) ""))
;; Now the description...
(insert " <td valign=top>"
(or (url-scheme-get-property k 'description) "N/A"))))
- (sort (let (x) (maphash (lambda (k v) (push k x)) url-scheme-registry) x) 'string-lessp))
+ (sort (let (x) (maphash (lambda (k _v) (push k x)) url-scheme-registry) x)
+ #'string-lessp))
(insert " </table>\n"
" </body>\n"
"</html>\n"))
-;;; url-cache.el --- Uniform Resource Locator retrieval tool
+;;; url-cache.el --- Uniform Resource Locator retrieval tool -*- lexical-binding: t; -*-
;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
-;;; url-cid.el --- Content-ID URL loader
+;;; url-cid.el --- Content-ID URL loader -*- lexical-binding: t; -*-
;; Copyright (C) 1998-1999, 2004-2021 Free Software Foundation, Inc.
-;;; url-dav.el --- WebDAV support
+;;; url-dav.el --- WebDAV support -*- lexical-binding: t; -*-
;; Copyright (C) 2001, 2004-2021 Free Software Foundation, Inc.
(node-type nil)
(props nil)
(value nil)
- (handler-func nil))
+ ;; (handler-func nil)
+ )
(when (not children)
(error "No child nodes in DAV:prop"))
" </DAV:owner>\n"))
(response nil) ; Responses to the LOCK request
(result nil) ; For walking thru the response list
- (child-url nil)
+ ;; (child-url nil)
(child-status nil)
(failures nil) ; List of failure cases (URL . STATUS)
(successes nil)) ; List of success cases (URL . STATUS)
;; status code.
(while response
(setq result (pop response)
- child-url (url-expand-file-name (pop result) url)
+ ;; child-url (url-expand-file-name (pop result) url)
child-status (or (plist-get result 'DAV:status) 500))
(if (url-dav-http-success-p child-status)
(push (list url child-status "huh") successes)
(defun url-dav-active-locks (url &optional depth)
"Return an assoc list of all active locks on URL."
(let ((response (url-dav-get-properties url '(DAV:lockdiscovery) depth))
- (properties nil)
+ ;; (properties nil)
(child nil)
(child-url nil)
(child-results nil)
If optional second argument RECURSIVE is non-nil, then delete all
files in the collection as well."
(let ((status nil)
- (props nil)
(props nil))
(setq props (url-dav-delete-something
url lock-token
(when (member 'DAV:collection (plist-get properties 'DAV:resourcetype))
t)))
-(defun url-dav-make-directory (url &optional parents)
+(defun url-dav-make-directory (url &optional _parents)
"Create the directory DIR and any nonexistent parent dirs."
(let* ((url-request-extra-headers nil)
(url-request-method "MKCOL")
If there is only one and FILE matches it exactly, returns t.
Returns nil if URL contains no name starting with FILE."
(let ((matches (url-dav-file-name-all-completions file url))
- (result nil))
+ ;; (result nil)
+ )
+ ;; FIXME: Use `try-completion'!
(cond
((null matches)
;; No matches
;; Need to nuke newlines and spaces in the URL, or we open
;; ourselves up to potential security holes.
(setq url (mapconcat (lambda (x)
- (if (memq x '(? ?\n ?\r))
+ (if (memq x '(?\s ?\n ?\r))
""
(char-to-string x)))
url "")))
;; not the compressed one.
;; FIXME should this regexp not include more extensions; basically
;; everything that url-file-find-possibly-compressed-file does?
- (setq uncompressed-filename (if (string-match "\\.\\(gz\\|Z\\|z\\)$" filename)
+ (setq uncompressed-filename (if (string-match "\\.\\(gz\\|Z\\|z\\)\\'" filename)
(substring filename 0 (match-beginning 0))
filename))
(setq content-type (mailcap-extension-to-mime
-;;; url-gw.el --- Gateway munging for URL loading
+;;; url-gw.el --- Gateway munging for URL loading -*- lexical-binding: t; -*-
;; Copyright (C) 1997-1998, 2004-2021 Free Software Foundation, Inc.
host))
'native
gwm))
- ;; An attempt to deal with denied connections, and attempt
- ;; to reconnect
- (cur-retries 0)
- (retry t)
- (errobj nil)
- (conn nil))
+ ;; An attempt to deal with denied connections, and attempt
+ ;; to reconnect
+ ;; (cur-retries 0)
+ ;; (retry t)
+ (conn nil))
;; If the user told us to do DNS for them, do it.
(if url-gateway-broken-resolution
(setq host (url-gateway-nslookup-host host)))
- (condition-case errobj
+ (condition-case nil
;; This is a clean way to ensure the new process inherits the
;; right coding systems in both Emacs and XEmacs.
(let ((coding-system-for-read 'binary)
(defconst url-http-default-port 80 "Default HTTP port.")
(defconst url-http-asynchronous-p t "HTTP retrievals are asynchronous.")
-(defalias 'url-http-expand-file-name 'url-default-expander)
+(defalias 'url-http-expand-file-name #'url-default-expander)
(defvar url-http-real-basic-auth-storage nil)
(defvar url-http-proxy-basic-auth-storage nil)
;; These routines will allow us to implement persistent HTTP
;; connections.
(defsubst url-http-debug (&rest args)
- (apply 'url-debug 'http args))
+ (apply #'url-debug 'http args))
(defun url-http-mark-connection-as-busy (host port proc)
(url-http-debug "Marking connection as busy: %s:%d %S" host port proc)
;; We got back a headerless malformed response from the
;; server.
(url-http-activate-callback))
- ((or (= url-http-response-status 204)
- (= url-http-response-status 205))
+ ((memq url-http-response-status '(204 205))
(url-http-debug "%d response must have headers only (%s)."
url-http-response-status (buffer-name))
(when (url-http-parse-headers)
(url-http-debug
"Saw HTTP/0.9 response, connection closed means end of document.")
(setq url-http-after-change-function
- 'url-http-simple-after-change-function))
+ #'url-http-simple-after-change-function))
((equal url-http-transfer-encoding "chunked")
(url-http-debug "Saw chunked encoding.")
(setq url-http-after-change-function
- 'url-http-chunked-encoding-after-change-function)
+ #'url-http-chunked-encoding-after-change-function)
(when (> nd url-http-end-of-headers)
(url-http-debug
"Calling initial chunked-encoding for extra data at end of headers")
(url-http-debug
"Got a content-length, being smart about document end.")
(setq url-http-after-change-function
- 'url-http-content-length-after-change-function)
+ #'url-http-content-length-after-change-function)
(cond
((= 0 url-http-content-length)
;; We got a NULL body! Activate the callback
(t
(url-http-debug "No content-length, being dumb.")
(setq url-http-after-change-function
- 'url-http-simple-after-change-function)))))
+ #'url-http-simple-after-change-function)))))
;; We are still at the beginning of the buffer... must just be
;; waiting for a response.
(url-http-debug "Spinning waiting for headers...")
url-http-referer referer)
(set-process-buffer connection buffer)
- (set-process-filter connection 'url-http-generic-filter)
+ (set-process-filter connection #'url-http-generic-filter)
(pcase (process-status connection)
('connect
;; Asynchronous connection
(url-type url-current-object)))
(url-https-proxy-connect connection)
(set-process-sentinel connection
- 'url-http-end-of-document-sentinel)
+ #'url-http-end-of-document-sentinel)
(process-send-string connection (url-http-create-request)))))))
buffer))
(defun url-https-proxy-connect (connection)
- (setq url-http-after-change-function 'url-https-proxy-after-change-function)
+ (setq url-http-after-change-function #'url-https-proxy-after-change-function)
(process-send-string
connection
(format
(with-current-buffer process-buffer (erase-buffer))
(set-process-buffer tls-connection process-buffer)
(setq url-http-after-change-function
- 'url-http-wait-for-headers-change-function)
+ #'url-http-wait-for-headers-change-function)
(set-process-filter tls-connection 'url-http-generic-filter)
(process-send-string tls-connection
(url-http-create-request)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defalias 'url-http-symbol-value-in-buffer
(if (fboundp 'symbol-value-in-buffer)
- 'symbol-value-in-buffer
+ #'symbol-value-in-buffer
(lambda (symbol buffer &optional unbound-value)
"Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound."
(with-current-buffer buffer
-;;; url-imap.el --- IMAP retrieval routines
+;;; url-imap.el --- IMAP retrieval routines -*- lexical-binding: t; -*-
;; Copyright (C) 1999, 2004-2021 Free Software Foundation, Inc.
(defconst url-imap-default-port 143 "Default IMAP port.")
+(defvar imap-username)
+(defvar imap-password)
+
(defun url-imap-open-host (host port user pass)
;; xxx use user and password
(if (fboundp 'nnheader-init-server-buffer)
-;;; url-ldap.el --- LDAP Uniform Resource Locator retrieval code
+;;; url-ldap.el --- LDAP Uniform Resource Locator retrieval code -*- lexical-binding: t; -*-
;; Copyright (C) 1998-1999, 2004-2021 Free Software Foundation, Inc.
-;;; url-mail.el --- Mail Uniform Resource Locator retrieval code
+;;; url-mail.el --- Mail Uniform Resource Locator retrieval code -*- lexical-binding: t; -*-
;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
;; mailto:wmperry@gnu.org
(setf (url-filename url) (concat (url-user url) "@" (url-filename url))))
(setq url (url-filename url))
- (let (to args source-url subject func headers-start)
+ (let (to args source-url subject headers-start) ;; func
(if (string-match (regexp-quote "?") url)
(setq headers-start (match-end 0)
to (url-unhex-string (substring url 0 (match-beginning 0)))
(setq to (url-unhex-string url)))
(setq source-url (url-view-url t))
(if (and url-request-data (not (assoc "subject" args)))
- (setq args (cons (list "subject"
+ (push (list "subject"
(concat "Automatic submission from "
url-package-name "/"
- url-package-version)) args)))
+ url-package-version))
+ args))
(if (and source-url (not (assoc "x-url-from" args)))
(setq args (cons (list "x-url-from" source-url) args)))
(replace-regexp-in-string "\r\n" "\n" string))
(cdar args) "\n")))
(url-mail-goto-field (caar args))
- (setq func (intern-soft (concat "mail-" (caar args))))
+ ;; (setq func (intern-soft (concat "mail-" (caar args))))
(insert (mapconcat 'identity (cdar args) ", ")))
(setq args (cdr args)))
;; (url-mail-goto-field "User-Agent")
-;;; url-methods.el --- Load URL schemes as needed
+;;; url-methods.el --- Load URL schemes as needed -*- lexical-binding: t; -*-
;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
'file-exists-p 'ignore
'file-attributes 'ignore))
-(defun url-scheme-default-loader (url &optional callback cbargs)
+(defun url-scheme-default-loader (url &optional _callback _cbargs)
"Signal an error for an unknown URL scheme."
(error "Unknown URL scheme: %s" (url-type url)))
-;;; url-misc.el --- Misc Uniform Resource Locator retrieval code
+;;; url-misc.el --- Misc Uniform Resource Locator retrieval code -*- lexical-binding: t; -*-
;; Copyright (C) 1996-1999, 2002, 2004-2021 Free Software Foundation,
;; Inc.
-;;; url-news.el --- News Uniform Resource Locator retrieval code
+;;; url-news.el --- News Uniform Resource Locator retrieval code -*- lexical-binding: t; -*-
;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
;; Find a news reference
(let* ((host (or (url-host url) url-news-server))
(port (url-port url))
- (article-brackets nil)
+ ;; (article-brackets nil)
(buf nil)
(article (url-unhex-string (url-filename url))))
(url-news-open-host host port (url-user url) (url-password url))
-;;; url-nfs.el --- NFS URL interface
+;;; url-nfs.el --- NFS URL interface -*- lexical-binding: t; -*-
;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
-;;; url-privacy.el --- Global history tracking for URL package
+;;; url-privacy.el --- Global history tracking for URL package -*- lexical-binding: t; -*-
;; Copyright (C) 1996-1999, 2004-2021 Free Software Foundation, Inc.
(require 'url-vars)
-(defun url-device-type (&optional device)
+(defun url-device-type (&optional _device)
(declare (obsolete nil "27.1"))
(or window-system 'tty))
-;;; url-proxy.el --- Proxy server support
+;;; url-proxy.el --- Proxy server support -*- lexical-binding: t; -*-
;; Copyright (C) 1999, 2004-2021 Free Software Foundation, Inc.
-;;; url-tramp.el --- file-name-handler magic invoking Tramp for some protocols
+;;; url-tramp.el --- file-name-handler magic invoking Tramp for some protocols -*- lexical-binding: t; -*-
;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
the server.
If URL is a multibyte string, it will be encoded as utf-8 and
URL-encoded before it's used."
-;;; XXX: There is code in Emacs that does dynamic binding
-;;; of the following variables around url-retrieve:
-;;; url-standalone-mode, url-gateway-unplugged, w3-honor-stylesheets,
-;;; url-confirmation-func, url-cookie-multiple-line,
-;;; url-cookie-{{,secure-}storage,confirmation}
-;;; url-standalone-mode and url-gateway-unplugged should work as
-;;; usual. url-confirmation-func is only used in nnwarchive.el and
-;;; webmail.el; the latter should be updated. Is
-;;; url-cookie-multiple-line needed anymore? The other url-cookie-*
-;;; are (for now) only used in synchronous retrievals.
+ ;; XXX: There is code in Emacs that does dynamic binding
+ ;; of the following variables around url-retrieve:
+ ;; url-standalone-mode, url-gateway-unplugged, w3-honor-stylesheets,
+ ;; url-confirmation-func, url-cookie-multiple-line,
+ ;; url-cookie-{{,secure-}storage,confirmation}
+ ;; url-standalone-mode and url-gateway-unplugged should work as
+ ;; usual. url-confirmation-func is only used in nnwarchive.el and
+ ;; webmail.el; the latter should be updated. Is
+ ;; url-cookie-multiple-line needed anymore? The other url-cookie-*
+ ;; are (for now) only used in synchronous retrievals.
(url-retrieve-internal url callback (cons nil cbargs) silent
inhibit-cookies))
(asynch (url-scheme-get-property (url-type url) 'asynchronous-p)))
(if url-using-proxy
(setq asynch t
- loader 'url-proxy))
+ loader #'url-proxy))
(if asynch
(let ((url-current-object url))
(setq buffer (funcall loader url callback cbargs)))