[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18090: 24.4.50; `delete-selection-helper' logic changed for non-mous

From: Drew Adams
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)

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

> 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

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 via email to

[Prev in Thread] Current Thread [Next in Thread]