all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: "Daniel Martín" <mardani29@yahoo.es>
Cc: "Paul Magwene, Ph.D." <paul.magwene@duke.edu>, 43470@debbugs.gnu.org
Subject: bug#43470: 27.1; Drag and Drop not working properly in 27.1 on OSX
Date: Sun, 27 Sep 2020 10:59:32 +0100	[thread overview]
Message-ID: <20200927095932.GH28875@breton.holly.idiocy.org> (raw)
In-Reply-To: <m1ft74g42w.fsf@yahoo.es>

[-- Attachment #1: Type: text/plain, Size: 1322 bytes --]

On Sat, Sep 26, 2020 at 01:39:03PM +0200, Daniel Martín wrote:
> Alan Third <alan@idiocy.org> writes:
> >
> > The big decision is what should Emacs do by default? My opinion is
> > that when receiving a URL we should insert the link as text rather
> > than try to open it: Emacs isn't a web browser. Perhaps that's wrong,
> > I'm not sure what Emacs does on other platforms.
> 
> I've tested on GNU/Linux (Emacs 27.1 and Emacs 24) and the behavior is
> that dragging an dropping a URL from Firefox opens the web page source,
> just like Emacs 26 on macOS. The GNU/Linux version does not seem to
> support overriding the destination action with Ctrl, Shift, etc.

I've been fiddling with this more and I've realised that (at least on
my machine today) Chrome and Safari never actually send the URLs as
NSPasteboardTypeURL, they just send them as plain text.

I suspect this means that if we want to support the NS drag and drop
process correctly (and I think we do) then we really need to look into
a larger rewrite, unfortunately. And any larger rewrite will need to
wait for Emacs 28, I think.

In the meantime I suppose the simplest work-around is something like
the attached, which is near enough the same as what you did, Daniel,
but making explicit that "copy" and "generic" are doing the same
thing.

-- 
Alan Third

[-- Attachment #2: 0001-Make-drag-and-drop-on-NS-open-all-URLs-bug-43470.patch --]
[-- Type: text/plain, Size: 1638 bytes --]

From 908a5fade4afc77467ef61b771c4e3c46c8cd798 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sun, 27 Sep 2020 10:55:32 +0100
Subject: [PATCH] Make drag and drop on NS open all URLs (bug#43470)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/term/ns-win.el (ns-drag-n-drop): Merge generic and copy
actions.

Co-authored-by: Daniel Martín <mardani29@yahoo.es>
---
 lisp/term/ns-win.el | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 90024b001f..184271d9e6 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -513,15 +513,9 @@ ns-drag-n-drop
     (set-frame-selected-window nil window)
     (raise-frame)
     (setq window (selected-window))
-    (cond ((memq 'ns-drag-operation-generic operations)
-           ;; Perform the default action for the type.
-           (if (eq type 'file)
-               (dolist (data objects)
-                 (dnd-handle-one-url window 'private (concat "file:" data)))
-             (dnd-insert-text window 'private string)))
-          ((memq 'ns-drag-operation-copy operations)
-           ;; Try to open the file/URL.  If type is nil, try to open
-           ;; it as a URL anyway.
+    (cond ((or (memq 'ns-drag-operation-generic operations)
+               (memq 'ns-drag-operation-copy operations))
+           ;; Perform the default/copy action.
            (dolist (data objects)
              (dnd-handle-one-url window 'private (if (eq type 'file)
                                                      (concat "file:" data)
-- 
2.26.1


  reply	other threads:[~2020-09-27  9:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 13:27 bug#43470: 27.1; Drag and Drop not working properly in 27.1 on OSX Paul Magwene, Ph.D.
2020-09-17 17:46 ` Alan Third
2020-09-17 18:12   ` Unknown
2020-09-17 19:46     ` Alan Third
2020-09-18 12:00       ` Unknown
2020-09-18 12:54         ` Alan Third
2020-09-18 18:34           ` Unknown
2020-09-18 19:11             ` Alan Third
2020-09-18 21:27               ` Paul Magwene
2020-09-18 22:15                 ` Alan Third
2020-09-18 23:22                   ` Paul Magwene, Ph.D.
2020-09-19 11:02                     ` Unknown
2020-09-19 12:45                     ` Unknown
2020-09-22 12:24                       ` Alan Third
2020-09-26 11:39                         ` Unknown
2020-09-27  9:59                           ` Alan Third [this message]
2020-09-27 22:22                             ` Unknown
2020-10-03 14:43                               ` Alan Third
2020-09-26 11:39                         ` Unknown
2020-09-19 14:08                     ` Alan Third

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

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

  git send-email \
    --in-reply-to=20200927095932.GH28875@breton.holly.idiocy.org \
    --to=alan@idiocy.org \
    --cc=43470@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    --cc=paul.magwene@duke.edu \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.