GNU bug report logs - #15234
24.3.50; Make C-x u repeatable

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Sun, 1 Sep 2013 12:20:02 UTC

Severity: wishlist

Merged with 12572

Found in versions 24.2.50, 24.3.50

Done: Dani Moncayo <dmoncayo <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15234 in the body.
You can then email your comments to 15234 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Sun, 01 Sep 2013 12:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jambunathan K <kjambunathan <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 01 Sep 2013 12:20:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Make C-x u repeatable
Date: Sun, 01 Sep 2013 17:51:42 +0530
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 <at> 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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Sun, 01 Sep 2013 15:24:03 GMT) Full text and rfc822 format available.

Message #8 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Jambunathan K <kjambunathan <at> gmail.com>, 15234 <at> debbugs.gnu.org
Subject: RE: bug#15234: 24.3.50; Make C-x u repeatable
Date: Sun, 1 Sep 2013 08:23:28 -0700 (PDT)
> 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)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Sun, 01 Sep 2013 16:10:01 GMT) Full text and rfc822 format available.

Message #11 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 15234 <at> debbugs.gnu.org
Subject: Re: bug#15234: 24.3.50; Make C-x u repeatable
Date: Sun, 01 Sep 2013 21:41:27 +0530
Drew Adams <drew.adams <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Sun, 01 Sep 2013 16:30:02 GMT) Full text and rfc822 format available.

Message #14 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 15234 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>
Subject: Re: bug#15234: 24.3.50; Make C-x u repeatable
Date: Sun, 01 Sep 2013 19:27:42 +0300
>> 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))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Sun, 01 Sep 2013 16:44:02 GMT) Full text and rfc822 format available.

Message #17 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 15234 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#15234: 24.3.50; Make C-x u repeatable
Date: Sun, 01 Sep 2013 22:15:27 +0530
Juri Linkov <juri <at> 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.









Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 01:47:01 GMT) Full text and rfc822 format available.

Message #20 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jambunathan K <kjambunathan <at> gmail.com>
Cc: 15234 <at> debbugs.gnu.org
Subject: Re: bug#15234: 24.3.50; Make C-x u repeatable
Date: Mon, 02 Sep 2013 21:46:15 -0400
> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 02:16:01 GMT) Full text and rfc822 format available.

Message #23 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, Jambunathan K
 <kjambunathan <at> gmail.com>
Cc: 15234 <at> debbugs.gnu.org
Subject: RE: bug#15234: 24.3.50; Make C-x u repeatable
Date: Mon, 2 Sep 2013 19:15:36 -0700 (PDT)
> > 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 02:22:01 GMT) Full text and rfc822 format available.

Message #26 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 15234 <at> debbugs.gnu.org
Subject: Re: bug#15234: 24.3.50; Make C-x u repeatable
Date: Tue, 03 Sep 2013 07:53:56 +0530
Stefan Monnier <monnier <at> 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. 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 02:29:01 GMT) Full text and rfc822 format available.

Message #29 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Jambunathan K <kjambunathan <at> gmail.com>, Stefan Monnier
 <monnier <at> iro.umontreal.ca>
Cc: 15234 <at> debbugs.gnu.org
Subject: RE: bug#15234: 24.3.50; Make C-x u repeatable
Date: Mon, 2 Sep 2013 19:27:52 -0700 (PDT)
> >> 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).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 06:34:01 GMT) Full text and rfc822 format available.

Message #32 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 15234 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#15234: 24.3.50; Make C-x u repeatable
Date: Tue, 3 Sep 2013 08:32:51 +0200
>> > 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




Forcibly Merged 12572 15234. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> debbugs.gnu.org. (Tue, 03 Sep 2013 13:36:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 14:50:02 GMT) Full text and rfc822 format available.

Message #37 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 15234 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: RE: bug#15234: 24.3.50; Make C-x u repeatable
Date: Tue, 3 Sep 2013 07:49:19 -0700 (PDT)
> > 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).






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 15:32:01 GMT) Full text and rfc822 format available.

Message #40 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 15234 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#15234: 24.3.50; Make C-x u repeatable
Date: Tue, 3 Sep 2013 17:31:08 +0200
>> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 16:20:01 GMT) Full text and rfc822 format available.

Message #43 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 15234 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: RE: bug#15234: 24.3.50; Make C-x u repeatable
Date: Tue, 3 Sep 2013 09:19:24 -0700 (PDT)
> > 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 16:43:02 GMT) Full text and rfc822 format available.

Message #46 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 15234 <at> debbugs.gnu.org, Jambunathan K <kjambunathan <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#15234: 24.3.50; Make C-x u repeatable
Date: Tue, 3 Sep 2013 18:41:57 +0200
> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#15234; Package emacs. (Tue, 03 Sep 2013 20:57:02 GMT) Full text and rfc822 format available.

Message #49 received at 15234 <at> debbugs.gnu.org (full text, mbox):

From: Jambunathan K <kjambunathan <at> gmail.com>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 15234 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#15234: 24.3.50; Make C-x u repeatable
Date: Wed, 04 Sep 2013 02:28:30 +0530
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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 02 Oct 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 317 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.