diff options
| author | Stefan Monnier | 2016-05-23 20:09:33 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2016-05-23 20:09:33 -0400 |
| commit | 276a6545ad48d6c2ffcf17929f896e6a964d993f (patch) | |
| tree | 0531a840cb4478d573581fb07f352d1348325f6a | |
| parent | 41214582455a6ad08098df14a5febd769622aab4 (diff) | |
| download | emacs-276a6545ad48d6c2ffcf17929f896e6a964d993f.tar.gz emacs-276a6545ad48d6c2ffcf17929f896e6a964d993f.zip | |
* lisp/url/url-http.el: Use lexical-binding
(url-http-simple-after-change-function): Use buffer-size rather than `nd'.
(url-http-wait-for-headers-change-function): Remove unused var
`content-length'.
(url-http): Remove unused vars `host' and `port'.
| -rw-r--r-- | lisp/url/url-http.el | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index 88a11f33c67..306b36ae951 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; url-http.el --- HTTP retrieval routines | 1 | ;;; url-http.el --- HTTP retrieval routines -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1999, 2001, 2004-2016 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1999, 2001, 2004-2016 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -931,7 +931,7 @@ should be shown to the user." | |||
| 931 | ;; ) | 931 | ;; ) |
| 932 | 932 | ||
| 933 | ;; These unfortunately cannot be macros... please ignore them! | 933 | ;; These unfortunately cannot be macros... please ignore them! |
| 934 | (defun url-http-idle-sentinel (proc why) | 934 | (defun url-http-idle-sentinel (proc _why) |
| 935 | "Remove (now defunct) process PROC from the list of open connections." | 935 | "Remove (now defunct) process PROC from the list of open connections." |
| 936 | (maphash (lambda (key val) | 936 | (maphash (lambda (key val) |
| 937 | (if (memq proc val) | 937 | (if (memq proc val) |
| @@ -969,12 +969,12 @@ should be shown to the user." | |||
| 969 | ((url-http-parse-headers) | 969 | ((url-http-parse-headers) |
| 970 | (url-http-activate-callback)))))) | 970 | (url-http-activate-callback)))))) |
| 971 | 971 | ||
| 972 | (defun url-http-simple-after-change-function (st nd length) | 972 | (defun url-http-simple-after-change-function (_st _nd _length) |
| 973 | ;; Function used when we do NOT know how long the document is going to be | 973 | ;; Function used when we do NOT know how long the document is going to be |
| 974 | ;; Just _very_ simple 'downloaded %d' type of info. | 974 | ;; Just _very_ simple 'downloaded %d' type of info. |
| 975 | (url-lazy-message "Reading %s..." (file-size-human-readable nd))) | 975 | (url-lazy-message "Reading %s..." (file-size-human-readable (buffer-size)))) |
| 976 | 976 | ||
| 977 | (defun url-http-content-length-after-change-function (st nd length) | 977 | (defun url-http-content-length-after-change-function (_st nd _length) |
| 978 | "Function used when we DO know how long the document is going to be. | 978 | "Function used when we DO know how long the document is going to be. |
| 979 | More sophisticated percentage downloaded, etc. | 979 | More sophisticated percentage downloaded, etc. |
| 980 | Also does minimal parsing of HTTP headers and will actually cause | 980 | Also does minimal parsing of HTTP headers and will actually cause |
| @@ -1093,7 +1093,7 @@ the end of the document." | |||
| 1093 | (if (url-http-parse-headers) | 1093 | (if (url-http-parse-headers) |
| 1094 | (url-http-activate-callback)))))))))) | 1094 | (url-http-activate-callback)))))))))) |
| 1095 | 1095 | ||
| 1096 | (defun url-http-wait-for-headers-change-function (st nd length) | 1096 | (defun url-http-wait-for-headers-change-function (_st nd _length) |
| 1097 | ;; This will wait for the headers to arrive and then splice in the | 1097 | ;; This will wait for the headers to arrive and then splice in the |
| 1098 | ;; next appropriate after-change-function, etc. | 1098 | ;; next appropriate after-change-function, etc. |
| 1099 | (url-http-debug "url-http-wait-for-headers-change-function (%s)" | 1099 | (url-http-debug "url-http-wait-for-headers-change-function (%s)" |
| @@ -1101,7 +1101,8 @@ the end of the document." | |||
| 1101 | (let ((end-of-headers nil) | 1101 | (let ((end-of-headers nil) |
| 1102 | (old-http nil) | 1102 | (old-http nil) |
| 1103 | (process-buffer (current-buffer)) | 1103 | (process-buffer (current-buffer)) |
| 1104 | (content-length nil)) | 1104 | ;; (content-length nil) |
| 1105 | ) | ||
| 1105 | (when (not (bobp)) | 1106 | (when (not (bobp)) |
| 1106 | (goto-char (point-min)) | 1107 | (goto-char (point-min)) |
| 1107 | (if (and (looking-at ".*\n") ; have one line at least | 1108 | (if (and (looking-at ".*\n") ; have one line at least |
| @@ -1242,8 +1243,8 @@ overriding the value of `url-gateway-method'. | |||
| 1242 | 1243 | ||
| 1243 | The return value of this function is the retrieval buffer." | 1244 | The return value of this function is the retrieval buffer." |
| 1244 | (cl-check-type url vector "Need a pre-parsed URL.") | 1245 | (cl-check-type url vector "Need a pre-parsed URL.") |
| 1245 | (let* ((host (url-host (or url-using-proxy url))) | 1246 | (let* (;; (host (url-host (or url-using-proxy url))) |
| 1246 | (port (url-port (or url-using-proxy url))) | 1247 | ;; (port (url-port (or url-using-proxy url))) |
| 1247 | (nsm-noninteractive (or url-request-noninteractive | 1248 | (nsm-noninteractive (or url-request-noninteractive |
| 1248 | (and (boundp 'url-http-noninteractive) | 1249 | (and (boundp 'url-http-noninteractive) |
| 1249 | url-http-noninteractive))) | 1250 | url-http-noninteractive))) |
| @@ -1337,7 +1338,7 @@ The return value of this function is the retrieval buffer." | |||
| 1337 | url-https-default-port) | 1338 | url-https-default-port) |
| 1338 | (url-host url-current-object)))) | 1339 | (url-host url-current-object)))) |
| 1339 | 1340 | ||
| 1340 | (defun url-https-proxy-after-change-function (st nd length) | 1341 | (defun url-https-proxy-after-change-function (_st _nd _length) |
| 1341 | (let* ((process-buffer (current-buffer)) | 1342 | (let* ((process-buffer (current-buffer)) |
| 1342 | (proc (get-buffer-process process-buffer))) | 1343 | (proc (get-buffer-process process-buffer))) |
| 1343 | (goto-char (point-min)) | 1344 | (goto-char (point-min)) |
| @@ -1461,7 +1462,7 @@ The return value of this function is the retrieval buffer." | |||
| 1461 | 1462 | ||
| 1462 | (defalias 'url-http-file-readable-p 'url-http-file-exists-p) | 1463 | (defalias 'url-http-file-readable-p 'url-http-file-exists-p) |
| 1463 | 1464 | ||
| 1464 | (defun url-http-head-file-attributes (url &optional id-format) | 1465 | (defun url-http-head-file-attributes (url &optional _id-format) |
| 1465 | (let ((buffer (url-http-head url))) | 1466 | (let ((buffer (url-http-head url))) |
| 1466 | (when buffer | 1467 | (when buffer |
| 1467 | (prog1 | 1468 | (prog1 |
| @@ -1476,7 +1477,7 @@ The return value of this function is the retrieval buffer." | |||
| 1476 | nil nil nil) ;whether gid would change ; inode ; device. | 1477 | nil nil nil) ;whether gid would change ; inode ; device. |
| 1477 | (kill-buffer buffer))))) | 1478 | (kill-buffer buffer))))) |
| 1478 | 1479 | ||
| 1479 | (declare-function url-dav-file-attributes "url-dav" (url &optional id-format)) | 1480 | (declare-function url-dav-file-attributes "url-dav" (url &optional _id-format)) |
| 1480 | 1481 | ||
| 1481 | (defun url-http-file-attributes (url &optional id-format) | 1482 | (defun url-http-file-attributes (url &optional id-format) |
| 1482 | (if (url-dav-supported-p url) | 1483 | (if (url-dav-supported-p url) |