* If undo-only why not a redo-only?
[not found] <389165503.759660.1591638580779.ref@mail.yahoo.com>
@ 2020-06-08 17:49 ` Ergus
2020-06-08 18:10 ` Stefan Monnier
0 siblings, 1 reply; 9+ messages in thread
From: Ergus @ 2020-06-08 17:49 UTC (permalink / raw)
To: emacs-devel@gnu.org
[-- Attachment #1: Type: text/plain, Size: 358 bytes --]
Hi:
I've seen that we have an undo-only command and a way to customize a variable to do so for undo-redo.
Is it too complex to implement the same to do a redo-only equivalent in order to bind that to a different key if the user wants so?
There are different external packages for that, but they add some unneeded complexity and are somehow buggy.
Best,Ergus
[-- Attachment #2: Type: text/html, Size: 543 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: If undo-only why not a redo-only?
2020-06-08 17:49 ` If undo-only why not a redo-only? Ergus
@ 2020-06-08 18:10 ` Stefan Monnier
2020-06-08 18:41 ` Ergus
2020-06-08 18:44 ` Ergus
0 siblings, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2020-06-08 18:10 UTC (permalink / raw)
To: Ergus; +Cc: emacs-devel@gnu.org
> I've seen that we have an undo-only command and a way to customize
> a variable to do so for undo-redo.
> Is it too complex to implement the same to do a redo-only equivalent in
> order to bind that to a different key if the user wants so?
I don't understand what you're asking for.
Could you give some examples of what you'd like to see?
The current code is designed so you can have a "plain old undo+redo"
system by using the commands `undo-only` and `undo-redo`.
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: If undo-only why not a redo-only?
2020-06-08 18:10 ` Stefan Monnier
@ 2020-06-08 18:41 ` Ergus
2020-06-08 19:27 ` Stefan Monnier
2020-06-08 18:44 ` Ergus
1 sibling, 1 reply; 9+ messages in thread
From: Ergus @ 2020-06-08 18:41 UTC (permalink / raw)
To: monnier@iro.umontreal.ca; +Cc: emacs-devel@gnu.org
[-- Attachment #1: Type: text/plain, Size: 1541 bytes --]
Hi Stefan:
It is actually simple. The idea is to have more or less what undo-fu provides but in vanilla. I don't actually know if it is possible to do that for redo with what we already have there. (Probably yes and I don't know how)
The idea is to navigate only in one direction until the initial opposite action. or the other with the *-only commands, without the danger of switching unintentionally from undo to redo or vice-versa. If there is not more undo or redo or the next action is the opposite (redo/undo), just stop and do nothing (print a message maybe)
Basically I don't want to depend of undo-fu anymore for such a basic editing functionality as we already have the half of the work and because it tries to reinvent part of the wheel in my opinion.
Does it makes sense?
-----Original Message-----
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Ergus <spacibba@aol.com>
Cc: emacs-devel@gnu.org <emacs-devel@gnu.org>
Sent: Mon, Jun 8, 2020 8:10 pm
Subject: Re: If undo-only why not a redo-only?
> I've seen that we have an undo-only command and a way to customize
> a variable to do so for undo-redo.
> Is it too complex to implement the same to do a redo-only equivalent in
> order to bind that to a different key if the user wants so?
I don't understand what you're asking for.
Could you give some examples of what you'd like to see?
The current code is designed so you can have a "plain old undo+redo"
system by using the commands `undo-only` and `undo-redo`.
Stefan
[-- Attachment #2: Type: text/html, Size: 2187 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: If undo-only why not a redo-only?
2020-06-08 18:10 ` Stefan Monnier
2020-06-08 18:41 ` Ergus
@ 2020-06-08 18:44 ` Ergus
1 sibling, 0 replies; 9+ messages in thread
From: Ergus @ 2020-06-08 18:44 UTC (permalink / raw)
To: monnier@iro.umontreal.ca; +Cc: emacs-devel@gnu.org
[-- Attachment #1: Type: text/plain, Size: 799 bytes --]
BTW: https://gitlab.com/ideasman42/emacs-undo-fu
-----Original Message-----
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Ergus <spacibba@aol.com>
Cc: emacs-devel@gnu.org <emacs-devel@gnu.org>
Sent: Mon, Jun 8, 2020 8:10 pm
Subject: Re: If undo-only why not a redo-only?
> I've seen that we have an undo-only command and a way to customize
> a variable to do so for undo-redo.
> Is it too complex to implement the same to do a redo-only equivalent in
> order to bind that to a different key if the user wants so?
I don't understand what you're asking for.
Could you give some examples of what you'd like to see?
The current code is designed so you can have a "plain old undo+redo"
system by using the commands `undo-only` and `undo-redo`.
Stefan
[-- Attachment #2: Type: text/html, Size: 1437 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: If undo-only why not a redo-only?
2020-06-08 18:41 ` Ergus
@ 2020-06-08 19:27 ` Stefan Monnier
2020-06-08 21:18 ` Ergus
0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2020-06-08 19:27 UTC (permalink / raw)
To: Ergus; +Cc: emacs-devel@gnu.org
> The idea is to navigate only in one direction until the initial opposite
> action. or the other with the *-only commands, without the danger of
> switching unintentionally from undo to redo or vice-versa. If there is not
> more undo or redo or the next action is the opposite (redo/undo), just stop
> and do nothing (print a message maybe)
Yes, that's what `undo-only` and `undo-redo` attempt to provide, IIUC.
Have you bumped into problems with them?
Stefan
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: If undo-only why not a redo-only?
2020-06-08 19:27 ` Stefan Monnier
@ 2020-06-08 21:18 ` Ergus
2020-06-09 13:01 ` João Távora
0 siblings, 1 reply; 9+ messages in thread
From: Ergus @ 2020-06-08 21:18 UTC (permalink / raw)
To: monnier@iro.umontreal.ca; +Cc: emacs-devel@gnu.org
[-- Attachment #1: Type: text/plain, Size: 1488 bytes --]
Ohh, now I got it.
Sorry, but the name `undo-redo` was not clear for me at all (it seems more appropriated for the normal emacs undo as it actually does undo and redo) and the function documentation was confusing itself "Undo the last ARG undos" (it seems a prophecy of an oracle ;p ) also I didn't find anything more explicit in the manual either. Actually there are some useful undo related functions in simple.el I wasn't aware of and I just discovered looking into it. Maybe it would be fine to rename it or provide an alias more "symmetric" like `redo-only` or just `redo`?
So the only missing functions available in undo-fu are undo-fu-[redo/undo]-all but I have never used them so I don't actually care them.
Thanks for everything.Ergus
-----Original Message-----
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Ergus <spacibba@aol.com>
Cc: emacs-devel@gnu.org <emacs-devel@gnu.org>
Sent: Mon, Jun 8, 2020 9:27 pm
Subject: Re: If undo-only why not a redo-only?
> The idea is to navigate only in one direction until the initial opposite
> action. or the other with the *-only commands, without the danger of
> switching unintentionally from undo to redo or vice-versa. If there is not
> more undo or redo or the next action is the opposite (redo/undo), just stop
> and do nothing (print a message maybe)
Yes, that's what `undo-only` and `undo-redo` attempt to provide, IIUC.
Have you bumped into problems with them?
Stefan
[-- Attachment #2: Type: text/html, Size: 2100 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: If undo-only why not a redo-only?
2020-06-08 21:18 ` Ergus
@ 2020-06-09 13:01 ` João Távora
2020-06-09 15:19 ` Drew Adams
0 siblings, 1 reply; 9+ messages in thread
From: João Távora @ 2020-06-09 13:01 UTC (permalink / raw)
To: Ergus; +Cc: Stefan Monnier, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 455 bytes --]
On Mon, Jun 8, 2020, 22:19 Ergus <spacibba@aol.com> wrote:
> Ohh, now I got it.
>
> Sorry, but the name `undo-redo` was not clear for me at all
>
Can't resist pointing out that that is quite understandable. The
"prefix-with-library" name convention is fraught with these little
misunderstandings. It's arguably the last bad option we have now, but we
would need a proper namespace system to fix them: renaming can only do so
much.
João
[-- Attachment #2: Type: text/html, Size: 894 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: If undo-only why not a redo-only?
2020-06-09 13:01 ` João Távora
@ 2020-06-09 15:19 ` Drew Adams
2020-06-09 15:21 ` João Távora
0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2020-06-09 15:19 UTC (permalink / raw)
To: João Távora, Ergus; +Cc: Stefan Monnier, emacs-devel
>> Ohh, now I got it.
>> Sorry, but the name `undo-redo` was not clear for me at all
>
> Can't resist pointing out that that is quite understandable.
> The "prefix-with-library" name convention is fraught with
> these little misunderstandings. It's arguably the last bad
> option we have now, but we would need a proper namespace
> system to fix them: renaming can only do so much.
I was thinking the same thing.
Using hyphen to separate both pkg prefix and other parts of
a name is confusing. Better, perhaps, to use something like
`/' or `:' as pkg separator, while waiting for a real,
namespace solution.
But didn't you mean "least bad", not "last bad". Surely it's
not the last one that can be found. ;-)
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: If undo-only why not a redo-only?
2020-06-09 15:19 ` Drew Adams
@ 2020-06-09 15:21 ` João Távora
0 siblings, 0 replies; 9+ messages in thread
From: João Távora @ 2020-06-09 15:21 UTC (permalink / raw)
To: Drew Adams; +Cc: Ergus, Stefan Monnier, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 275 bytes --]
On Tue, Jun 9, 2020 at 4:19 PM Drew Adams <drew.adams@oracle.com> wrote:
>
> But didn't you mean "least bad", not "last bad". Surely it's
> not the last one that can be found. ;-)
>
Ehe, thanks, I did mean "least". Indeed, as we know,
it's always possible to do worse...
[-- Attachment #2: Type: text/html, Size: 629 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-06-09 15:21 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <389165503.759660.1591638580779.ref@mail.yahoo.com>
2020-06-08 17:49 ` If undo-only why not a redo-only? Ergus
2020-06-08 18:10 ` Stefan Monnier
2020-06-08 18:41 ` Ergus
2020-06-08 19:27 ` Stefan Monnier
2020-06-08 21:18 ` Ergus
2020-06-09 13:01 ` João Távora
2020-06-09 15:19 ` Drew Adams
2020-06-09 15:21 ` João Távora
2020-06-08 18:44 ` Ergus
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).