unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: emacs-devel@gnu.org
Cc: Po Lu <luangruo@yahoo.com>
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	[thread overview]
Message-ID: <87mth799fz.fsf@gmx.de> (raw)
In-Reply-To: <20220330062106.D045CC01684@vcs2.savannah.gnu.org> (Po Lu via Mailing list for Emacs changes's message of "Wed, 30 Mar 2022 02:21:06 -0400 (EDT)")

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.



       reply	other threads:[~2022-03-30  7:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <164862126656.8211.8114609736677843326@vcs2.savannah.gnu.org>
     [not found] ` <20220330062106.D045CC01684@vcs2.savannah.gnu.org>
2022-03-30  7:38   ` Michael Albinus [this message]
2022-03-30  7:49     ` master 7a5f2b79e9: ; * lisp/dired.el (dired-mouse-drag): Create local copy if file is remote Po Lu
2022-03-30  8:01       ` Michael Albinus
2022-03-30  8:28         ` Po Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mth799fz.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).