GNU bug report logs - #28931
24.5; cua-mode does not replace keyboard shortcuts in Edit menu

Previous Next

Package: emacs;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Sat, 21 Oct 2017 19:35:01 UTC

Severity: minor

Tags: confirmed

Merged with 28930

Found in versions 24.5, 28.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28931 in the body.
You can then email your comments to 28931 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28931; Package emacs. (Sat, 21 Oct 2017 19:35:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruno Haible <bruno <at> clisp.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 21 Oct 2017 19:35:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; cua-mode does not replace keyboard shortcuts in Edit menu
Date: Sat, 21 Oct 2017 21:30:59 +0200
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.


In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2017-09-20 on lcy01-07, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11804000
System Description:	Ubuntu 16.04.1 LTS

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Important settings:
  value of $LC_MONETARY: de_DE.UTF-8
  value of $LC_NUMERIC: de_DE.UTF-8
  value of $LC_TIME: de_DE.UTF-8
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  delete-selection-mode: t
  cua-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
Loading /etc/emacs/site-start.d/50python-docutils.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
Quit
CUA mode disabled.
Cua mode enabled
Quit
Making completion list...

Load-path shadows:
/usr/share/emacs/24.5/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/cmake-data/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/24.5/lisp/textmodes/rst

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
help-fns mail-prsvr mail-utils cus-start cus-load help-mode easymenu
delsel cua-base time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 83203 6129)
 (symbols 48 18758 0)
 (miscs 40 40 74)
 (strings 32 11287 3748)
 (string-bytes 1 294567)
 (vectors 16 9191)
 (vector-slots 8 385762 15172)
 (floats 8 69 120)
 (intervals 56 230 1)
 (buffers 960 12)
 (heap 1024 47156 969))





Merged 28930 28931. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 21 Oct 2017 20:07:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sat, 22 Aug 2020 19:24:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 28.0.50. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sat, 22 Aug 2020 19:24:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28931; Package emacs. (Fri, 02 Jul 2021 15:41:02 GMT) Full text and rfc822 format available.

Message #14 received at 28931 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Bruno Haible <bruno <at> clisp.org>
Cc: 28931 <at> debbugs.gnu.org, 28930 <at> debbugs.gnu.org
Subject: Re: bug#28930: 24.5; cua-mode does not replace keyboard shortcuts
 in Edit menu
Date: Fri, 02 Jul 2021 17:40:41 +0200
Bruno Haible <bruno <at> clisp.org> 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




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 02 Jul 2021 15:42:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28931; Package emacs. (Sat, 31 Jul 2021 16:21:02 GMT) Full text and rfc822 format available.

Message #19 received at 28931 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Bruno Haible <bruno <at> clisp.org>
Cc: 28931 <at> debbugs.gnu.org, 28930 <at> debbugs.gnu.org
Subject: Re: bug#28930: 24.5; cua-mode does not replace keyboard shortcuts
 in Edit menu
Date: Sat, 31 Jul 2021 18:19:49 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> 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?

No, we can't -- that has to be computed dynamically, and :keys doesn't
allow that.  I think?

I tried to use :filter, but it couldn't figure out how to use that to
return a dynamically generated menu item -- is that even possible?

Perhaps we should just allow :keys to be a lambda?  Any opinions?

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




Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 29 Aug 2021 20:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28931; Package emacs. (Mon, 11 Oct 2021 11:19:02 GMT) Full text and rfc822 format available.

Message #24 received at 28931 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Bruno Haible <bruno <at> clisp.org>
Cc: 28931 <at> debbugs.gnu.org, 28930 <at> debbugs.gnu.org
Subject: Re: bug#28930: 24.5; cua-mode does not replace keyboard shortcuts
 in Edit menu
Date: Mon, 11 Oct 2021 13:18:31 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Perhaps we should just allow :keys to be a lambda?  Any opinions?

Nobody had an opinion in ten weeks, so I went ahead and implemented it
(and fixed the keyboard shortcuts in the Edit menu).

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




bug marked as fixed in version 29.1, send any further explanations to 28930 <at> debbugs.gnu.org and Bruno Haible <bruno <at> clisp.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 11 Oct 2021 11:19:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Nov 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 229 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.