[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 7a5f2b79e9: ; * lisp/dired.el (dired-mouse-drag): Create loca
From: |
Michael Albinus |
Subject: |
Re: master 7a5f2b79e9: ; * lisp/dired.el (dired-mouse-drag): Create local copy if file is remote. |
Date: |
Wed, 30 Mar 2022 09:38:24 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Po Lu via Mailing list for Emacs changes <emacs-diffs@gnu.org> writes:
Hi,
> ; * lisp/dired.el (dired-mouse-drag): Create local copy if file is remote.
>
> + (let ((filename (with-selected-window (posn-window
> + (event-end event))
> + (dired-file-name-at-point))))
> + (when filename
> + ;; In theory x-dnd-username combined with a proper
> + ;; file URI containing the hostname of the remote
> + ;; server could be used here instead of creating a
> + ;; local copy of the remote file, but no program
> + ;; actually implements file DND according to the
> + ;; spec.
> + (when (file-remote-p filename)
> + (setq filename (file-local-copy filename)))
> + (gui-backend-set-selection 'XdndSelection filename)
> + (x-begin-drag '("text/uri-list"
> + "text/x-dnd-username")
> + (if (eq 'dired-mouse-drag-files 'link)
> + 'XdndActionLink
> + 'XdndActionCopy)
> + nil nil t)))
Reading the code, it looks to me like you need to remove the local copy
later. Otherwise, it will trash your temp directory.
Best regards, Michael.
- Re: master 7a5f2b79e9: ; * lisp/dired.el (dired-mouse-drag): Create local copy if file is remote.,
Michael Albinus <=