unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Juri Linkov <juri@linkov.net>
Cc: David Ponce <da_vid@orange.fr>,
	56530@debbugs.gnu.org, Visuwesh <visuweshm@gmail.com>
Subject: bug#56530: 29.0.50; mouse-2 cut selected text when cua-mode is enabled
Date: Fri, 22 Jul 2022 17:07:12 +0200	[thread overview]
Message-ID: <877d4589un.fsf@gnus.org> (raw)
In-Reply-To: <86r12j5yya.fsf@mail.linkov.net> (Juri Linkov's message of "Sun,  17 Jul 2022 21:49:41 +0300")

Juri Linkov <juri@linkov.net> writes:

> All affected mouse commands mouse-yank-from-menu, mouse-yank-at-click,
> mouse-yank-primary, mouse-yank-secondary have the same line:
>
>   (or mouse-yank-at-point (mouse-set-point event))
>
> So when the region is deleted by delete-selection-pre-hook
> `mouse-set-point' tries to set point using outdated information
> of the event's position in the deleted region.
>
> Maybe delete-selection-pre-hook could directly modify the event?
> Everything works fine with this:
>
>             ((eq type 'yank-on-region)
>              (let ((pos (posn-point (event-end last-nonmenu-event))))
>                (when (and (>= pos (region-beginning))
>                           (<= pos (region-end)))
>                  (delete-selection-helper 'yank)
>                  (setf (nth 5 (nth 1 last-nonmenu-event)) (region-beginning)))))
>
> But is this a good idea?

It sounds kinda gross.  Would it be possible to rewrite these commands
to that point is set before the deletion is done, or is that unfeasible?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2022-07-22 15:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13  9:22 bug#56530: 29.0.50; mouse-2 cut selected text when cua-mode is enabled David Ponce
2022-07-13  9:50 ` Visuwesh
2022-07-13 10:19   ` Lars Ingebrigtsen
2022-07-13 11:03     ` Visuwesh
2022-07-13 11:11       ` Lars Ingebrigtsen
2022-07-13 11:19         ` Visuwesh
2022-07-13 11:40           ` Lars Ingebrigtsen
2022-07-13 11:30       ` Stefan Kangas
2022-07-13 11:35         ` Visuwesh
2022-07-13 19:14         ` Juri Linkov
2022-07-13 19:19       ` Juri Linkov
2022-07-14 17:20         ` Lars Ingebrigtsen
2022-07-14 17:24           ` Juri Linkov
2022-07-14 18:04             ` Lars Ingebrigtsen
2022-07-15 18:53               ` Juri Linkov
2022-07-16 10:34                 ` Lars Ingebrigtsen
2022-07-17 18:49                   ` Juri Linkov
2022-07-22 15:07                     ` Lars Ingebrigtsen [this message]
2022-07-24 16:52                       ` Juri Linkov
2022-07-26 12:08                         ` Lars Ingebrigtsen
2022-07-13 11:10   ` David Ponce
2022-07-13 11:16     ` Visuwesh
2022-07-14  0:56   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-13 10:10 ` Stefan Kangas

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=877d4589un.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=56530@debbugs.gnu.org \
    --cc=da_vid@orange.fr \
    --cc=juri@linkov.net \
    --cc=visuweshm@gmail.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).