unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: 37769@debbugs.gnu.org
Subject: bug#37769: global-set-key wrongly downcases the typed key (e.g. S-tab).
Date: Tue, 15 Oct 2019 19:07:26 +0000	[thread overview]
Message-ID: <20191015190726.GA6315@ACM> (raw)

Hello, Emacs

On the master branch, global-set-key calls read-key-sequence, but wrongly
fails to set the DONT-DOWNCASE-LAST argument.  The doc-string for
read-key-sequence rightly notes "A non-nil value is appropriate for
reading a key sequence to be defined.".

As a consequence, it is impossible to use M-x global-set-key to bind
S-tab on a tty where local-function-key-map converts S-tab to [33554441]
= 2^25 + 9.

The fix is easy:

diff --git a/lisp/subr.el b/lisp/subr.el
index 1a4a2e8b81..f3371dd2d7 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1120,7 +1120,7 @@ global-set-key
 that you make with this function."
   (interactive
    (let* ((menu-prompting nil)
-          (key (read-key-sequence "Set key globally: ")))
+          (key (read-key-sequence "Set key globally: " nil t)))
      (list key
            (read-command (format "Set key %s to command: "
                                  (key-description key))))))

This fix should also be safe, since it is only in the interactive spec
part of the function, and thus can only affect interactive use.

Any objections to me installing this fix on the master branch?

-- 
Alan Mackenzie (Nuremberg, Germany).





             reply	other threads:[~2019-10-15 19:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 19:07 Alan Mackenzie [this message]
2019-10-17  3:00 ` bug#37769: global-set-key wrongly downcases the typed key (e.g. S-tab) Lars Ingebrigtsen
2019-10-17  8:16   ` Eli Zaretskii
2019-10-17 15:58   ` Alan Mackenzie
2019-10-18  3:09     ` Lars Ingebrigtsen
2019-10-18  7:11       ` Eli Zaretskii
2019-10-19  8:02         ` Lars Ingebrigtsen
2019-10-19  8:53           ` Andreas Schwab
2019-10-19  9:03             ` Lars Ingebrigtsen
2019-10-19  9:36           ` Eli Zaretskii
2019-10-19 18:26             ` Alan Mackenzie
2019-10-17  9:17 ` Andreas Schwab
2019-10-17 16:00   ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191015190726.GA6315@ACM \
    --to=acm@muc.de \
    --cc=37769@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).