emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0b755ee695: Further fixes for eww-open-url on Tramp files


From: Lars Ingebrigtsen
Subject: master 0b755ee695: Further fixes for eww-open-url on Tramp files
Date: Sun, 20 Feb 2022 16:37:10 -0500 (EST)

branch: master
commit 0b755ee6951147f40fdf0b6ff4b78835f4e54bf9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Further fixes for eww-open-url on Tramp files
    
    * 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  | 21 +++++++++------------
 lisp/url/url-queue.el |  2 ++
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el
index 60a79425a3..3863ac9914 100644
--- a/lisp/url/url-file.el
+++ b/lisp/url/url-file.el
@@ -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"
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index d353f0c011..152300bda5 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]