emacs-devel
[Top][All Lists]
Advanced

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

Emacs undo behavior frustrating for new users. (WAS: delete-selection-mo


From: Karl Fogel
Subject: Emacs undo behavior frustrating for new users. (WAS: delete-selection-mode as default)
Date: Sun, 14 Oct 2018 11:07:11 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux)

Richard Stallman <address@hidden> writes:
>  > 1. Emacs undo is frustrating for most new users.
>
>If that is true, it is an important issue.
>What evidence is there for that statement?
>If so, do we know why it is so?

Here is an answer from my friend Noel, who was recently a new user of Emacs.  
(He still uses Emacs, he's just no longer a new user.)  When I saw your 
question above, I remembered Noel's frustration with Emacs's default undo 
behavior when he was learning Emacs, and I asked him if he'd be willing to 
write it up.

I've CC'd him here, so he can participate in any followup discussion.

> From: Noel Taylor <address@hidden>
> Subject: why emacs undo behavior can be confusing to new users
> To: Karl Fogel <address@hidden>
> Date: Sun, 14 Oct 2018 01:32:52 -0500
> 
> To whom it may be of interest:
> 
> There are differences between the "undo" function of emacs and that
> of most other programs that may be confusing, and potentially
> frustrating, to new users.
> 
> There are, of course, countless programs with an "undo" feature, but
> in my personal experience, the "undo" behavior of emacs is unique.
> Every other program I can recall using, from Microsoft Word to Gmail
> to any web browser with "back" and "forward" buttons - if it has an
> "undo" function at all - has implemented "undo" in the same way, and
> I posit that many newcomers to emacs will be surprised that "undo" in
> emacs does not behave as it does in these other programs.
> 
> In the following paragraphs I will use the term "MS Word user" to
> refer to a person who is familiar with the "undo" behavior of other
> programs but who is new to emacs.
> 
> THE FUNDAMENTAL DESIGN DIFFERENCE:
> 
> The fundamental difference between the "undo" behavior of emacs and
> that of other programs is that other programs have separate "undo"
> and "redo" functions that act as a kind of temporal scroll bar,
> moving the document back and forth in time as the physical scroll bar
> moves it up and down in space. Emacs, by contrast, really only has
> "undo", and it does not slide the document back in time so much as it
> recovers a previous state of the document and copies it into the
> present. This difference in design is ultimately at the root of the
> confusion for new users of emacs, and it manifests in two main
> behaviors.
> 
> BEHAVIOR # 1
> 
> The most immediately noticeable way in which the undo behavior of
> emacs differs from that of MS Word and other programs is that
> "undoing" something in those other programs is not itself an undoable
> action. As such, the chain of undoable / redoable actions (let's call
> it the "action history") can - and frequently does - become shorter,
> whereas in emacs it normally only grows longer.
> 
> For example, in MS Word, if a user performs actions A, B, C, and D,
> and then undoes the last two actions, they will be returned to a
> state in which only A and B have been performed. If the user then
> performs a new action E, the actions C and D will be lost, and the
> new action history will comprise only actions A, B, and E.
> 
> This behavior may seem inherently undesirable in a text editor, but
> the MS Word user expects and even relies on it, as they are
> accustomed to maintaining a mental model of their action history as
> they edit their document, and the "undo" and "redo" actions can help
> them with this.
> 
> The MS Word user is used to being able to traverse their action
> history without the traversal itself having any effect.  Again, in MS
> Word, if a user performs actions A, B, C, D, and E, they can use undo
> and redo to move back and forth between A and D, between B and E,
> between A and C, etc. as much as they like. And at the end of all the
> undoing and redoing, their action history will still comprise only
> those five actions.
> 
> If the same user tries this in emacs, they may be surprised to find
> that a point they thought was only a few "undo" actions away now
> takes much longer to reach. If for example, they perform actions A,
> B, C, D, and E:
> 
>     A -> B -> C-> D -> E
> 
> and then "undo" back to point B and *then* "undo undo" back to point
> E again, the MS Word user will imagine their action history as being
> exactly the same as when they originally performed action E, when in
> fact it looks like this:
> 
>     A -> B -> C -> D -> E -> D-> C -> B -> C -> D -> E
> 
> If they then decide they want to return to point A, they will be
> confused that it now takes 10 "undo" actions to get there instead of
> 4 actions. They will also wonder why the buffer seems to be moving
> first backward, then forward, then backward again in time. They may
> even break the undo procedure before they ever reach point A to try
> something else, which only makes point A more remote than before. A
> growing sense of frustration then follows as they continue to undo
> and redo, accustomed as they are to being able to roll back and forth
> without side effects, but instead finding that earlier points they
> thought would be nearby are ever more distant. It has now become
> impossible for them to maintain a mental model of their increasingly
> complicated action history, so they swear, return the buffer to some
> state that is sort-of like what they want, save it to a file, kill
> the buffer, and re-open it, all for the sake of dumping the
> convoluted action history.
> 
> I've been using emacs for years now and even though I am very used to
> its "undo" behavior, I still make frequent use of the following
> addition to my .emacs file:
> 
> (defun forget-undo () "Drop this buffer's undo history."
> (interactive) (setq buffer-undo-list nil))  
> 
> BEHAVIOR # 2
> 
> The other behavior that can be confusing to new users of emacs is
> that if the user is in the process of "undoing" to an earlier point
> in the action history, the act of moving the cursor (for example,
> with the arrow keys) will interrupt the undo sequence even though no
> change has been made to the contents of the buffer.
> 
> MS Word and other programs do not work like this. Actions that do not
> affect the text also do not affect the user's action history. If we
> again assume that the MS Word user has completed actions A, B, C, D,
> and E, and that they have then performed "undo" actions to go from
> point E back to point B, they can move the cursor around all they
> like (which they might do because perhaps it is easier at that moment
> to view a different part of the text by moving the cursor rather than
> by moving a scroll bar), and they can still "fast-forward" again to
> point E.  Merely moving the cursor has not affected their action
> history.
> 
> MS Word and other programs therefore define two kinds of actions:
> those that affect the contents of the text, also causing any
> "forward" history to be lost, and those that do not affect the
> contents of the text, leaving the action history unaffected.
> 
> CONCLUSION
> 
> I hope that I have clearly articulated why the emacs "undo" can be
> confusing to new users. I am not making any claims as to which style
> is better. However, adding the MS-Word-style behavior - with separate
> "undo" and "redo" actions - as a built-in configuration option to
> emacs might make it easier for new users to approach.
> 
> N. Taylor



reply via email to

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