From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Gitlab Migration Date: Fri, 10 Sep 2021 06:09:29 +0300 Message-ID: <6198b50c-d47c-fe12-3da0-28bcbb7947ad@yandex.ru> References: <87h7fcnmq0.fsf@posteo.net> <83tujbqg4j.fsf@gnu.org> <46353190-1190-495f-b15e-22980159b3ab@yandex.ru> <83y28mp0rb.fsf@gnu.org> <51a363db-fde7-791d-cf8d-98ac601d62ee@yandex.ru> <57ca4d78-2339-201d-edce-678c9b003a99@yandex.ru> <01341bd6-b94b-4f94-1461-405e723142ad@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------965382BD637B956A61BD074C" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27337"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 Cc: philipk@posteo.net, danflscr@gmail.com, stefan@marxist.se, lokedhs@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, eliz@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 10 05:10:36 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mOWw0-0006o5-2u for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Sep 2021 05:10:36 +0200 Original-Received: from localhost ([::1]:42490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOWvy-0003Tc-Rg for ged-emacs-devel@m.gmane-mx.org; Thu, 09 Sep 2021 23:10:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOWv4-0002Wb-IQ for emacs-devel@gnu.org; Thu, 09 Sep 2021 23:09:38 -0400 Original-Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:39617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mOWv2-0006tO-JC; Thu, 09 Sep 2021 23:09:38 -0400 Original-Received: by mail-wr1-x42b.google.com with SMTP id z4so521741wrr.6; Thu, 09 Sep 2021 20:09:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=lv+P9S3r8eohuLnrYjIu4teGXDh5j826AQWjC/S+PDg=; b=c2dM5VZmBJrHsttBZrYfJygg0HuX5sh1O3hgF1w3XXCk0bio9YR+ZNiG2pkJT6LpvZ 2zkwiLH5ZRTMRWr8uJ0lcryH+o9QUHa8bH4aYU53c1VscnIrAHdxKeuyaed3x+rZ2vf9 C25PMMg7h0Yi7RjEwfxNE+vOIac1rclceRpF/TCmov7dmtnZ8KbPTpSTrWkMGb+K7s1p kwiOkp07/0zvoa3un/f9IUIzZeVaWGBqZpQQlFoj1X5pFUp6v3XTkz/deFNMpb88qbYx G0HbPCP123EMLYpzI4B5f05473JO6oOqJu1T1Y8CNyfobbQ5PMVEcCwoNdSmKa/xtkeh PKZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=lv+P9S3r8eohuLnrYjIu4teGXDh5j826AQWjC/S+PDg=; b=WA5P9E8u2JyVLeR9VSHNG4bo3UVzaSUUuYQwQ7yl3YWYnAJFbuwBQaJOQ3KkX/Vi19 YXUF1G97ATwcpmpooBD05h/iwnZHw/erfC6W3fYQr7W+E1MQlMFUC0r4TAZyFrklwhlU o32oCe0iJk8PGVGNxZT+TrEdm60NTauTk3kv9Y0GKSIe0QunEQFPDrIGvOwwJsz+z9Ej Zcpz3yEOD5y6irqe+dLXbhVBfqfJyNLr5+UO659sLfu3siH198ZswkDRWM/zfLXd23IM zMA88e7+Scs+I+M25gZZ9gvrQZiY0/Pq32CCSHl5Ci6M8j5g1hdRAcGqDoWC+teVUzNa q6KQ== X-Gm-Message-State: AOAM532JRXnqG7taTJnOajI5cc/t+XZUKCFsINfT4H5k4MrWpj2yDtXg N2jn6xmeA9nWMzUktv+QWbINkGpSh4s= X-Google-Smtp-Source: ABdhPJwr6ez2ha/4NkTdK9GNVGd512p363CntveFnMTCdmBCr6CiQmz9jsc55DuxRnXwmpHI8DiUvw== X-Received: by 2002:a05:6000:188d:: with SMTP id a13mr6935553wri.99.1631243374112; Thu, 09 Sep 2021 20:09:34 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id l2sm2889070wmi.1.2021.09.09.20.09.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 20:09:32 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-1.975, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:274487 Archived-At: This is a multi-part message in MIME format. --------------965382BD637B956A61BD074C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 09.09.2021 06:07, Richard Stallman wrote: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > Others replied later that users generally expect 'redo' to require one > > more modifier than 'undo'. In graphical Emacs, it can work out to having > > 'C-/' call 'undo', then one can additionally hold down the Shift key to > > the right of '/', calling 'redo' with the resulting 'C-?'. > > If users are happy with that, I won't argue against it. It doesn't have > any other problem. > > We still have the problem of ttys. We can't use C-/ or C-? on a tty > because each of them is the same character as DEL. So we use C-_ instead > for undo. > > Because there is no difference on a tty between C-_ and C--. > there is no way to disguinuish between Sh-C-- and C--. I previously suggested M-_ (working fine on my tty), but it does make the transition more awkward. > However, C-M-- could be used for redo on ttys. > > Does that make everyone happy? If so, maybe we're ready to > introduce that binding. That's pretty elegant. On tty, the user would press C-- to undo and C-M-- to redo. One-modifier difference. Though in my testing I had to bind C-M-_ instead. That's what my tty Emacs translated the combination to. And that also resolved the conflict with the existing 'C-M--' binding for 'negative-argument'. > Initially we should continue the current behavior of undo > to avoid an incompatible change, and have an option to enablke > the undo-redo behavior. Once Emacs 28 is out, we could find out > what the users think and whether we old fogeys can adjust to undo-redo. > Then we could decide whether to make that the default. Sounds good. I wonder if we should add some mechanism to detect that the user had called undo-redo in the current session, and then one of his/her undo-s is going to perform a "redoing" undo (and suggest to disable the behavior, by changing some user option that will turn their 'undo' into 'undo-only'). Or maybe the attached patch is enough: long-time users will use 'undo' like they always did, and the undo-redo users aren't generally going to notice that 'undo' sometimes goes too far. We should also modify cua-mode to use undo-redo, but that can go in after. --------------965382BD637B956A61BD074C Content-Type: text/x-patch; charset=UTF-8; name="undo-redo-bindings.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="undo-redo-bindings.diff" diff --git a/etc/NEWS b/etc/NEWS index 8f20db7a76..4e12d431a1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -865,7 +865,13 @@ for CJK text mixed with Latin text. +++ ** New command 'undo-redo'. It undoes previous undo commands, but doesn't record itself as an -undoable command. +undoable command. It is bound to 'C-?' and 'C-M-_', the first binding +works well in graphical mode, and the second one is easy to hit on tty. + +For full conventional undo/redo behavior, you can also bind undo-only: + + (define-key global-map [?\C-/] 'undo-only) + (define-key global-map "\C-_" 'undo-only) +++ ** New commands 'copy-matching-lines' and 'kill-matching-lines'. diff --git a/lisp/bindings.el b/lisp/bindings.el index b8bf0c1a6f..97a7b01d43 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -993,6 +993,9 @@ undo-repeat-map "Keymap to repeat undo key sequences `C-x u u'. Used in `repeat-mode'.") (put 'undo 'repeat-map 'undo-repeat-map) +(define-key global-map (kbd "C-?") 'undo-redo) +(define-key global-map [?\C-\M-_] 'undo-redo) + (define-key esc-map "!" 'shell-command) (define-key esc-map "|" 'shell-command-on-region) (define-key esc-map "&" 'async-shell-command) --------------965382BD637B956A61BD074C--