From 04bbf6359f370bddb6ca5fff1d8c7737e7ac5ee7 Mon Sep 17 00:00:00 2001 From: Max Nikulin Date: Mon, 29 Nov 2021 18:54:43 +0700 Subject: [PATCH] org.el: Fix first call of `org-paste-subtree' * lisp/org.el (org-paste-subtree): Do not check `kill-ring' before calling `current-kill' since the latter can pull content of clipboard. First call of `org-paste-subtree' failed if nothing had been yanked before since Emacs start but system clipboard had text with valid subtree originating from other application. The bug was where since the commit adding `org-paste-subtree'. If both `kill-ring' and system clipboard are empty then `current-kill' generates meaningful error. --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 025513e7a..55953e97b 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7774,7 +7774,7 @@ the inserted text when done. When REMOVE is non-nil, remove the subtree from the clipboard." (interactive "P") - (setq tree (or tree (and kill-ring (current-kill 0)))) + (setq tree (or tree (current-kill 0))) (unless (org-kill-is-subtree-p tree) (user-error (substitute-command-keys -- 2.25.1