[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Toggling select-enable-clipboard & select-enable-primary prevents or
From: |
Ihor Radchenko |
Subject: |
Re: Toggling select-enable-clipboard & select-enable-primary prevents org-copy-visible to work |
Date: |
Wed, 10 Aug 2022 17:59:28 +0800 |
Alain.Cochard@unistra.fr writes:
> When my .emacs contains only the following:
>
> (custom-set-variables
> ;; custom-set-variables was added by Custom.
> ;; If you edit it by hand, you could mess it up, so be careful.
> ;; Your init file should contain only one such instance.
> ;; If there is more than one, they won't work right.
> '(select-enable-clipboard nil)
> '(select-enable-primary t)
> )
>
> then org-copy-visible does not work properly: when yanking, whether it
> be with 'yank' or 'org-yank', the invisible parts are also yanked.
>
> Is it normal? After all, the emacs manual says:
This is not normal, and I can reproduce the issue.
However, it does not look like Org is doing anything wrong. We call
kill-new with the correct value containing only visible part of the
buffer.
I suggest you to file a bug report to Emacs itself using M-x report-emacs-bug
In the report, you can cite this email.
Below, I am also detailing steps to reproduce to help Emacs devs debug
the problem:
1. Create bug.el with the following contents:
----
(custom-set-variables
'(select-enable-clipboard nil)
'(select-enable-primary t))
(defun my/copy-const (beg end)
(interactive "r")
(setq deactivate-mark t)
(kill-new "Constant string"))
----
2. Create bug.org with the following contents:
----
* headline
Hidden text inside
* another headline
----
3. emacs -Q -l /path/to/bug.el /path/to/bug.org
4. S-<TAB>
5. M-x my/copy-const
6. C-y
Expected: "Constant string" is inserted
Observed: Selected region is inserted.
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92