Subject: bug#28931: bug#28930: 24.5; cua-mode does not replace keyboard shortcuts in Edit menu

From: Lars Ingebrigtsen <[email-masked]>
Date: Fri, 02 Jul 2021 17:40:41 +0200

Bruno Haible <[email-masked]> writes:

> Someone has this customization in his ~/.emacs file:
>   (cua-mode 1)
>
> This has the effect of enabling CUA mode. But the user is not
> aware of it, because the Edit menu displays:
>
>   Undo  C-x u
>   Cut   C-w
>   Copy  M-w
>
> As a consequence, the user does not feel familiar with this
> editor and does not dare to use the keystrokes he's familar with
> (Ctrl-C for Copy etc.).
>
> Suggestion: Make the Edit menu display
>
>   Undo  C-z
>   Cut   C-x
>   Copy  C-c
>
> Then the user would feel familiar and could use these
> keybindings without thinking about them.

(I'm going through old bug reports that unfortunately got little response at
the time.)

Let's see...  this is from this stuff:

    (bindings--define-key menu [copy]
      ;; ns-win.el said: Substitute a Copy function that works better
      ;; under X (for GNUstep).
      `(menu-item "Copy" ,(if (featurep 'ns)
                              'ns-copy-including-secondary
                            'kill-ring-save)
                  :enable mark-active
                  :help "Copy text in region between mark and current position"
                  :keys ,(if (featurep 'ns)
                             "\\[ns-copy-including-secondary]"
                           "\\[kill-ring-save]")))

(etc)

I guess we could add a case for cua-mode in the :keys here, too?  I've
never ever used cua-mode myself, though...  C-x and C-x only work when
the region is active in cua-mode, I think?  So...  would it be accurate
to put them in the menu?  I mean, we could check for an active region,
too, but would that be confusing?

Anybody have an opinion here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no