From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Drag and drop patch for X, please review. Date: Thu, 22 Jan 2004 14:00:44 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200401171729.i0HHT1wq016912@stubby.bodenonline.com> <9616315C-49F9-11D8-A763-00039363E640@swipnet.se> <66F4EDBB-4AC4-11D8-BCBC-00039363E640@swipnet.se> <3E8D86E4-4B60-11D8-A9EB-00039363E640@swipnet.se> <5A8FBF70-4C60-11D8-89BA-00039363E640@swipnet.se> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1074798472 11958 80.91.224.253 (22 Jan 2004 19:07:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2004 19:07:52 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Jan 22 20:07:49 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AjkBA-0003bb-00 for ; Thu, 22 Jan 2004 20:07:48 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AjkBA-0000Pz-00 for ; Thu, 22 Jan 2004 20:07:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ajk9h-0000on-MX for emacs-devel@quimby.gnus.org; Thu, 22 Jan 2004 14:06:17 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ajk79-00006v-F1 for emacs-devel@gnu.org; Thu, 22 Jan 2004 14:03:39 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ajk6V-0008JT-0W for emacs-devel@gnu.org; Thu, 22 Jan 2004 14:03:31 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ajk6U-0008JM-QS for emacs-devel@gnu.org; Thu, 22 Jan 2004 14:02:58 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1Ajk4K-0005Zq-2Q; Thu, 22 Jan 2004 14:00:44 -0500 Original-To: "Jan D." In-reply-to: <5A8FBF70-4C60-11D8-89BA-00039363E640@swipnet.se> (jan.h.d@swipnet.se) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19428 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19428 > Which of these messages causes the Lisp-level drag-n-drop event? > I would guess it is the last message that does so. No, they all do. That is, the messages the source sends: XdndEnter, XdndPosition, XdndPosition and XdndLeave (mouse moved away from Emacs or drop aborted). The replies are sent from lisp with x-send-client-message. If all of them turn into Lisp events, then all of them could be customized to depend on any aspect of the environment. But why bother to make a Lisp event for anything except the actual drop? I can see that is more flexible, but it could be much slower. > The time to look up the proper key binding is when the drop *ends*, > and only then. It is not hard to get the key bindings for a given > place on the Emacs frame. We do that for mouse clicks, we could do it > here too. That is too late. We must know if we are going to accept the drop before it ends. I think it is acceptable to always accept the drop, when the pointer is on a buffer text area. However, since you've implemented Lisp events for all the messages in the drag-n-drop protocol, I guess it ought to be easy enough to make the Lisp code that handles the event run some function provided by the major mode in order to decide whether a drop is acceptable at a given point.