emacs-devel
[Top][All Lists]
Advanced

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

Re: Changes for emacs 28


From: Ergus
Subject: Re: Changes for emacs 28
Date: Sat, 12 Sep 2020 04:01:42 +0200

On Sat, Sep 12, 2020 at 01:29:42AM +0300, Dmitry Gutov wrote:
On 12.09.2020 00:17, Ergus wrote:
On Sat, Sep 12, 2020 at 12:00:48AM +0300, Dmitry Gutov wrote:

So there will be contradiction between the menu and the keyboard?

Hopefully not: With the undo-redo-mode; undo icon will do undo-only as
well as the keyboard and toolbar-icon.

Indeed.

Otherwise; maybe it is easier to keep everything there as now (undo and
redo in toolbar and menubar and no undo-redo-mode) but add an option
like default-undo-command to set the undo-only as the default undo
either in the keyboard, toolbar and menubar if someone (like me) don't
like at all the default undo.

I don't know if that's possible with a simple remap... is it?

It's unlikely to be as seamless as toggling undo-redo-mode.


BTW: everybody agrees in set undo-redo to C-? and M-_??

No objections so far, and the bindings are free, so...

We can change the exact keys later anyway.

Personally I still think that a mode is better. But I trust more in Eli's
opinion than mine in this topics.

Since Eli clarified that his objection is not hard (email from 11.09.2020, 16:13), perhaps you should go ahead and propose a concrete patch for review.

Actually the implementation is barely trivial; something like this
should work (including tool-bar and menu-bar) because the redo icon is
already there; so we only add the bindings for it until it will be added
by default:

(defvar undo-redo-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map [remap undo] 'undo-only)
    (define-key map (kbd "C-?") 'undo-redo)
    (define-key map (kbd "M-_") 'undo-redo)
    map))

(define-minor-mode undo-redo-mode
  "Replace undo with undo-only and enables undo-redo."
  :global t
  :keymap undo-redo-mode-map
  :group 'undo
  )

As it seems like the redo will stay by default as well as the bindings,
then the mode is probably not needed and the user could just bind:

(define-key global-map [remap undo] 'undo-only)

if he don't like to use the default undo.

If we remove the redo from the menu and toolbar and or the default
bindings; then some other small changes will be needed and will make
sense to have this mode. But so far nobody complained about the redo
icon and personally I don't really care too much.


reply via email to

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