unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Juri Linkov <juri@linkov.net>, Eli Zaretskii <eliz@gnu.org>
Cc: 18090@debbugs.gnu.org
Subject: bug#18090: 24.4.50; `delete-selection-helper' logic changed for non-mouse region?
Date: Thu, 20 Sep 2018 14:55:58 -0700 (PDT)	[thread overview]
Message-ID: <f40f2b79-2945-4b1e-b8df-d9918cc51e21@default> (raw)
In-Reply-To: <87pnx8xckg.fsf@mail.linkov.net>

> I see that mouse operations are not supported by delete-selection-mode
> anyway - yanking with <mouse-2> doesn't replace the selected region,

Huh? I kill some text (or copy it to the kill-ring). Then I select some
other text with the mouse. Then I type or I yank. The typed or
yanked text replaces the mouse-selected text. What am I missing?

> so the whole
> 	     (when (and (string= (buffer-substring-no-properties
> 				  (point) (mark)) (car kill-ring))
> 			(fboundp 'mouse-region-match)
> 			(mouse-region-match))
> 	       (current-kill 1))
> could be deleted altogether.  

Why would we do that? That's been there forever - except for the
mouse-region-match part that you added (subject of this report).

> Otherwise, if there is a wish to support
> mouse yanking, a separate enhancement request could be created.

Why do you think that clause is about mouse yanking? It's about
using a command that has `yank' as the value of its `delete-selection'
property.

> I don't understand this bug report too - in fact, there is no bug,
> the purpose of the old change was to remove gratuitous optimization
> that breaks keyboard macros (the result of yanking should not depend
> on differences between old and new text), 

Sorry, but I don't understand that. What old change? What
optimization? What macro breakage (example)? What old and
new text? No idea what you're saying, there.

> and nobody complained during last 10+ years.

I filed this bug report 4 years ago. What kinds of complaints are
you expecting?

> But if Drew wants such optimization, then a new customizable option
> could be added.

I don't know what optimization you're talking about; sorry.

The comment that introduces the code that you think is
extra and should be deleted is this:

;; Before a yank command, make sure we don't yank the
;; head of the kill-ring that really comes from the
;; currently active region we are going to delete.
;; That would make yank a no-op.

That comment has been there since at least Emacs 20!

It says that the purpose of this code is to prevent just yanking
the same text that will be deleted. That's the entire purpose
of property-value `yank'. This is not an optimization. It's
precisely so you _can_ yank to replace the selection. Without
this code you cannot - you end up replacing the selection
with its own text.

The part of the code that you want to remove is the ONLY
code that has been present forever for the `yank' condition.
Remove that and you'll remove the use of property-value
`yank'.

Clearly I'm not understanding you. Please try to clarify. I hope
this is just a case of you or me missing something, and not one
of real disagreement.





  reply	other threads:[~2018-09-20 21:55 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 [this message]
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
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=f40f2b79-2945-4b1e-b8df-d9918cc51e21@default \
    --to=drew.adams@oracle.com \
    --cc=18090@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=juri@linkov.net \
    /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).