"Jacob S. Gordon" <jacob.as.gor...@gmail.com> writes:
This “memory” effect of refiling the previous item, plus the error
message about pasting the subtree made me think it was related to
yanking/killing. If I apply your xclip settings in a terminal window,
I can reproduce the weird refiling behaviour:
#+begin_src emacs-lisp
(use-package xclip
:config
(setq xclip-program "wl-copy")
(setq xclip-select-enable-clipboard t)
(setq xclip-mode t)
(setq xclip-method (quote wl-copy)))
#+end_src
wow, good sleuthing!
So, it seems that xclip-mode with default options triggers this issue (I am using Wayland so
`wl-copy` is invoked).
(use-package xclip
:config
(xclip-mode t))
I *think* the culprit could be how `org-paste-subtree` handles yank and kill.
Or it's xclip?
I could only find a single reference to this issue, apparently no one else stumbled on this issue
yet? That's really strange.
https://old.reddit.com/r/orgmode/comments/fdmek4/bad_interaction_with_org_refile_and_xclip_mode/
I don't have the context to figure out things further, all I could do was disabling xclip-mode
around executing `org-refile`:
--8<---------------cut here---------------start------------->8---
;; disable xclip-mode before executing org-refile
(advice-add 'org-refile :before (lambda (&rest _)
(when xclip-mode
(xclip-mode -1))))
;; enable xclip-mode again after executing org-refile
(advice-add 'org-refile :after (lambda (&rest _)
(when (not xclip-mode)
(xclip-mode t))))
--8<---------------cut here---------------end--------------->8---
Ihor, any thoughts on this?
Thanks