1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

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.
This commit is contained in:
Po Lu 2022-06-06 19:05:36 +08:00
parent 138d2f22f7
commit c3127f5638

View file

@ -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