blob: 2f69c6f475c2497c76e98f5d742ad0e59ee21000 (
plain)
1
2
3
4
5
6
|
<h3 class="section">Drag and Drop</h3> <p>When a user drags something from another application over Emacs, that other application expects Emacs to tell it if Emacs can handle the data that is dragged. The variable <code>x-dnd-test-function</code> is used by Emacs to determine what to reply. The default value is <code>x-dnd-default-test-function</code> which accepts drops if the type of the data to be dropped is present in <code>x-dnd-known-types</code>. You can customize <code>x-dnd-test-function</code> and/or <code>x-dnd-known-types</code> if you want Emacs to accept or reject drops based on some other criteria. </p> <p>If you want to change the way Emacs handles drop of different types or add a new type, customize <code>x-dnd-types-alist</code>. This requires detailed knowledge of what types other applications use for drag and drop. </p> <p>When an URL is dropped on Emacs it may be a file, but it may also be another URL type (https, etc.). Emacs first checks <code>dnd-protocol-alist</code> to determine what to do with the URL. If there is no match there, Emacs looks for a match in <code>browse-url-handlers</code> and <code>browse-url-default-handlers</code>. If still no match has been found, the text for the URL is inserted. If you want to alter Emacs behavior, you can customize these variables. </p><div class="_attribution">
<p class="_attribution-p">
Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
<a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Drag-and-Drop.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Drag-and-Drop.html</a>
</p>
</div>
|