1
votes

I have problem with drag-n-drop from outside to gnu emacs. To investigate the cause,

I wrote and executed these code:

(defun dnd-handler (event &optional new-frame)
       (interactive "e")
       (message "Got dnd signal"))


(global-set-key [drag-n-drop] 'dnd-handler)

No message appeared, when I dragged a file from desktop to emacs.

Emacs documentation states:

(drag-n-drop position files)

This kind of event is generated when a group of files is selected in an application outside of Emacs, and then dragged and dropped onto an Emacs frame. The element position is a list describing the position of the event, in the same format as used in a mouse-click event (see Click Events), and files is the list of file names that were dragged and dropped. The usual way to handle this event is by visiting these files.

This kind of event is generated, at present, only on some kinds of systems.

Does it mean my system is not supported? My system consists of

GNU Emacs 24.3.1 (i386-mingw-nt6.1.7601) of 2013-03-18 on MARVIN

Window 7 Enterprise 64Bit.

Any advice is welcome. Thanks.

1
That combination of OS and Emacs works perfectly for me. Have you tested with an empty ".emacs"? - molbdnilo

1 Answers

3
votes

Make sure you're not running Emacs with elevated security, as this can block drag and drop operations from other processes not on the same level.

If you're launching Emacs from a shortcut (.lnk file), right click on it, Properties, Advanced, turn off Run as Administrator.

The same thing can happen if you launch Emacs from a console with elevated security.