unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: 18090@debbugs.gnu.org
Subject: bug#18090: 24.4.50; `delete-selection-helper' logic changed for non-mouse region?
Date: Tue, 25 Sep 2018 22:02:20 +0300	[thread overview]
Message-ID: <87r2hho7vv.fsf@mail.linkov.net> (raw)
In-Reply-To: <d87894b3-72d6-4ff6-8b54-df7d5c33fd07@default> (Drew Adams's message of "Mon, 24 Sep 2018 14:16:28 -0700 (PDT)")

>> Shouldn't mouse yanking be supported by `delete-selection-mode',
>> what do you think?
>
> Dunno. Please file a bug report, if you think so. Or
> feel free to bring that into this report, if you like.
>
> What do you want it to do? Does it do what you want if you
> (put 'mouse-yank-primary 'delete-selection 'yank)?
> If not, what code change do you think is needed?

The reason why I asked this question is because it's the only case
what might fail AFAICS.  When I tried what you suggested

(put 'mouse-yank-primary 'delete-selection 'yank)

I see that it pastes at the wrong place - before yanking
it moves point at the offset of the distance between the
region beginning and the position clicked with the mouse,
but since delete-selection-mode already deleted the region,
this means that it puts point at unrelated text that
shifts into this position after deleting the region.

mouse-yank-primary provides the correct result only when
mouse-yank-at-point is non-nil.  I don't see how this could be
supported within the limitations of the current design of
delete-selection-mode.  One way is to reimplement delete-selection-mode
using advices - it's easy to put advice around mouse-yank-at-point
that would set mouse-yank-at-point to t around the call to
mouse-yank-at-point.

Another not so good solution is to hard-code checks for
delete-selection-mode in mouse-yank-primary.

So after mouse-yank-primary is supported, we could look
under what conditions to call (current-kill 1)
in delete-selection-helper.

Please note that the current condition in (eq type 'yank)
that checks for (car kill-ring) is unsuitable
because mouse-yank-primary pastes from
(gui-get-primary-selection), not from (car kill-ring)

>> I agree that code that calls (delete-active-region) under the
>> condition (eq type 'yank) is essential to handle `yank'.
>> But I think that (current-kill 1) is not essential
>> unless it renders yank useless in some cases (yet unknown).
>
> Maybe you're right; dunno.
>
> Do you want to remove that code? Without it, does
> `deletion-selection-mode' do what you want for both
> t and nil values of `mouse-drag-copy-region'?
>
> At this point it's not clear to me what behavior is  bugged,
> if any. I'd like to hear what changes, if any, you propose,
> both for the code and the desired behavior (for both t
> and nil values of `mouse-drag-copy-region').

When mouse-drag-copy-region is non-nil, I see that
(mouse-region-match) returns non-nil, so no changes
are required in delete-selection-helper for this case.





  reply	other threads:[~2018-09-25 19:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-23 18:02 bug#18090: 24.4.50; `delete-selection-helper' logic changed for non-mouse region? Drew Adams
2018-04-03 21:06 ` Drew Adams
2018-09-19 17:51   ` Drew Adams
2018-09-20  6:15     ` Eli Zaretskii
2018-09-20 15:04       ` Drew Adams
2018-09-20 20:52       ` Juri Linkov
2018-09-20 21:55         ` Drew Adams
2018-09-20 22:50           ` Juri Linkov
2018-09-24  1:35             ` Drew Adams
2018-09-24 19:08               ` Juri Linkov
2018-09-24 21:16                 ` Drew Adams
2018-09-25 19:02                   ` Juri Linkov [this message]
2018-09-21  6:47           ` Eli Zaretskii
2022-02-20 13:06             ` Lars Ingebrigtsen
2022-03-21 18:30               ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87r2hho7vv.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=18090@debbugs.gnu.org \
    --cc=drew.adams@oracle.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).