]> git.eshelyaron.com Git - emacs.git/commitdiff
Further fixes for eww-open-url on Tramp files
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 20 Feb 2022 21:36:46 +0000 (22:36 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 20 Feb 2022 21:37:04 +0000 (22:37 +0100)
* lisp/url/url-file.el (url-file-asynch-callback): Simplify
slightly (bug#40425).
* lisp/url/url-queue.el (url-queue-start-retrieve): Allow
non-local files here, too.

lisp/url/url-file.el
lisp/url/url-queue.el

index 60a79425a3f078ef399089a9eba9a410d75dd34e..3863ac9914476ee5ad7a389ec45efffd437a3439 100644 (file)
@@ -76,18 +76,15 @@ to them."
            buff func
            func args
            args efs))
-  (let ((size (file-attribute-size (file-attributes name))))
-    (with-current-buffer buff
-      (goto-char (point-max))
-      (if (/= -1 size)
-         (insert (format "Content-length: %d\n" size)))
-      (insert "\n")
-      (insert-file-contents-literally name)
-      (if (not (url-file-host-is-local-p (url-host url-current-object)))
-         (condition-case ()
-             (delete-file name)
-           (error nil)))
-      (apply func args))))
+  (with-current-buffer buff
+    (goto-char (point-max))
+    (insert-file-contents-literally name)
+    (insert (format "Content-length: %d\n\n" (buffer-size)))
+    (if (not (url-file-host-is-local-p (url-host url-current-object)))
+       (condition-case ()
+           (delete-file name)
+         (error nil)))
+    (apply func args)))
 
 (declare-function ange-ftp-set-passwd "ange-ftp" (host user passwd))
 (declare-function ange-ftp-copy-file-internal "ange-ftp"
index d353f0c01179d61dd24de2a2e5c165d6e285f51f..152300bda55a67e6842e17c2af222b13088d1d9c 100644 (file)
@@ -31,6 +31,7 @@
 (eval-when-compile (require 'cl-lib))
 (require 'browse-url)
 (require 'url-parse)
+(require 'url-file)
 
 (defcustom url-queue-parallel-processes 6
   "The number of concurrent processes."
@@ -160,6 +161,7 @@ The variable `url-queue-timeout' sets a timeout."
                                    (url-queue-context-buffer job)
                                  (current-buffer))
            (let ((url-request-noninteractive t)
+                  (url-allow-non-local-files t)
                   ;; This will disable querying the user for
                   ;; credentials if one of the things we're fetching
                   ;; in the background return a header requesting it.