From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: Emacs undo behavior frustrating for new users. Date: Sun, 14 Oct 2018 23:59:12 -0500 Message-ID: <874ldnajq7.fsf@red-bean.com> References: <0CCFABF4-0F2B-4DAA-9C8E-11E1254A325E@gmail.com> <87woqka4wg.fsf_-_@red-bean.com> Reply-To: Karl Fogel NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1539579475 32381 195.159.176.226 (15 Oct 2018 04:57:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 15 Oct 2018 04:57:55 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) Cc: Noel Taylor , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 15 06:57:51 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBuww-0008Li-Kt for ged-emacs-devel@m.gmane.org; Mon, 15 Oct 2018 06:57:50 +0200 Original-Received: from localhost ([::1]:50362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBuz3-0003iZ-7x for ged-emacs-devel@m.gmane.org; Mon, 15 Oct 2018 01:00:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBuyT-0003iL-R5 for emacs-devel@gnu.org; Mon, 15 Oct 2018 00:59:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBuyP-0007EC-7L for emacs-devel@gnu.org; Mon, 15 Oct 2018 00:59:25 -0400 Original-Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]:42462) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gBuyL-000790-73 for emacs-devel@gnu.org; Mon, 15 Oct 2018 00:59:17 -0400 Original-Received: by mail-qk1-x72b.google.com with SMTP id g20-v6so11097862qke.9 for ; Sun, 14 Oct 2018 21:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:reply-to:date:in-reply-to :message-id:user-agent:mime-version; bh=vuGyFUBbrrLyKXf9sht8uSgA5C2bzY3yOXDM4Nbi1oY=; b=UKrEgCQywhEzcKEQbm/OKsG1hKcIVUufJtqmorV1T7eV5LwDRHAD8nSd61MR/NOusk YewWl/y8l/oxNntpdArvjllNZYOyezalzorcQcEG9NeaqAU7DcRdQvwGbartVUMghG4G 3d7N61D9tMd1pmhuyzkT5yMS8ubd3cE4rvHskkrdgH+GBSYN62mVDvLnDvc+/dP2USn4 Qc7/PHDmOA7+41NLolCMg4Pl6yFofU1B0DbhUGlfaoC/VN3MLA2NehQs0hmvfWpuRgvQ vsOmPMA6oIpYlCGyC41sldjzFqZpbhcbVxDBdcQdCqPAAXf7ItjTP8A5QFl/Fhw0VDOf lWUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:reply-to :date:in-reply-to:message-id:user-agent:mime-version; bh=vuGyFUBbrrLyKXf9sht8uSgA5C2bzY3yOXDM4Nbi1oY=; b=V6iwNJjMBfGGodV1zw7xgMIc2kbDn5XRROCZtbKbngRAKPKxRqdkFVBn9WdpRkJb+x hrpMJRrwJOIF2PLwHiqO4CgZO/3VB6indG99cHOkl5X0iPPMKwXyg/PBf2bTBKRmux1u CYXDhGlHJvIRlZiRntmiQvaIZ4W12E4AjWLp6h1dmr42n1eEmCumoXph8qwulR0+L+Ey L5wI8u/NFgBQqWWV71GM6YKZh1higJmqpwcXTt5+KmC5xL81Yb77MJeod5NfJmQMI3o4 6fso3p7R37rRVJ4Z3Yk2WEIodDdK6nbmjBiO/OhZLTq+yA2OTVxAclbqSal89Y+8upVo 5RnA== X-Gm-Message-State: ABuFfohjXMUF9ow7kCmwhEmxbOcp8BJnHZiKuGaKyIuBrc3H+VZMoBck OweqjF7jUw1tXE66/gxUVK8= X-Google-Smtp-Source: ACcGV62DUJlJelKb0ZVeyeT1pDjhzhYxzUZhveoQPnx8TXZOCuncSNw/EmJsYbDfGA23XMWCeD8NtQ== X-Received: by 2002:a37:1067:: with SMTP id a100-v6mr14129721qkh.150.1539579554105; Sun, 14 Oct 2018 21:59:14 -0700 (PDT) Original-Received: from floss ([2602:306:3707:da30:6ccc:c58d:e263:362e]) by smtp.gmail.com with ESMTPSA id k71-v6sm9206260qkh.30.2018.10.14.21.59.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Oct 2018 21:59:13 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Sun, 14 Oct 2018 14:42:26 -0400") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230393 Archived-At: Stefan Monnier writes: >> 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. > >BTW, Emacs does provide the "usual" undo command under the name >`undo-only` (it only affects the way Emacs traverses the undo history, >not the way the undo history is built, so it can be mixed with Emacs's >traditional `undo` just fine). >We could also provide a corresponding `undo-redo` command, which >similarly only performs redo actions. Thanks, Stefan. I've added Noel Taylor back to CC here, so he sees this too. (He's not subscribed to this list.) I didn't know about that command. I had searched for a variable that would control undo behavior -- I wasn't imaginative enough to guess that it might simply be a separate command, rather than a variable that changes the behavior of the familiar command. Noel, want to try binding `undo-only' to replace your normal `undo` keybindings and see if that provides a behavior that seems more natural to you? (And see how much you miss not having `undo-redo'... That probably wouldn't be very hard to implement, but I'm conspicuously not volunteering until we have a sense of how badly it would be missed by someone who is accustomed to having it.) >>> 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. > >I've been using here a patch which makes `undo` query the user when this >happens. More specifically, if you call `undo` when the last buffer >modification was itself an undo but the last command was not an undo, it >prompts the user asking where they want to continue undoing. Interesting! Is that patch posted (or are you planning to post it after all the kinks get worked out)? Best regards, -Karl