GNU bug report logs - #13187
24.2; lisp/url/url-http.el

Previous Next

Package: emacs;

Reported by: Devon Sean McCullough <Emacs-Hacker2012 <at> jovi.net>

Date: Sat, 15 Dec 2012 03:44:01 UTC

Severity: minor

Tags: fixed

Found in version 24.2

Fixed in version 25.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13187 in the body.
You can then email your comments to 13187 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13187; Package emacs. (Sat, 15 Dec 2012 03:44:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Devon Sean McCullough <Emacs-Hacker2012 <at> jovi.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 15 Dec 2012 03:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Devon Sean McCullough <Emacs-Hacker2012 <at> jovi.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2; lisp/url/url-http.el
Date: Fri, 14 Dec 2012 22:41:54 -0500
* url-http documentation string omits essential info.
* url-https source cannot be found by Help nor etags.
* url-https definition cannot be found by text search
	as it omits the defined and defining function names.
Here's a fix:

--- url-http.el.~1~	2012-08-23 01:33:42.000000000 -0400
+++ url-http.el	2012-12-14 21:28:51.000000000 -0500
@@ -1177,10 +1177,12 @@
   "Retrieve URL via HTTP asynchronously.
 URL must be a parsed URL.  See `url-generic-parse-url' for details.
 When retrieval is completed, the function CALLBACK is executed with
-CBARGS as the arguments.
+CBARGS as the arguments and the retrieval buffer as current.
 
 Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a
-previous `url-http' call, which is being re-attempted."
+previous `url-http' call, which is being re-attempted.
+
+Return the retrieval buffer."
   (check-type url vector "Need a pre-parsed URL.")
   (declare (special url-current-object
 		    url-http-end-of-headers
@@ -1213,45 +1215,27 @@
 	(mm-disable-multibyte)
 	(setq url-current-object url
 	      mode-line-format "%b [%s]")
-
-	(dolist (var '(url-http-end-of-headers
-		       url-http-content-type
-		       url-http-content-length
-		       url-http-transfer-encoding
-		       url-http-after-change-function
-		       url-http-response-version
-		       url-http-response-status
-		       url-http-chunked-length
-		       url-http-chunked-counter
-		       url-http-chunked-start
-		       url-callback-function
-		       url-callback-arguments
-		       url-show-status
-		       url-http-process
-		       url-http-method
-		       url-http-extra-headers
-		       url-http-data
-		       url-http-target-url
-		       url-http-no-retry
-		       url-http-connection-opened
-		       url-http-proxy))
-	  (set (make-local-variable var) nil))
-
-	(setq url-http-method (or url-request-method "GET")
-	      url-http-extra-headers url-request-extra-headers
-	      url-http-data url-request-data
-	      url-http-process connection
-	      url-http-chunked-length nil
-	      url-http-chunked-start nil
-	      url-http-chunked-counter 0
-	      url-callback-function callback
-	      url-callback-arguments cbargs
-	      url-http-after-change-function 'url-http-wait-for-headers-change-function
-	      url-http-target-url url-current-object
-	      url-http-no-retry retry-buffer
-	      url-http-connection-opened nil
-	      url-http-proxy url-using-proxy)
-
+	(set (make-local-variable 'url-http-method) (or url-request-method "GET"))
+	(set (make-local-variable 'url-http-extra-headers) url-request-extra-headers)
+	(set (make-local-variable 'url-http-data) url-request-data)
+	(set (make-local-variable 'url-http-process) connection)
+	(set (make-local-variable 'url-http-chunked-length) nil)
+	(set (make-local-variable 'url-http-chunked-start) nil)
+	(set (make-local-variable 'url-http-chunked-counter) 0)
+	(set (make-local-variable 'url-callback-function) callback)
+	(set (make-local-variable 'url-callback-arguments) cbargs)
+	(set (make-local-variable 'url-http-after-change-function) 'url-http-wait-for-headers-change-function)
+	(set (make-local-variable 'url-http-target-url) url-current-object)
+	(set (make-local-variable 'url-http-no-retry) retry-buffer)
+	(set (make-local-variable 'url-http-connection-opened) nil)
+	(set (make-local-variable 'url-http-proxy) url-using-proxy)
+	(set (make-local-variable 'url-http-content-length) ())
+	(set (make-local-variable 'url-http-content-type) ())
+	(set (make-local-variable 'url-http-end-of-headers) ())
+	(set (make-local-variable 'url-http-response-status) ())
+	(set (make-local-variable 'url-http-response-version) ())
+	(set (make-local-variable 'url-http-transfer-encoding) ())
+	(set (make-local-variable 'url-show-status) ())
 	(set-process-buffer connection buffer)
 	(set-process-filter connection 'url-http-generic-filter)
 	(let ((status (process-status connection)))
@@ -1465,21 +1449,25 @@
 ;;;###autoload
 (defalias 'url-https-expand-file-name 'url-default-expander)
 
-(defmacro url-https-create-secure-wrapper (method args)
-  `(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args
-    ,(format "HTTPS wrapper around `%s' call." (or method "url-http"))
+(defmacro define-url-https-secure-wrapper (name insecure-name)
+  (let* ((arglist (progn (require 'help-fns)
+			 (help-function-arglist insecure-name 'preserve-names)))
+	 (arguments (remove '&rest
+			    (remove '&optional
+				    arglist))))
+  `(defun ,name ,arglist
+    ,(format "Https wrapper around `%s' call." insecure-name)
     (let ((url-gateway-method 'tls))
-      (,(intern (format (if method "url-http-%s" "url-http") method))
-       ,@(remove '&rest (remove '&optional args))))))
+      (,insecure-name .,arguments)))))
 
 ;;;###autoload (autoload 'url-https "url-http")
-(url-https-create-secure-wrapper nil (url callback cbargs))
+(define-url-https-secure-wrapper url-https url-http)
 ;;;###autoload (autoload 'url-https-file-exists-p "url-http")
-(url-https-create-secure-wrapper file-exists-p (url))
+(define-url-https-secure-wrapper url-https-file-exists-p url-http-file-exists-p)
 ;;;###autoload (autoload 'url-https-file-readable-p "url-http")
-(url-https-create-secure-wrapper file-readable-p (url))
+(define-url-https-secure-wrapper url-https-file-readable-p url-http-file-readable-p)
 ;;;###autoload (autoload 'url-https-file-attributes "url-http")
-(url-https-create-secure-wrapper file-attributes (url &optional id-format))
+(define-url-https-secure-wrapper url-https-file-attributes url-http-file-attributes)
 
 (provide 'url-http)
 



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13187; Package emacs. (Fri, 25 Dec 2015 21:22:01 GMT) Full text and rfc822 format available.

Message #8 received at 13187 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Devon Sean McCullough <Emacs-Hacker2012 <at> jovi.net>
Cc: 13187 <at> debbugs.gnu.org
Subject: Re: bug#13187: 24.2; lisp/url/url-http.el
Date: Fri, 25 Dec 2015 22:20:44 +0100
Devon Sean McCullough <Emacs-Hacker2012 <at> jovi.net> writes:

> * url-http documentation string omits essential info.

I've applied your patch to the doc string (with some changes) to the
Emacs trunk.

> * url-https source cannot be found by Help nor etags.
> * url-https definition cannot be found by text search
> 	as it omits the defined and defining function names.
> Here's a fix:

That's true, but I'm not sure that's really worth fixing...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 25 Dec 2015 21:22:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.2, send any further explanations to 13187 <at> debbugs.gnu.org and Devon Sean McCullough <Emacs-Hacker2012 <at> jovi.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 25 Dec 2015 21:22:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 23 Jan 2016 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 154 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.