bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#57147: bug#57148: 27.2; Problem with kill-new


From: Po Lu
Subject: bug#57147: bug#57148: 27.2; Problem with kill-new
Date: Sat, 13 Aug 2022 19:54:25 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux)

Ihor Radchenko <yantar92@gmail.com> writes:

> I think that's because I accidentally replied to the report before it
> got registered by debbugs.
>
> Anyway, here is the recipe:
>
> 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. Move point to bob, activate mark, and select down to the eob
> 6. M-x my/copy-const
> 7. C-y
>
> Expected: "Constant string" is inserted
> Observed: Selected region is inserted.

This is intended behavior.  Deactivating the mark will always assert
ownership over the primary selection with the contents of the region.

See the doc string of `deactivate-mark' for more details.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]