unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y
@ 2016-09-06 13:28 Nils Berg
  2016-09-06 14:33 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Nils Berg @ 2016-09-06 13:28 UTC (permalink / raw)
  To: 24379

[-- Attachment #1: Type: text/plain, Size: 707 bytes --]

It's extremely useful to be able to traverse the kill ring in both
directions, especially when there's many entries in it.

M-Y was the most intuitive binding for this to me, but one
could also argue in favor of C-M-y.

---
 lisp/bindings.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/bindings.el b/lisp/bindings.el
index c13f4b1..42efd05 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -889,6 +889,7 @@ if `inhibit-field-text-motion' is non-nil."
 (define-key esc-map "\C-w" 'append-next-kill)
 (define-key global-map "\C-y" 'yank)
 (define-key esc-map "y" 'yank-pop)
+(define-key esc-map "Y" (lambda () (interactive) (yank-pop -1)))

 ;; (define-key ctl-x-map "a" 'append-to-buffer)

[-- Attachment #2: Type: text/html, Size: 1060 bytes --]

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y
  2016-09-06 13:28 bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y Nils Berg
@ 2016-09-06 14:33 ` Drew Adams
  2016-09-06 15:15   ` Clément Pit--Claudel
  2016-09-06 15:13 ` Clément Pit--Claudel
  2019-06-25 11:37 ` Lars Ingebrigtsen
  2 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2016-09-06 14:33 UTC (permalink / raw)
  To: Nils Berg, 24379

> It's extremely useful to be able to traverse the kill ring
> in both directions, especially when there's many entries in it.

It may be.  But users already have several ways to do this.

> M-Y was the most intuitive binding for this to me, but one
> could also argue in favor of C-M-y.

FWIW, I hope that neither such binding is added by default.
It is trivial for any user to add such a binding, if desired.

Many users already have their own yanking (or other) commands
bound to such keys.  (Just google `emacs "C-M-y"' and
`emacs "M-y"'.)

In my case, for example, `M-y' is `icicle-yank-pop-commands',
and `C-M-y' is `secondary-dwim'.
____

icicle-yank-pop-commands is an interactive compiled Lisp function in
`icicles-cmd1.el'.

It is bound to M-insert, M-y.

(icicle-yank-pop-commands &optional ARG)

For more information check the manuals.

`yank-pop', `yank-pop-secondary', or `icicle-completing-yank'.
Which of these is used depends on the previous command, as follows:

 * If the previous command was a yank-secondary command, then
   `yank-pop-secondary'.

 * Else if the previous command was a yank command (i.e. using the
   kill ring), then `yank-pop'.

 * Else `icicle-completing-yank'.

In the last case (`icicle-completing-yank'), during completion you can
use:

 * `C-,' to sort the candidates to yank in different ways (repeat)
 * `S-delete' to remove a candidate entry from the selection ring
 * `C-S-return' to copy a candidate to the other selection ring
____

secondary-dwim is an interactive compiled Lisp function in
`second-sel.el'.

It is bound to C-M-y, menu-bar edit secondary-dwim.

(secondary-dwim ARG)

For more information check the manuals.

Do-What-I-Mean with the secondary selection.
Prefix arg:

  None: Yank secondary.
  Zero: Select secondary as region.
  > 0:  Move secondary to region.
  < 0:  Swap region and secondary.

Details:

No prefix arg: Yank the secondary selection at point.  Move point to
the end of the inserted text.  Leave mark where it was.

Zero arg: Select the secondary selection and pop to its buffer.

Non-zero arg: Move the secondary selection to this buffer's region.

Negative arg: Also go to where the secondary selection was and select
it as the region.  That is, swap the region and the secondary
selection.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y
  2016-09-06 13:28 bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y Nils Berg
  2016-09-06 14:33 ` Drew Adams
@ 2016-09-06 15:13 ` Clément Pit--Claudel
  2019-06-25 11:37 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 9+ messages in thread
From: Clément Pit--Claudel @ 2016-09-06 15:13 UTC (permalink / raw)
  To: 24379


[-- Attachment #1.1: Type: text/plain, Size: 883 bytes --]

Did you try M-- M-y (that is meta-minus, meta-y)?

Clément.

On 2016-09-06 09:28, Nils Berg wrote:
> It's extremely useful to be able to traverse the kill ring in both
> directions, especially when there's many entries in it.
> 
> M-Y was the most intuitive binding for this to me, but one
> could also argue in favor of C-M-y.
> 
> ---
>  lisp/bindings.el | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lisp/bindings.el b/lisp/bindings.el
> index c13f4b1..42efd05 100644
> --- a/lisp/bindings.el
> +++ b/lisp/bindings.el
> @@ -889,6 +889,7 @@ if `inhibit-field-text-motion' is non-nil."
>  (define-key esc-map "\C-w" 'append-next-kill)
>  (define-key global-map "\C-y" 'yank)
>  (define-key esc-map "y" 'yank-pop)
> +(define-key esc-map "Y" (lambda () (interactive) (yank-pop -1)))
>  
>  ;; (define-key ctl-x-map "a" 'append-to-buffer)
>  


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y
  2016-09-06 14:33 ` Drew Adams
@ 2016-09-06 15:15   ` Clément Pit--Claudel
  2016-09-06 15:36     ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Clément Pit--Claudel @ 2016-09-06 15:15 UTC (permalink / raw)
  To: Drew Adams, Nils Berg, 24379


[-- Attachment #1.1: Type: text/plain, Size: 437 bytes --]

On 2016-09-06 10:33, Drew Adams wrote:
> Many users already have their own yanking (or other) commands
> bound to such keys.  (Just google `emacs "C-M-y"' and
> `emacs "M-y"'.)

How would a new binding affect these users?

> In my case, for example, `M-y' is `icicle-yank-pop-commands',
> and `C-M-y' is `secondary-dwim'.

M-y is already bound to yank-pop in plain Emacs, so I'm not sure I follow your point :/

Clément.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y
  2016-09-06 15:15   ` Clément Pit--Claudel
@ 2016-09-06 15:36     ` Drew Adams
  2016-09-06 15:42       ` Clément Pit--Claudel
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2016-09-06 15:36 UTC (permalink / raw)
  To: Clément Pit--Claudel, Nils Berg, 24379

> > Many users already have their own yanking (or other) commands
> > bound to such keys.  (Just google `emacs "C-M-y"' and
> > `emacs "M-y"'.)
> 
> How would a new binding affect these users?

Users can always override any key bindings, of course.
But many users are hesitant to override default bindings,
for whatever reasons.

This suggested default binding is really unnecessary, IMO.
It is trivial for someone to add it, if they like.
 
> > In my case, for example, `M-y' is `icicle-yank-pop-commands',
> > and `C-M-y' is `secondary-dwim'.
> 
> M-y is already bound to yank-pop in plain Emacs, so I'm not
> sure I follow your point :/

Yes, and my `M-y' is only turned on in Icicle minor mode (but
which I am always in).  You can drop that example, if you like,
and just google for `emacs "M-y"' if you would like to see what
other users do with `M-y'.

My point was the _general_ one that I stated: (1) Many users
have their own uses of `M-y' and `C-M-y'.  And (2) adding this
particular binding is not helpful - it is trivial for anyone
to add it, if they really want it.

There are not so many good keys available.  Arguments for
binding more keys globally (not for some mode) by default,
in particular, should be strong arguments.

They should not proceed _only_ from:

 * the-key-is-not-bound-by-default or
 * here-is-a-useful-command-that-is-not-bound-by-default

There should be a more compelling reason to add a new default
key binding, IMHO.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y
  2016-09-06 15:36     ` Drew Adams
@ 2016-09-06 15:42       ` Clément Pit--Claudel
  2016-09-06 15:58         ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Clément Pit--Claudel @ 2016-09-06 15:42 UTC (permalink / raw)
  To: Drew Adams, Nils Berg, 24379


[-- Attachment #1.1: Type: text/plain, Size: 951 bytes --]

On 2016-09-06 11:36, Drew Adams wrote:
> Users can always override any key bindings, of course.
> But many users are hesitant to override default bindings,
> for whatever reasons.
>
> …
>
> Yes, and my `M-y' is only turned on in Icicle minor mode (but
> which I am always in).  You can drop that example, if you like,
> and just google for `emacs "M-y"' if you would like to see what
> other users do with `M-y'.

I'm having trouble reconciling these two statements: on the one hand people don't like overriding existing bindings, but on the other hand many people override the existing M-y binding?

> My point was the _general_ one that I stated: (1) Many users
> have their own uses of `M-y' and `C-M-y'.  And (2) adding this
> particular binding is not helpful - it is trivial for anyone
> to add it, if they really want it.

I don't understand. All bindings are trivial to add. That doesn't make any of them less helpful.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y
  2016-09-06 15:42       ` Clément Pit--Claudel
@ 2016-09-06 15:58         ` Drew Adams
  2016-09-14  9:42           ` Nils Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2016-09-06 15:58 UTC (permalink / raw)
  To: Clément Pit--Claudel, Nils Berg, 24379

> > Users can always override any key bindings, of course.
> > But many users are hesitant to override default bindings,
> > for whatever reasons.
...
> > Yes, and my `M-y' is only turned on in Icicle minor mode (but
> > which I am always in).  You can drop that example, if you like,
> > and just google for `emacs "M-y"' if you would like to see what
> > other users do with `M-y'.
> 
> I'm having trouble reconciling these two statements: on the one hand
> people don't like overriding existing bindings, but on the other hand
> many people override the existing M-y binding?

Maybe you're having trouble because you're trying too hard to
argue. ;-)

Many users do override default bindings.  And many do not.

In any case, the proposal was about `M-Y', which is not bound
by default.

> > My point was the _general_ one that I stated: (1) Many users
> > have their own uses of `M-y' and `C-M-y'.  And (2) adding this
> > particular binding is not helpful - it is trivial for anyone
> > to add it, if they really want it.
> 
> I don't understand. All bindings are trivial to add. That doesn't make any
> of them less helpful.

It's a trivial command, which is not hard for a user to discover
or consider binding.  And as you yourself pointed out, `M-- M-y'
does the same thing.

You're trying too hard to pick a fight, I'm afraid.

Do _you_ think `M-Y' should be bound by default to the suggested
command?  If so, please present some supporting arguments.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y
  2016-09-06 15:58         ` Drew Adams
@ 2016-09-14  9:42           ` Nils Berg
  0 siblings, 0 replies; 9+ messages in thread
From: Nils Berg @ 2016-09-14  9:42 UTC (permalink / raw)
  To: Drew Adams; +Cc: Clément Pit--Claudel, 24379

[-- Attachment #1: Type: text/plain, Size: 2989 bytes --]

Some healthy discussion here, so let me preface this by saying I appreciate
all of you working to keep the default bindings useful and not excessive.

That said, I still feel there should be a single binding for (yank-pop -1).
Here's why:

First, all of the other commands that traverse something (that I can think
of) have an opposite bound to an equally convenient combination.
C-n/C-p and C-f/C-b, C-v/M-v, C-s/C-r are some examples off the top of my
head.

Of course 'M-- M-y' works, but that's like saying 'M-- C-n' does the same
thing as C-p.
(As a side note, I'll admit I didn't actually know/remember M-- is a
shorthand for 'C-u -1'. That does make the common case of overshooting the
item you want by 1 a lot less painful.)

Second, I fully agree with Clément that just because a command is trivial,
it's automatically unhelpful to bind it. Again, see C-n/C-p.

And lastly, if a user has a custom binding for M-Y or C-M-y (I'm not dead
set on either), that will still prevail.
I don't see why they'd be any more reluctant to override those than M-y,
which you said lots of people do.
It's pretty hard to google "M-y", much less "M-Y", without Google deciding
I'm actually looking for "my", so I'm going to trust you on that.

So that's my 2 Cents. If you're still unconvinced, feel free to close this
:)

On Tue, Sep 6, 2016 at 5:58 PM, Drew Adams <drew.adams@oracle.com> wrote:

> > > Users can always override any key bindings, of course.
> > > But many users are hesitant to override default bindings,
> > > for whatever reasons.
> ...
> > > Yes, and my `M-y' is only turned on in Icicle minor mode (but
> > > which I am always in).  You can drop that example, if you like,
> > > and just google for `emacs "M-y"' if you would like to see what
> > > other users do with `M-y'.
> >
> > I'm having trouble reconciling these two statements: on the one hand
> > people don't like overriding existing bindings, but on the other hand
> > many people override the existing M-y binding?
>
> Maybe you're having trouble because you're trying too hard to
> argue. ;-)
>
> Many users do override default bindings.  And many do not.
>
> In any case, the proposal was about `M-Y', which is not bound
> by default.
>
> > > My point was the _general_ one that I stated: (1) Many users
> > > have their own uses of `M-y' and `C-M-y'.  And (2) adding this
> > > particular binding is not helpful - it is trivial for anyone
> > > to add it, if they really want it.
> >
> > I don't understand. All bindings are trivial to add. That doesn't make
> any
> > of them less helpful.
>
> It's a trivial command, which is not hard for a user to discover
> or consider binding.  And as you yourself pointed out, `M-- M-y'
> does the same thing.
>
> You're trying too hard to pick a fight, I'm afraid.
>
> Do _you_ think `M-Y' should be bound by default to the suggested
> command?  If so, please present some supporting arguments.
>

[-- Attachment #2: Type: text/html, Size: 3872 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y
  2016-09-06 13:28 bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y Nils Berg
  2016-09-06 14:33 ` Drew Adams
  2016-09-06 15:13 ` Clément Pit--Claudel
@ 2019-06-25 11:37 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-25 11:37 UTC (permalink / raw)
  To: Nils Berg; +Cc: 24379

Nils Berg <nilsb@google.com> writes:

> It's extremely useful to be able to traverse the kill ring in both
> directions, especially when there's many entries in it.
>
> M-Y was the most intuitive binding for this to me, but one
> could also argue in favor of C-M-y.

As Clément said, this is already on `M-- M-y', which I think makes more
sense...  but in the common case, I think most people just hit `undo' to
get back to the previous yanks.

In any case, I don't think an additional keystroke is warranted, and I'm
closing this bug report.

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-06-25 11:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-06 13:28 bug#24379: [PATCH] lisp/bindings.el: Bind (yank-pop -1) to M-Y Nils Berg
2016-09-06 14:33 ` Drew Adams
2016-09-06 15:15   ` Clément Pit--Claudel
2016-09-06 15:36     ` Drew Adams
2016-09-06 15:42       ` Clément Pit--Claudel
2016-09-06 15:58         ` Drew Adams
2016-09-14  9:42           ` Nils Berg
2016-09-06 15:13 ` Clément Pit--Claudel
2019-06-25 11:37 ` Lars Ingebrigtsen

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).