0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-23 18:19:20 +00:00

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.
This commit is contained in:
Max Nikulin 2021-11-29 18:54:43 +07:00 committed by Ihor Radchenko
parent 6ef33b6dd6
commit 57abbd4b92
No known key found for this signature in database
GPG key ID: 6470762A7DA11D8B

View file

@ -7034,7 +7034,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