emacs-diffs
[Top][All Lists]
Advanced

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

master c3127f5638: Improve handling of remote files during drag-and-drop


From: Po Lu
Subject: master c3127f5638: Improve handling of remote files during drag-and-drop
Date: Mon, 6 Jun 2022 07:07:16 -0400 (EDT)

branch: master
commit c3127f56387441fce09a1103324b923f55695109
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Improve handling of remote files during drag-and-drop
    
    * lisp/dnd.el (dnd-begin-drag-files): Don't fail if one remote
    file couldn't be downloaded.
---
 lisp/dnd.el | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lisp/dnd.el b/lisp/dnd.el
index 14d80ac6c5..0f65b5228d 100644
--- a/lisp/dnd.el
+++ b/lisp/dnd.el
@@ -469,9 +469,16 @@ FILES will be dragged."
       (when (file-remote-p (car tem))
         (when (eq action 'link)
           (error "Cannot create symbolic link to remote file"))
-        (setcar tem (file-local-copy (car tem)))
-        (push (car tem) dnd-last-dragged-remote-file))
+        (condition-case error
+            (progn (setcar tem (file-local-copy (car tem)))
+                   (push (car tem) dnd-last-dragged-remote-file))
+          (error (message "Failed to download file: %s" error)
+                 (setcar tem nil))))
       (setq tem (cdr tem)))
+    ;; Remove any files that failed to download from a remote host.
+    (setq new-files (delq nil new-files))
+    (unless new-files
+      (error "No files were specified or no remote file could be downloaded"))
     (unless action
       (setq action 'copy))
     (gui-set-selection 'XdndSelection



reply via email to

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