unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28931: 24.5; cua-mode does not replace keyboard shortcuts in Edit menu
@ 2017-10-21 19:30 Bruno Haible
  2021-07-02 15:40 ` bug#28930: " Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Bruno Haible @ 2017-10-21 19:30 UTC (permalink / raw)
  To: 28931

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






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#28930: 24.5; cua-mode does not replace keyboard shortcuts in Edit menu
  2017-10-21 19:30 bug#28931: 24.5; cua-mode does not replace keyboard shortcuts in Edit menu Bruno Haible
@ 2021-07-02 15:40 ` Lars Ingebrigtsen
  2021-07-31 16:19   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-02 15:40 UTC (permalink / raw)
  To: Bruno Haible; +Cc: 28931, 28930

Bruno Haible <bruno@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#28930: 24.5; cua-mode does not replace keyboard shortcuts in Edit menu
  2021-07-02 15:40 ` bug#28930: " Lars Ingebrigtsen
@ 2021-07-31 16:19   ` Lars Ingebrigtsen
  2021-10-11 11:18     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-07-31 16:19 UTC (permalink / raw)
  To: Bruno Haible; +Cc: 28931, 28930

Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#28930: 24.5; cua-mode does not replace keyboard shortcuts in Edit menu
  2021-07-31 16:19   ` Lars Ingebrigtsen
@ 2021-10-11 11:18     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-11 11:18 UTC (permalink / raw)
  To: Bruno Haible; +Cc: 28931, 28930

Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-11 11:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-21 19:30 bug#28931: 24.5; cua-mode does not replace keyboard shortcuts in Edit menu Bruno Haible
2021-07-02 15:40 ` bug#28930: " Lars Ingebrigtsen
2021-07-31 16:19   ` Lars Ingebrigtsen
2021-10-11 11:18     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).