Subject: bug#3468: drag and drop text

From: Eli Zaretskii <[email-masked]>
Date: Thu, 24 Oct 2024 10:37:22 +0300

> Date: Wed, 23 Oct 2024 19:16:51 +0200
> Cc: [email-masked]
> From: Cecilio Pardo <[email-masked]>
> 
> This add support for dnd-scroll-margin and dnd-indicate-insertion-point 
> on MS-Windows.

Thanks.

I guess I'm missing some higher-level understanding of how this work,
because I don't think I understand why you needed to add a special
message WM_EMACS_DRAGOVER for this.  Can you explain?

> BTW, I think this variables should be enabled by default. I'd say that 
> is the expected behaviour for drag and drop.

Maybe.  But that is a separate issue.

> * lisp/term/w32-win.el (w32-drag-n-drop): Call dnd-handle-movement
> when applicable.
> * src/w32fns.c (w32_handle_drag_movement): New function, sends a
> WM_EMACS_DRAGOVER message.
> (w32_drop_target_DragEnter): Call w32_handle_drag_movement.
> (w32_drop_target_DragOver): Call w32_handle_drag_movement.
> * src/w32term.c: (w32_read_socket): Handle WM_EMACS_DRAGOVER,
> sending an drag-n-drop event.

Please quote symbols 'like this'.

> * src/w32term.h (): Define new WM_EMACS_DRAGOVER message.
                 ^^^
Please remove these parentheses.

> --- a/lisp/term/w32-win.el
> +++ b/lisp/term/w32-win.el
> @@ -137,35 +137,39 @@ w32-drag-n-drop
>  If EVENT is for text, insert that text at point into the buffer
>  shown in the window that is the target of the drop; if that buffer is
>  read-only, add the dropped text to kill-ring.
> +If EVENT payload is nil, then this is a drag event.
>  If the optional argument NEW-FRAME is non-nil, perform the
>  drag-n-drop action in a newly-created frame using its selected-window
>  and that window's buffer."
>    (interactive "e")
> -  (save-excursion

What are the reasons for removing save-excursion?

I guess this also needs a NEWS entry, to announce support for these
two variables on MS-Windows?