GNU bug report logs - #22566
24.5; Make shift key translation a customizable feature

Previous Next

Package: emacs;

Reported by: Aura Kelloniemi <kaura.dev <at> sange.fi>

Date: Fri, 5 Feb 2016 15:42:02 UTC

Severity: wishlist

Found in version 24.5

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 22566 in the body.
You can then email your comments to 22566 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#22566; Package emacs. (Fri, 05 Feb 2016 15:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aura Kelloniemi <kaura.dev <at> sange.fi>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 05 Feb 2016 15:42:02 GMT) Full text and rfc822 format available.

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

From: Aura Kelloniemi <kaura.dev <at> sange.fi>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; Make shift key translation a customizable feature
Date: Fri, 05 Feb 2016 17:40:31 +0200
Some people consider the shift translation done by Emacs to be a misfeature. I
agree with them. This is because when I accidentally press a key combination
which is not bound to any command, I would like to receive an error message
rather than running another command which I did not intend to run.

There is a long discussion about this issue at:
http://unix.stackexchange.com/questions/25649/is-it-possible-to-stop-emacs-from-down-translating-my-key-chords

I wish that shift translation would be made a customizable feature. It causes
me a lot of trouble because I'm testing new key mappings for the linux console
(I'm making the shifted function keys to work in it) and shift translation in
Emacs makes it harder to tell if Emacs got the information about used shift
state right or not. (And no, Emacs does not always report that a key is
shift-translated. E.g. when I press <C-h> d <C-M-S-down>, I get "<C-M-down>
runs the command down-list" instead of "<C-M-down> (translated from
<C-M-S-down>) runs the command down-list".)

Thank you for your time!







In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.6)
 of 2015-09-10 on foutrelis
Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64
 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: fi_FI.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Messages

Minor modes in effect:
  minibuffer-electric-default-mode: t
  icomplete-mode: t
  diff-auto-refine-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-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
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t

Recent messages:
w3m init file loaded
Loading term/xterm...done
<C-M-right> runs the command forward-sexp [2 times]
<C-M-S-SPC> is undefined
<C-M-home> runs the command beginning-of-defun
Entering debugger...
beginning-of-buffer
End of buffer
Mark set
<C-M-S-up> runs the command beginning-of-buffer
customize-apropos: No customizable group, face, or option matching (shift translation)

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail apropos cus-edit mule-util help-mode
debug xterm w3m-filter w3m browse-url doc-view jka-compr dired image-mode
timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon
w3m-image w3m-proc w3m-util recentf tree-widget haskell-interactive-mode
haskell-presentation-mode haskell-collapse haskell-process haskell-session
url-util url-parse auth-source eieio byte-opt bytecomp byte-compile cl-extra
cconv eieio-core gnus-util time-date url-vars json haskell-navigate-imports
haskell-compile haskell-cabal haskell-utils haskell-mode haskell-font-lock
haskell-indentation haskell-string haskell-sort-imports haskell-lexeme rx
haskell-align-imports haskell-compat haskell-complete-module noutline outline
flymake etags compile comint ring dabbrev ansi-color haskell-customize
minibuf-eldef ido icomplete company pcase cus-start cus-load notmuch hl-line
notmuch-message notmuch-maildir-fcc notmuch-hello edmacro kmacro wid-edit
notmuch-tree notmuch-parser notmuch-show notmuch-print notmuch-crypto
notmuch-mua notmuch-address notmuch-wash diff-mode easy-mmode coolj
notmuch-query goto-addr thingatpt icalendar diary-lib diary-loaddefs cal-menu
calendar cal-loaddefs notmuch-tag crm notmuch-lib advice notmuch-version cl gv
cl-loaddefs cl-lib message idna format-spec rfc822 mml mailabbrev mail-utils
gmm-utils mailheader mm-view mml-smime mml-sec smime password-cache dig
mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util help-fns mail-prsvr dired-single align info easymenu
package epg-config server 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 248314 12028)
 (symbols 48 34301 0)
 (miscs 40 52 175)
 (strings 32 64995 9219)
 (string-bytes 1 1799366)
 (vectors 16 25718)
 (vector-slots 8 561196 8681)
 (floats 8 160 192)
 (intervals 56 265 0)
 (buffers 960 13)
 (heap 1024 27864 941))

