all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Phil Sainty <psainty@orcon.net.nz>
Cc: 58608@debbugs.gnu.org
Subject: bug#58608: 29.0.50; Nasty bug with pasting primary selection in term buffers
Date: Thu, 20 Oct 2022 08:36:35 +0300	[thread overview]
Message-ID: <835ygfys2k.fsf@gnu.org> (raw)
In-Reply-To: <2e5596b526f1cf77da9e162dc2cb8566@webmail.orcon.net.nz> (message from Phil Sainty on Thu, 20 Oct 2022 11:14:50 +1300)

> Date: Thu, 20 Oct 2022 11:14:50 +1300
> From: Phil Sainty <psainty@orcon.net.nz>
> Cc: 58608@debbugs.gnu.org
> 
> > I think it could be important to understand why select-active-regions
> > causes this problem in your case.
> 
> I think mechanically it's because the middle click moves point to the
> click position, and the call to `deactivate-mark' then causes the
> primary selection to be updated based on the current point and mark
> (unless we mess with select-active-regions).
> 
> You've made me wonder, though... this command is intended only for
> term char mode, so should a middle click *really* be setting point?
> If all we're trying to do is send the selection text to the inferior
> process, that bit might be wrong.

It could be, but maybe looking at the Git history of that code will
tell you why we have that part there?  I mean, maybe there are use
cases where that is important?

If nothing comes up, I think you are right, and that move should be
removed.  On a GUI frame, a middle click leaves point _at_the_end_ of
the inserted text, not where I click.

But if we aren't sure, it's okay to momentarily disable
select-active-regions here, we just need a comment with the
explanation you wrote above.

> I'm now looking at that (setq this-command 'yank) as well, and
> wondering whether it's important for anything under the impression
> that a `yank' just happened to also see point at the location of
> the yank.  I'm not sure whether a middle click in a terminal to
> send the primary selection directly to the inferior process *should*
> be treated as `yank' though -- maybe that code is also wrong.

Indeed, we don't by default treat middle click as yank on GUI frames.
So maybe you are right -- but please note that there are some user
options which perhaps do cause the middle click to be treated as yank
as optional behavior, in which case they should do the same in the
term case.





  reply	other threads:[~2022-10-20  5:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 10:10 bug#58608: 29.0.50; Nasty bug with pasting primary selection in term buffers Phil Sainty
2022-10-18 23:10 ` Phil Sainty
2022-10-19  0:53   ` Phil Sainty
2022-10-19  1:19     ` Phil Sainty
2022-10-19  2:09       ` Phil Sainty
2022-10-19  3:22         ` Phil Sainty
2022-10-19  5:03           ` Phil Sainty
2022-10-19 11:05       ` Eli Zaretskii
2022-10-19 22:14         ` Phil Sainty
2022-10-20  5:36           ` Eli Zaretskii [this message]
2023-03-14 12:46             ` Phil Sainty
2023-03-14 14:28               ` Phil Sainty
2023-03-16  7:17                 ` Eli Zaretskii
2023-03-26 12:45                   ` Phil Sainty
2023-03-26 13:47                     ` Eli Zaretskii
2023-03-26 13:48                     ` Eli Zaretskii

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=835ygfys2k.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=58608@debbugs.gnu.org \
    --cc=psainty@orcon.net.nz \
    /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.