From 0a32037c92be331d4f44401109e90ff826494b6d Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 2 Apr 2022 14:59:08 +0800 Subject: Implement DELETE selection target for cross program drags * lisp/mouse.el (mouse-drag-and-drop-region): Make sure mark stays deactivated if a "cut" operation was performed. * lisp/select.el (xselect-convert-to-delete): Don't clear selection contents if it's the XdndSelection. --- lisp/select.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/select.el') diff --git a/lisp/select.el b/lisp/select.el index 0b51f01cc58..3646a28b9b4 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -607,7 +607,9 @@ two markers or an overlay. Otherwise, it is nil." selection-converter-alist)))))) (defun xselect-convert-to-delete (selection _type _value) - (gui-backend-set-selection selection nil) + ;; This should be handled by the caller of `x-begin-drag'. + (unless (eq selection 'XdndSelection) + (gui-backend-set-selection selection nil)) ;; A return value of nil means that we do not know how to do this conversion, ;; and replies with an "error". A return value of NULL means that we have ;; done the conversion (and any side-effects) but have no value to return. -- cgit v1.2.1