unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: one.last.kiss@outlook.com, 65735@debbugs.gnu.org
Subject: bug#65735: [PATCH] key-translate should use the 1st key of a key sequence
Date: Thu, 07 Sep 2023 13:57:14 +0200	[thread overview]
Message-ID: <87a5tyfb6t.fsf@gmail.com> (raw)
In-Reply-To: <83zg1yz9e7.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 07 Sep 2023 11:15:44 +0300")

>>>>> On Thu, 07 Sep 2023 11:15:44 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> Cc: 65735@debbugs.gnu.org
    >> From: Robert Pluim <rpluim@gmail.com>
    >> Date: Thu, 07 Sep 2023 09:54:13 +0200
    >> 
    >> I see commits from you both with and without
    >> Copyright-paperwork-exempt, do you have a copyright assignment on
    >> file?

    Eli> He does, now.

OK. Then Iʼll push it to emacs-29, since otherwise `key-translate' is
completely useless.

In the interests of, uhm, eating our own dogfood, how about the
following as well for master (or should I let sleeping dogs lie 😺)

diff --git i/lisp/simple.el w/lisp/simple.el
index 05a3c4b93d6..da9db1685c4 100644
--- i/lisp/simple.el
+++ w/lisp/simple.el
@@ -10658,10 +10658,10 @@ normal-erase-is-backspace-mode
 	  (t
 	   (if enabled
 	       (progn
-		 (keyboard-translate ?\C-h ?\C-?)
-		 (keyboard-translate ?\C-? ?\C-d))
-	     (keyboard-translate ?\C-h ?\C-h)
-	     (keyboard-translate ?\C-? ?\C-?))))
+		 (key-translate "C-h" "DEL")
+		 (key-translate "DEL" "C-d"))
+	     (key-translate "C-h" "C-h")
+	     (key-translate "DEL" "DEL"))))
 
     (if (called-interactively-p 'interactive)
 	(message "Delete key deletes %s"
diff --git i/lisp/term/bobcat.el w/lisp/term/bobcat.el
index 983c8cded2f..2f611953523 100644
--- i/lisp/term/bobcat.el
+++ w/lisp/term/bobcat.el
@@ -3,8 +3,8 @@
 (defun terminal-init-bobcat ()
   "Terminal initialization function for bobcat."
   ;; HP terminals usually encourage using ^H as the rubout character
-  (keyboard-translate ?\177 ?\^h)
-  (keyboard-translate ?\^h ?\177))
+  (key-translate "DEL "C-h")
+  (key-translate "C-h "DEL"))
 
 (provide 'term/bobcat)
 

Robert
-- 





  reply	other threads:[~2023-09-07 11:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-04 15:46 bug#65735: [PATCH] key-translate should use the 1st key of a key sequence Shynur Xie
2023-09-07  7:54 ` Robert Pluim
2023-09-07  8:15   ` Eli Zaretskii
2023-09-07 11:57     ` Robert Pluim [this message]
2023-09-07 13:09       ` Eli Zaretskii
2023-09-07 14:01         ` Stefan Kangas
2023-09-18  9:49           ` Robert Pluim
2023-09-07 13:42       ` Shynur Xie
2023-09-07 13:49         ` Robert Pluim

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=87a5tyfb6t.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=65735@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=one.last.kiss@outlook.com \
    /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).