unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22566: 24.5; Make shift key translation a customizable feature
@ 2016-02-05 15:40 Aura Kelloniemi
       [not found] ` <E1aS8px-0007MP-F4@fencepost.gnu.org>
  2021-08-15 13:03 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Aura Kelloniemi @ 2016-02-05 15:40 UTC (permalink / raw)
  To: 22566


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





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

* bug#22566: 24.5; Make shift key translation a customizable feature
       [not found]   ` <874mdlobij.fsf@sange.fi>
@ 2016-02-07 17:46     ` Aura Kelloniemi
       [not found]     ` <E1aSUBU-0005r3-18@fencepost.gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Aura Kelloniemi @ 2016-02-07 17:46 UTC (permalink / raw)
  To: 22566

Hello and thank you for your response!

Richard Stallman <rms@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





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

* bug#22566: 24.5; Make shift key translation a customizable feature
       [not found]     ` <E1aSUBU-0005r3-18@fencepost.gnu.org>
@ 2016-02-10 17:15       ` Aura Kelloniemi
  2016-02-12 12:31         ` Richard Stallman
  0 siblings, 1 reply; 8+ messages in thread
From: Aura Kelloniemi @ 2016-02-10 17:15 UTC (permalink / raw)
  To: rms, 22566

Richard Stallman <rms@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





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

* bug#22566: 24.5; Make shift key translation a customizable feature
  2016-02-10 17:15       ` Aura Kelloniemi
@ 2016-02-12 12:31         ` Richard Stallman
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Stallman @ 2016-02-12 12:31 UTC (permalink / raw)
  To: Aura Kelloniemi; +Cc: 22566

[[[ 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.






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

* bug#22566: 24.5; Make shift key translation a customizable feature
  2016-02-05 15:40 bug#22566: 24.5; Make shift key translation a customizable feature Aura Kelloniemi
       [not found] ` <E1aS8px-0007MP-F4@fencepost.gnu.org>
@ 2021-08-15 13:03 ` Lars Ingebrigtsen
  2021-09-13  9:14   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-15 13:03 UTC (permalink / raw)
  To: Aura Kelloniemi; +Cc: 22566

Aura Kelloniemi <kaura.dev@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





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

* bug#22566: 24.5; Make shift key translation a customizable feature
  2021-08-15 13:03 ` Lars Ingebrigtsen
@ 2021-09-13  9:14   ` Lars Ingebrigtsen
  2021-09-13  9:22     ` Aura Kelloniemi
  2021-10-04 10:34     ` Lars Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-13  9:14 UTC (permalink / raw)
  To: Aura Kelloniemi; +Cc: 22566

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





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

* bug#22566: 24.5; Make shift key translation a customizable feature
  2021-09-13  9:14   ` Lars Ingebrigtsen
@ 2021-09-13  9:22     ` Aura Kelloniemi
  2021-10-04 10:34     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 8+ messages in thread
From: Aura Kelloniemi @ 2021-09-13  9:22 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 22566

On 2021-09-13 at 11:14 +0200, Lars Ingebrigtsen <larsi@gnus.org> wrote:
 > Lars Ingebrigtsen <larsi@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





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

* bug#22566: 24.5; Make shift key translation a customizable feature
  2021-09-13  9:14   ` Lars Ingebrigtsen
  2021-09-13  9:22     ` Aura Kelloniemi
@ 2021-10-04 10:34     ` Lars Ingebrigtsen
  1 sibling, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-10-04 10:34 UTC (permalink / raw)
  To: Aura Kelloniemi; +Cc: 22566

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





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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-05 15:40 bug#22566: 24.5; Make shift key translation a customizable feature Aura Kelloniemi
     [not found] ` <E1aS8px-0007MP-F4@fencepost.gnu.org>
     [not found]   ` <874mdlobij.fsf@sange.fi>
2016-02-07 17:46     ` Aura Kelloniemi
     [not found]     ` <E1aSUBU-0005r3-18@fencepost.gnu.org>
2016-02-10 17:15       ` Aura Kelloniemi
2016-02-12 12:31         ` Richard Stallman
2021-08-15 13:03 ` Lars Ingebrigtsen
2021-09-13  9:14   ` Lars Ingebrigtsen
2021-09-13  9:22     ` Aura Kelloniemi
2021-10-04 10:34     ` 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).