all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15234: 24.3.50; Make C-x u repeatable
@ 2013-09-01 12:21 Jambunathan K
  2013-09-01 15:23 ` Drew Adams
  2013-09-03  1:46 ` Stefan Monnier
  0 siblings, 2 replies; 15+ messages in thread
From: Jambunathan K @ 2013-09-01 12:21 UTC (permalink / raw)
  To: 15234


Make C-x u repeatable.  This will make editing (and completion)
experience quite awesome.  If something is preventing, atleast make it a
customizable option.

| Keyseq 1 => | C-x u | C-x u | C-x u | C-x u | u   |   |
|-------------+-------+-------+-------+-------+-----+---|
| Keyseq 2 => | C-x u | C-x z | z     | z     | C-g | u |
|-------------+-------+-------+-------+-------+-----+---|
| keyseq 3 => | C-x   | u     | u     | u     | C-g | u |


----------------------------------------------------------------

When I do, M-/ (runs the stock `dabbrev-expand') - this I use very
frequently - I often overshoot the completion that I expect by miles and
use (C-x u)+ to backtrack. 

----------------------------------------------------------------

In GNU Emacs 24.3.50.3 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2013-08-31 on porunai
Bzr revision: 114077 rgm@gnu.org-20130830174039-3aiddsbwhbn5tf9x
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Important settings:
  value of $LANG: en_IN
  locale-coding-system: iso-latin-1-unix
  default enable-multibyte-characters: t






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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-01 12:21 bug#15234: 24.3.50; Make C-x u repeatable Jambunathan K
@ 2013-09-01 15:23 ` Drew Adams
  2013-09-01 16:11   ` Jambunathan K
  2013-09-01 16:27   ` Juri Linkov
  2013-09-03  1:46 ` Stefan Monnier
  1 sibling, 2 replies; 15+ messages in thread
From: Drew Adams @ 2013-09-01 15:23 UTC (permalink / raw)
  To: Jambunathan K, 15234

> Make C-x u repeatable. 

FWIW, this is what I use:

(defun undo-repeat (arg)
  "Same as `undo', but repeatable even on a prefix key.
E.g., if bound to `C-x u' then you can use `C-x u u u...' to repeat."
  (interactive "*P")
  (undo arg)
  (set-temporary-overlay-map (let ((map  (make-sparse-keymap)))
                               (define-key map "u" 'undo-repeat)
                               map)))

(global-set-key [remap undo] 'undo-repeat)





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-01 15:23 ` Drew Adams
@ 2013-09-01 16:11   ` Jambunathan K
  2013-09-01 16:27   ` Juri Linkov
  1 sibling, 0 replies; 15+ messages in thread
From: Jambunathan K @ 2013-09-01 16:11 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15234

Drew Adams <drew.adams@oracle.com> writes:

>> Make C-x u repeatable. 
>
> FWIW, this is what I use:
>
> (defun undo-repeat (arg)
>   "Same as `undo', but repeatable even on a prefix key.
> E.g., if bound to `C-x u' then you can use `C-x u u u...' to repeat."
>   (interactive "*P")
>   (undo arg)
>   (set-temporary-overlay-map (let ((map  (make-sparse-keymap)))
>                                (define-key map "u" 'undo-repeat)
>                                map)))
>
> (global-set-key [remap undo] 'undo-repeat)

I want it right within stock Emacs.  Not in my .emacs, not in a package
floating in wikis.





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-01 15:23 ` Drew Adams
  2013-09-01 16:11   ` Jambunathan K
@ 2013-09-01 16:27   ` Juri Linkov
  2013-09-01 16:45     ` Jambunathan K
  1 sibling, 1 reply; 15+ messages in thread
From: Juri Linkov @ 2013-09-01 16:27 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15234, Jambunathan K

>> Make C-x u repeatable.
>
> FWIW, this is what I use:
>
> (defun undo-repeat (arg)

You can make any command repeatable more easily with:

(advice-add 'undo :after
	    (lambda (delta)
	      (set-temporary-overlay-map
	       (let ((map (make-sparse-keymap)))
		 (define-key map (vector last-command-event) this-command)
		 map))))





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-01 16:27   ` Juri Linkov
@ 2013-09-01 16:45     ` Jambunathan K
  0 siblings, 0 replies; 15+ messages in thread
From: Jambunathan K @ 2013-09-01 16:45 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 15234

Juri Linkov <juri@jurta.org> writes:

> You can make any command repeatable more easily with:
>
> (advice-add 'undo :after

Thanks.  I need to catch up with new advice functions. 
----------------------------------------------------------------

Emacs Lisp is quite scary.  I don't mind customizing my Emacs but I want
 an interface that is simple.

    (mapc 
     (put 'undo 'repeat t)
     (list 'undo 'command-1 'command-2 'command-3))

May be a post-command hook that checks the 'repeat property and does
it's temporary overlay magic.

To top it all have a defcustom where I can add the list of commands.

----------------------------------------------------------------

So the point really not that it be doable but that it be readily (made)
available (in a way that the user can relate) with no second thought.










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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-01 12:21 bug#15234: 24.3.50; Make C-x u repeatable Jambunathan K
  2013-09-01 15:23 ` Drew Adams
@ 2013-09-03  1:46 ` Stefan Monnier
  2013-09-03  2:15   ` Drew Adams
  2013-09-03  2:23   ` Jambunathan K
  1 sibling, 2 replies; 15+ messages in thread
From: Stefan Monnier @ 2013-09-03  1:46 UTC (permalink / raw)
  To: Jambunathan K; +Cc: 15234

> Make C-x u repeatable.

IIRC from last time this came up, the reason it's not is that you can
use C-_, or C-/ instead, which are both trivially repeatable.


        Stefan





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-03  1:46 ` Stefan Monnier
@ 2013-09-03  2:15   ` Drew Adams
  2013-09-03  2:23   ` Jambunathan K
  1 sibling, 0 replies; 15+ messages in thread
From: Drew Adams @ 2013-09-03  2:15 UTC (permalink / raw)
  To: Stefan Monnier, Jambunathan K; +Cc: 15234

> > Make C-x u repeatable.
> 
> IIRC from last time this came up, the reason it's not is that you can
> use C-_, or C-/ instead, which are both trivially repeatable.

So it is not necessary to do it.  But is it advantageous not to do it?
What are some downsides to doing it?





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-03  1:46 ` Stefan Monnier
  2013-09-03  2:15   ` Drew Adams
@ 2013-09-03  2:23   ` Jambunathan K
  2013-09-03  2:27     ` Drew Adams
  1 sibling, 1 reply; 15+ messages in thread
From: Jambunathan K @ 2013-09-03  2:23 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 15234

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> Make C-x u repeatable.
>
> IIRC from last time this came up, the reason it's not is that you can
> use C-_, or C-/ instead, which are both trivially repeatable.

C-/ works good for me.  My needs are met, this bug can be closed.

I think I sided with C-x u because `u' served as a good mnemonic. 





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-03  2:23   ` Jambunathan K
@ 2013-09-03  2:27     ` Drew Adams
  2013-09-03  6:32       ` Dani Moncayo
  0 siblings, 1 reply; 15+ messages in thread
From: Drew Adams @ 2013-09-03  2:27 UTC (permalink / raw)
  To: Jambunathan K, Stefan Monnier; +Cc: 15234

> >> Make C-x u repeatable.
> >
> > IIRC from last time this came up, the reason it's not is that you can
> > use C-_, or C-/ instead, which are both trivially repeatable.
> 
> C-/ works good for me.  My needs are met, this bug can be closed.
> I think I sided with C-x u because `u' served as a good mnemonic.

FWIW, I've always used `C-_' or `C-/'.  But I still think it makes sense
to make `C-x u' repeatable.  I haven't seen an argument to the contrary
(but if I do I might change my mind).





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-03  2:27     ` Drew Adams
@ 2013-09-03  6:32       ` Dani Moncayo
  2013-09-03 14:49         ` Drew Adams
  0 siblings, 1 reply; 15+ messages in thread
From: Dani Moncayo @ 2013-09-03  6:32 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15234, Jambunathan K

>> > IIRC from last time this came up, the reason it's not is that you can
>> > use C-_, or C-/ instead, which are both trivially repeatable.
>>
>> C-/ works good for me.  My needs are met, this bug can be closed.
>> I think I sided with C-x u because `u' served as a good mnemonic.
>
> FWIW, I've always used `C-_' or `C-/'.  But I still think it makes sense
> to make `C-x u' repeatable.  I haven't seen an argument to the contrary
> (but if I do I might change my mind).

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12572#8

-- 
Dani Moncayo





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-03  6:32       ` Dani Moncayo
@ 2013-09-03 14:49         ` Drew Adams
  2013-09-03 15:31           ` Dani Moncayo
  0 siblings, 1 reply; 15+ messages in thread
From: Drew Adams @ 2013-09-03 14:49 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: 15234, Jambunathan K

> > FWIW, I've always used `C-_' or `C-/'.  But I still think it makes sense
> > to make `C-x u' repeatable.  I haven't seen an argument to the contrary
> > (but if I do I might change my mind).
> 
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12572#8

[The argument there is that if `C-x u u u...' repeats `undo' then typing
`u' directly after that will not insert a `u' character.]

Fair enough.  And thank you - it's always good to see real arguments for
and against a proposal.

It's a good argument.  Not a particularly strong one, IMO, but reasonable.

It's not strong because there are other, simple ways of exiting `undo' so
`u' will then insert (`<left> <right>', `x DEL', whatever).

This is similar to arguments against binding keys in `isearch-mode-map'
to do things in Isearch because it stops them from ending Isearch.

Yes, some people might want to use `C-x u' for `undo' AND want `C-x u u'
to insert `u'.  My vote would still be for making `C-x u u' repeatable.

You can't please everyone, unless you add an option or you have two
different commands (or you abuse some prefix-arg combination, and that's
already pretty overloaded).

To accommodate that argument, I would also vote for binding `C-x u' to a
new command, `undo-repeat', as mentioned earlier.  (Or perhaps just reuse
the previously used name for `C-x u': `advertised-undo'.)

Anyone wanting to have `u' to insert directly after `C-x u' could easily
opt out in that case, by changing the key binding to the original,
non-repeatable `undo'.

Or if you want to be conservative here, make binding `C-x u' to
`undo-repeat'/`advertised-undo' opt-in instead of opt-out.  I'd vote for
that too.

Bottom line: we should provide a repeatable undo command for `C-x u',
whether bound by default (preferable) or not (ok).







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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-03 14:49         ` Drew Adams
@ 2013-09-03 15:31           ` Dani Moncayo
  2013-09-03 16:19             ` Drew Adams
  0 siblings, 1 reply; 15+ messages in thread
From: Dani Moncayo @ 2013-09-03 15:31 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15234, Jambunathan K

>> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12572#8
>
> [The argument there is that if `C-x u u u...' repeats `undo' then typing
> `u' directly after that will not insert a `u' character.]
>
> Fair enough.  And thank you - it's always good to see real arguments for
> and against a proposal.
>
> It's a good argument.  Not a particularly strong one, IMO, but reasonable.
>
> It's not strong because there are other, simple ways of exiting `undo' so
> `u' will then insert (`<left> <right>', `x DEL', whatever).

Yes, there would be other ways of exiting undo, but I definitely
prefer not having to "exit" `undo'.

In general, I think that modal operations should be avoided as much as
possible, because IMO, they make the user interface more complex
(uglier, worse...).

-- 
Dani Moncayo





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-03 15:31           ` Dani Moncayo
@ 2013-09-03 16:19             ` Drew Adams
  2013-09-03 16:41               ` Dani Moncayo
  0 siblings, 1 reply; 15+ messages in thread
From: Drew Adams @ 2013-09-03 16:19 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: 15234, Jambunathan K

> > there are other, simple ways of exiting `undo' so
> > `u' will then insert (`<left> <right>', `x DEL', whatever).
> 
> Yes, there would be other ways of exiting undo, but I definitely
> prefer not having to "exit" `undo'.
> 
> In general, I think that modal operations should be avoided as much as
> possible, because IMO, they make the user interface more complex
> (uglier, worse...).

Yes and no.  Isearch has been greatly *improved* by binding keys in
`isearch-mode-map' to do particular things.  Some, especially RMS, have
argued against this, saying that it makes Isearch too modal - exactly
your argument.

But you have to "exit" Isearch anyway - it *is* modal, in a sense.  It's
just that there were originally a zillion ways to exit and now there are
a zillion minus a few.

Wrt `undo': When you repeat `undo' and you go past where you wanted,
what do you do?  You "exit" `undo' repeating by hitting some key, e.g.
`x', and then you start it again so it undoes that key and then undoes
its previous undoing.  IOW, you already "exit" undo repetition, whether
you think of it that way or not.

No, of course it's not really a mode.  One is not locked into repetition.
It's only modal in the sense that hitting an undo key again continues
undoing.  And the only thing new here is that `u' becomes an undo key
(when it follows `C-x u'), just like `C-/'.

You could argue that any function that takes control over input (what
you type next) is modal to some extent.  `y-or-n-p' is modal in this
sense.  Likewise `query-replace' and lots of other useful commands.
And yes, as you point out, they can make the UI more complex.  It's a
tradeoff.

Different users will feel differently about this feature, just as some
feel differently about the keys that have been added to Isearch.  Some
will welcome the change as an improvement.  Some will dislike it, e.g.,
because it changes their habits.

Out of curiosity, do you actually use `C-x u' today?  Not that you need
to, to have an opinion about this.  (I don't use it.)

How do you feel about having a separate command for this repeatable undo?





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-03 16:19             ` Drew Adams
@ 2013-09-03 16:41               ` Dani Moncayo
  2013-09-03 20:58                 ` Jambunathan K
  0 siblings, 1 reply; 15+ messages in thread
From: Dani Moncayo @ 2013-09-03 16:41 UTC (permalink / raw)
  To: Drew Adams; +Cc: 15234, Jambunathan K

> Out of curiosity, do you actually use `C-x u' today?

Yes I use it most of the times I need to undo something, because to
me, it is easier to type (in my spanish keyboard) than the other
(default) keys, "C-/" and "C-_", which both require to press 3 keys
simultaneously.

I only use "C-/" when I have to undo many operations.

(I've also bound "C-z" to "undo", but I hardly ever remember that)

> How do you feel about having a separate command for this repeatable undo?

Well, if there are people (like you or Jambunathan) who want it....
why not?  But IMO the current "undo" command should remain bound to
"C-x u".

-- 
Dani Moncayo





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

* bug#15234: 24.3.50; Make C-x u repeatable
  2013-09-03 16:41               ` Dani Moncayo
@ 2013-09-03 20:58                 ` Jambunathan K
  0 siblings, 0 replies; 15+ messages in thread
From: Jambunathan K @ 2013-09-03 20:58 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: 15234


C-x u u u u u C-g u
              ^^^
This should insert `u' right?  

How do you move from Undo to Redo?  Use the same thing to stop the undo
streak and get in to insert mode.  (I generally use a mouse click)

When I started, C-x u served as a useful mnemonic to remember undo.  Now
I find that C-/ is more easier to type because I don't have to leave the
home row.

If someone started with C-x u and IF undo is NOT repeatable, then there
is considerable amount of C-x-es that are wasted.

If I were you (i.e, using spanish keyboards), I would insist that C-x u
be repeatable.  For me, C-/ is a superior choice than C-x u in
everyway.  So I am more than happy with status quo.





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

end of thread, other threads:[~2013-09-03 20:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-01 12:21 bug#15234: 24.3.50; Make C-x u repeatable Jambunathan K
2013-09-01 15:23 ` Drew Adams
2013-09-01 16:11   ` Jambunathan K
2013-09-01 16:27   ` Juri Linkov
2013-09-01 16:45     ` Jambunathan K
2013-09-03  1:46 ` Stefan Monnier
2013-09-03  2:15   ` Drew Adams
2013-09-03  2:23   ` Jambunathan K
2013-09-03  2:27     ` Drew Adams
2013-09-03  6:32       ` Dani Moncayo
2013-09-03 14:49         ` Drew Adams
2013-09-03 15:31           ` Dani Moncayo
2013-09-03 16:19             ` Drew Adams
2013-09-03 16:41               ` Dani Moncayo
2013-09-03 20:58                 ` Jambunathan K

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.