-- 
Aura




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22566; Package emacs. (Sun, 07 Feb 2016 17:47:02 GMT) Full text and rfc822 format available.

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

From: Aura Kelloniemi <kaura.dev <at> sange.fi>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#22566: 24.5; Make shift key translation a customizable feature
Date: Sun, 07 Feb 2016 19:46:26 +0200
Hello and thank you for your response!

Richard Stallman <rms <at> gnu.org> writes:
 > What is "shift key translation"?

Sorry for being inaccurate.

Shift translation is described in keyboard.c in Emacs source code like this:

/* If KEY is not defined in any of the keymaps,
   and cannot be part of a function key or translation,
   and is a shifted function key,
   use the corresponding unshifted function key instead.  */

Shift translation is documented in Key Sequence Input:

  If an input character is upper-case (or has the shift modifier) and has no
  key binding, but its lower-case equivalent has one, then read-key-sequence
  converts the character to lower case. Note that
  lookup-key does not perform case conversion in this way.

-- 
Aura




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22566; Package emacs. (Wed, 10 Feb 2016 17:16:02 GMT) Full text and rfc822 format available.

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

From: Aura Kelloniemi <kaura.dev <at> sange.fi>
To: rms <at> gnu.org, bug-gnu-emacs <at> gnu.org
Subject: Re: bug#22566: 24.5; Make shift key translation a customizable feature
Date: Wed, 10 Feb 2016 19:15:31 +0200
Richard Stallman <rms <at> gnu.org> writes:

 > Thanks, now I see.  The idea of this is so the shifted keys
 > by default have the same meaning as the unshifted ones.

One of my points is that this behaviour is not logical. There is no similar
functionality available for other modifier keys (ctonrol, alt, meta, super,
hyper, etc.).

When working with text terminals it happens often that some key combinations
sends the same escape seuqnce for plain key press and shifted key press.
Sometimes termcap is lacking correct information and emacs does not interpret
the sequence correctly. Emacs' shift translation adds yet another step for
debugging these issues.

Shift translation may be useful to some people and I'm not asking for removing
it from emacs, just making it customizable - it shouldn't be a big change.

 > Why is it a problem for you?

Well, two reasons:

