From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#30929: 26.0.91; Text drag and drop does not work Date: Sat, 7 Apr 2018 16:01:19 +0100 Message-ID: <20180407150119.GA1190@breton.holly.idiocy.org> References: <20180325115732.GA52626@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1523113215 7289 195.159.176.226 (7 Apr 2018 15:00:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 7 Apr 2018 15:00:15 +0000 (UTC) User-Agent: Mutt/1.9.3 (2018-01-21) Cc: 30929@debbugs.gnu.org To: Nick Helm Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 07 17:00:10 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4pK3-0001ia-7H for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Apr 2018 17:00:07 +0200 Original-Received: from localhost ([::1]:33742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4pM8-0002Ga-S8 for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Apr 2018 11:02:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4pLy-0002FT-16 for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 11:02:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4pLu-0007zM-Uy for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 11:02:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33417) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f4pLu-0007zD-R4 for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 11:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f4pLu-00005u-8g for bug-gnu-emacs@gnu.org; Sat, 07 Apr 2018 11:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Apr 2018 15:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30929 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30929-submit@debbugs.gnu.org id=B30929.1523113291321 (code B ref 30929); Sat, 07 Apr 2018 15:02:02 +0000 Original-Received: (at 30929) by debbugs.gnu.org; 7 Apr 2018 15:01:31 +0000 Original-Received: from localhost ([127.0.0.1]:41314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4pLP-000051-JM for submit@debbugs.gnu.org; Sat, 07 Apr 2018 11:01:31 -0400 Original-Received: from mail-wr0-f171.google.com ([209.85.128.171]:39953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f4pLN-0008WS-L5 for 30929@debbugs.gnu.org; Sat, 07 Apr 2018 11:01:30 -0400 Original-Received: by mail-wr0-f171.google.com with SMTP id n2so4102921wrj.7 for <30929@debbugs.gnu.org>; Sat, 07 Apr 2018 08:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=z6B0PJPNyoBzn/fSjCfKB/eo1uS7XT3JpM2o0KoiQI8=; b=ntgSHEvXQAYsvlRKsopFg2/J6ThJzYdVMt+fk+bfke46UNvrss9K9BNcYORVTLBJmT psFD2996cX3LAis2R4NYrd42RQCPfd7o2jpusRB/jkva72aoS6+XdiICgc+BmJjFZ3Yw 4Au+bhl1FapiF4z5Z0z04dwAUOhdAkqRGoiK/obhJnL2tbcRpXcALtOUXg7U1S6nd6e5 cqptCe3KGx2if2ESA1+7J/iD99VwQOHW/lL5glQma4+MwxjDOkufHtSCLwPcZDHwVnXE GqtsSgnD6Ov5DuawCdrduKNcJGojVKkqQHZM8c3Go+vwHPGXtkUVgyUEyv68Ivt6ZrB9 tCEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=z6B0PJPNyoBzn/fSjCfKB/eo1uS7XT3JpM2o0KoiQI8=; b=FlbzFjh5AzWTc7Jsta+FHxJ33RvCDli3jKE+GUbSrzq1TLymmmF06hLHrO064i3tKx GiX9kn2xuwMKiI/FpEwyrcdwPJouaX+alhfBqZKIu01iWIXxwa19xOBqq7yyMO5nMTpg ywsY+rFYnSzBZgQeXyXRUOHvoX4pm8Jt/OT9EAfsgCXAN+bMCFaAnGpQAKE1vinQ7QXS wui9F5DpV/igUZ6I2ngsyafKEBSrtcl1AXPLrQXpr+MZkE56fWML4mow7XI8XAwwBYaT Uq4T4Tf3z+nW4OIikwfnaAD+fYlOo2t7ADSya29hv9VCapHewhL2UnMIpLDxnYssjocX vwtg== X-Gm-Message-State: AElRT7EJGSIcs1olOVqW+ercBx/QJe5WUFZ3tQHtDSJSzs9PL6QJh8hE e8oeCUiVQLQEEFjjOuoj4WXYQtOA X-Google-Smtp-Source: AIpwx49VBCK75H5hb6U1E5gNNrAtj8Gs0lNmvvRIUfy5QEVNSrBQkxYp/qJd2GxZWehAhQEgQIoVgg== X-Received: by 10.223.131.229 with SMTP id 92mr23104123wre.249.1523113283622; Sat, 07 Apr 2018 08:01:23 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-60c2-1a84-b7b0-dd5f.holly.idiocy.org. [2001:8b0:3f8:8129:60c2:1a84:b7b0:dd5f]) by smtp.gmail.com with ESMTPSA id k11sm16065715wmi.35.2018.04.07.08.01.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Apr 2018 08:01:22 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144967 Archived-At: On Wed, Mar 28, 2018 at 10:20:13PM +1300, Nick Helm wrote: > > It’s setting the actual modifier keys, so when a user changes those > > keys’ settings this breaks. > > > > You can also set these flags by using the actual modifier keys. > > > > This looks like it matches up with what Apple expect you to do, but it > > doesn’t seem to match up with Emacs’s event handling very well. > > That looks about right to me too, it least it matches the general > approach in the docs. > > I had a go at mapping the hardware modifiers to Emacs events (and > existing bindings) for each drag type and DragOperation mask. Patch > attached. This doesn't support the ns-right-*-modifiers yet, but they > should be pretty easy to add if you want to go this way. Except we have no way of identifying whether the left or right modifier has been pressed. I’ve been thinking about this and I’m not entirely sure it’s a good idea to expose these modifier presses to Emacs. At least not by default. I have two reasons for avoiding this: 1. They’re not always modifier presses. Applications set these flags themselves and it seems strange to me that it can look like a modifier has been pressed when the user has done no such thing. 2. It’s so very easy to break the bindings by rebinding the modifiers, which is often recommended for people using non‐US keyboards. ns-drag-n-drop is perfectly capable of determining what action to take by examining what it’s been passed in the event. So I think that if we receive, for example, a filename and only NSDragOperationLink is set then we should mark the filename as a string and then send the event to lisp where it is inserted as plain text. But if NSDragOperationCopy or NSDragOperationGeneric is set we mark it as a file and lisp will open the file. This does mean that the modifier presses aren’t customisable, but they will always match the OS default at least. If there’s a good use case for allowing these modifiers to leak through then I suggest we make it customisable. That way new users aren’t going to completely break drag‐n‐drop accidentally, and people who know what they’re doing can break it as much as they want and live with the consequences. -- Alan Third