all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	57148@debbugs.gnu.org, 57147@debbugs.gnu.org, larsi@gnus.org,
	alain.cochard@unistra.fr
Subject: bug#57148: bug#57147: bug#57148: 27.2; Problem with kill-new
Date: Sat, 13 Aug 2022 20:20:48 +0800	[thread overview]
Message-ID: <87lers5o7z.fsf@localhost> (raw)
In-Reply-To: <8735e0uzny.fsf@yahoo.com>

Po Lu <luangruo@yahoo.com> writes:

>> 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.

Can this behaviour be disabled then? It is clearly not the user intention
here when the user calls a function that is supposed to push some
filtered text to `kill-ring' right before deactivating the region.

I am thinking about workaround like

;; Prevent Emacs from adding full selected text to `kill-ring'
;; when `select-enable-primary' is non-nil.
(setq-local filter-buffer-substring-function
            `(lambda (&rest _)
               (setq-local filter-buffer-substring-function
                           ',filter-buffer-substring-function)
               nil))

which seems to work, but looks like a hack.

-- 
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





  reply	other threads:[~2022-08-13 12:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 23:59 bug#57148: 27.2; Problem with kill-new Alain.Cochard
2022-08-12  0:34 ` bug#57147: " Ihor Radchenko
2022-08-12 15:53   ` bug#57148: " Lars Ingebrigtsen
2022-08-13  1:59     ` bug#57147: " Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13  2:43       ` Alain.Cochard
2022-08-13  6:15         ` bug#57148: " Eli Zaretskii
2022-08-13  9:21           ` Ihor Radchenko
2022-08-13  9:40             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13  9:56               ` Ihor Radchenko
2022-08-13 11:54                 ` bug#57148: " Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13 12:20                   ` Ihor Radchenko [this message]
2022-08-13 12:28                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13 12:32                       ` Lars Ingebrigtsen
2022-08-13 13:13                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-13 14:37                           ` Ihor Radchenko
2022-08-14  1:19                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lers5o7z.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=57147@debbugs.gnu.org \
    --cc=57148@debbugs.gnu.org \
    --cc=alain.cochard@unistra.fr \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.