From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.bugs Subject: bug#3468: drag and drop text Date: Sat, 28 Sep 2024 23:52:45 +0200 Message-ID: <8ba4e567-550e-4ac2-96f4-c6f7bacd78d0@imayhem.com> References: <20090604070321.177690@gmx.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------bpXDjFiTX3F1gJwJnVP0JZE0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3801"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 3468@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 28 23:53:56 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sufNy-0000oe-GU for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Sep 2024 23:53:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sufNg-0007l6-W9; Sat, 28 Sep 2024 17:53:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sufNe-0007ky-Mf for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2024 17:53:34 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sufNe-0003X5-Dg for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2024 17:53:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=From:MIME-Version:Date:To:In-Reply-To:References:Subject; bh=qHvsQO+nUHfX+I4qTgRz2UXWq4/hgNHkbTqMr4W+ysQ=; b=XPGtXOj6g+K9i/+JPJVmtZFVvIbrM+JqSmxUh3xj7/e+bD1Q9pMMxKIIjN6LPABP9Wegby3Lx+HYXtfip+KZWMMIKj87YJlmcdH4g7IsH2ZU5UkkxtEPSwd3Zy0AHZA3Md0UZE/kKl51j74OgMDdZSf8qp7Z/HRxdxOvn0jrI0Ia2r7dOObged3ab0eFcyXu1kQrm8PAXROet2HbZLJwM8VZL50aNAJce+bBfcuobwwEeTSuX1a1kPa9ZSPFrquc60YigQNlZNtEUUnIZmQoB8MmrgBNzKCROyPbsUuKpOy39b015dtYfS0sl39s09oNJtsNAPnz8KLdKIkFC/MaBg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sufO6-00027z-DH for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2024 17:54:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <20090604070321.177690@gmx.net> Resent-From: Cecilio Pardo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Sep 2024 21:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3468 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: help Original-Received: via spool by 3468-submit@debbugs.gnu.org id=B3468.17275604108035 (code B ref 3468); Sat, 28 Sep 2024 21:54:02 +0000 Original-Received: (at 3468) by debbugs.gnu.org; 28 Sep 2024 21:53:30 +0000 Original-Received: from localhost ([127.0.0.1]:48749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sufNY-00025V-UZ for submit@debbugs.gnu.org; Sat, 28 Sep 2024 17:53:29 -0400 Original-Received: from mail.imayhem.com ([82.223.54.191]:46487 helo=zealous-pike.82-223-54-191.plesk.page) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sufNU-00024r-Vs for 3468@debbugs.gnu.org; Sat, 28 Sep 2024 17:53:27 -0400 Original-Received: from [192.168.68.105] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id 9AC5C800D1 for <3468@debbugs.gnu.org>; Sat, 28 Sep 2024 21:52:46 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.105] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292606 Archived-At: This is a multi-part message in MIME format. --------------bpXDjFiTX3F1gJwJnVP0JZE0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit This patch implements drag-and-drop for w32 for files and text, using C, not C++. This should work from Windows 95, but I can't test it. Because of this, the prior implementation with WM_DROPFILES has been removed with '#if 0', and can probably be completely removed. I tested with mingw-w64 and mingw on Windows 11. Text is inserted at point position, not at drop position. I don't know how this works on other platforms. --------------bpXDjFiTX3F1gJwJnVP0JZE0 Content-Type: text/plain; charset=UTF-8; name="0001-Implement-drag-n-drop-for-w32-with-support-for-files.patch" Content-Disposition: attach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