First reason is that sometimes I press wrong keys, and instead of reporting an
error, emacs does something else - it tries to guess what I wanted, and
probably gets it wrong. This happens often if I open an Org file in text-mode
(because the file's extension is not .org, this happens automatically). Then I
forget that I'm not in org-mode and use shifted arrow keys, but of course they
don't work in a way I expected.

The other problem is that I've lately been adding support for shifted function
keys to my Linux console keymap. Emacs' shift translation has made my
debugging harder, because when I use the describe-key-briefly command to check
if emacs got a shifted function key right, it just reports something like
this: "<C-right> runs the command right-word" even though I pressed
<C-S-Right>. But when I open an org-file in org-mode and try the same key
combination, emacs now says: "<C-S-right> runs the command
org-shiftcontrolright". Describe-key-briefly should at least report that it is
doing some translation. It already does this reporting for non-function keys.

There is a question about this issues on stackexchange, to which I posted a
link in my original message. There the OP is complaining about the same things
that I am, mostly, but adds some other points.

The link is here again, for reference:
http://unix.stackexchange.com/questions/25649/is-it-possible-to-stop-emacs-from-down-translating-my-key-chords

-- 
Aura




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22566; Package emacs. (Fri, 12 Feb 2016 12:32:02 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Aura Kelloniemi <kaura.dev <at> sange.fi>
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#22566: 24.5; Make shift key translation a customizable feature
Date: Fri, 12 Feb 2016 07:31:32 -0500
[[[ 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. ]]]

  > The other problem is that I've lately been adding support for shifted function
  > keys to my Linux console keymap. Emacs' shift translation has made my
  > debugging harder, because when I use the describe-key-briefly command to check
  > if emacs got a shifted function key right, it just reports something like
  > this: "<C-right> runs the command right-word" even though I pressed
  > <C-S-Right>. But when I open an org-file in org-mode and try the same key
  > combination, emacs now says: "<C-S-right> runs the command
  > org-shiftcontrolright".

You could give C-S-Right a definition (same as that of C-Right)
and that would turn off the translation.

			    Describe-key-briefly should at least report that it is
  > doing some translation. It already does this reporting for non-function keys.

I agree.

-- 
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22566; Package emacs. (Sun, 15 Aug 2021 13:05:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Aura Kelloniemi <kaura.dev <at> sange.fi>
Cc: 22566 <at> debbugs.gnu.org
Subject: Re: bug#22566: 24.5; Make shift key translation a customizable feature
Date: Sun, 15 Aug 2021 15:03:44 +0200
Aura Kelloniemi <kaura.dev <at> sange.fi> writes:

> Some people consider the shift translation done by Emacs to be a misfeature. I
> agree with them. This is because when I accidentally press a key combination
> which is not bound to any command, I would like to receive an error message
> rather than running another command which I did not intend to run.

I think that sounds like a reasonable user option.  I think all of this
is done in read_key_sequence?  Skimming that 1K-line function, it
doesn't look like a difficult thing to implement.

Does anybody else 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. (Sun, 15 Aug 2021 13:05:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22566; Package emacs. (Mon, 13 Sep 2021 09:15:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Aura Kelloniemi <kaura.dev <at> sange.fi>
Cc: 22566 <at> debbugs.gnu.org
Subject: Re: bug#22566: 24.5; Make shift key translation a customizable feature
Date: Mon, 13 Sep 2021 11:14:12 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I think that sounds like a reasonable user option.  I think all of this
> is done in read_key_sequence?  Skimming that 1K-line function, it
> doesn't look like a difficult thing to implement.
>
> Does anybody else have an opinion here?

Nobody had, so I went ahead and implemented this.  However, I think
we're too close to the Emacs 28 release to push such a low-level change,
so it'll have to wait until Emacs 29.

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




Added tag(s) pending. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 13 Sep 2021 09:15:02 GMT) Full text and rfc822 format available.

Removed tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 13 Sep 2021 09:15:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22566; Package emacs. (Mon, 13 Sep 2021 09:23:02 GMT) Full text and rfc822 format available.

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

From: Aura Kelloniemi <kaura.dev <at> sange.fi>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 22566 <at> debbugs.gnu.org
Subject: Re: bug#22566: 24.5; Make shift key translation a customizable feature
Date: Mon, 13 Sep 2021 12:22:29 +0300
On 2021-09-13 at 11:14 +0200, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
 > Lars Ingebrigtsen <larsi <at> gnus.org> writes:

 > > I think that sounds like a reasonable user option.  I think all of this
 > > is done in read_key_sequence?  Skimming that 1K-line function, it
 > > doesn't look like a difficult thing to implement.
 > Nobody had, so I went ahead and implemented this.  However, I think
 > we're too close to the Emacs 28 release to push such a low-level change,
 > so it'll have to wait until Emacs 29.

Great! Thank you. I use Emacs' development branch anyway.

-- 
Aura




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22566; Package emacs. (Mon, 04 Oct 2021 10:35:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Aura Kelloniemi <kaura.dev <at> sange.fi>
Cc: 22566 <at> debbugs.gnu.org
Subject: Re: bug#22566: 24.5; Make shift key translation a customizable feature
Date: Mon, 04 Oct 2021 12:34:15 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Nobody had, so I went ahead and implemented this.  However, I think
> we're too close to the Emacs 28 release to push such a low-level change,
> so it'll have to wait until Emacs 29.

I've now pushed this to Emacs 29.

-- 
(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 22566 <at> debbugs.gnu.org and Aura Kelloniemi <kaura.dev <at> sange.fi> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 04 Oct 2021 10:35: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, 01 Nov 2021 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 170 days ago.

Previous Next


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