From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#45834: 28.0.50; Mouse events in terminal emacs Date: Wed, 08 Sep 2021 22:22:48 -0400 Message-ID: References: <4653d6b7-8824-4113-ac5a-2793b9d84c8c@www.fastmail.com> <87k0s9mnxs.fsf@gnus.org> <87v9bthryl.fsf@gnus.org> <831reh7x8x.fsf@gnu.org> <87mtx5hr2d.fsf@gnus.org> <87pmtj1kdv.fsf@gnus.org> <83y287mm4a.fsf@gnu.org> <87sfyfz93a.fsf@gnus.org> <83v93bmd0k.fsf@gnu.org> <87wnnrxkrw.fsf@gnus.org> <83o893mc1g.fsf@gnu.org> <83mtonmbs5.fsf@gnu.org> <87fsufxjzq.fsf@gnus.org> <83ilzbmay6.fsf@gnu.org> <83a6knm4t7.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11255"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, 45834@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 09 04:24:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mO9jW-0002f8-HN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 09 Sep 2021 04:24:10 +0200 Original-Received: from localhost ([::1]:54648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mO9jU-0007cA-LJ for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Sep 2021 22:24:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO9jO-0007bm-Gw for bug-gnu-emacs@gnu.org; Wed, 08 Sep 2021 22:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50497) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mO9jO-0007Ox-9d for bug-gnu-emacs@gnu.org; Wed, 08 Sep 2021 22:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mO9jO-0003HI-1O for bug-gnu-emacs@gnu.org; Wed, 08 Sep 2021 22:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 09 Sep 2021 02:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45834 X-GNU-PR-Package: emacs Original-Received: via spool by 45834-submit@debbugs.gnu.org id=B45834.163115418312529 (code B ref 45834); Thu, 09 Sep 2021 02:24:01 +0000 Original-Received: (at 45834) by debbugs.gnu.org; 9 Sep 2021 02:23:03 +0000 Original-Received: from localhost ([127.0.0.1]:33810 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mO9iQ-0003G0-Jv for submit@debbugs.gnu.org; Wed, 08 Sep 2021 22:23:02 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58106) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mO9iM-0003FG-24 for 45834@debbugs.gnu.org; Wed, 08 Sep 2021 22:23:01 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 309B8808DF; Wed, 8 Sep 2021 22:22:57 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 5BF3E8058E; Wed, 8 Sep 2021 22:22:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1631154175; bh=0BCE4AojOPah5tYgMI5LDLoJByEqzWKnmnNCQMCtb7M=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=R3roqUlto3faInq2sM6pHmm2ONkBHZud73ACEch5bvIqfS1cG7dMYchCg0KaKNXvO uEzazs/RxwsNUnFx9/t3Z0w3awjkuY65ZKvqy2C3gwutmgfszs/5SZ5vjTr/XJxaFU SnXVh67vhQW9dkTqwf5mv1FV/5WT3nACP8r+UPbZlIrmngf6fGIAHtCttrHG35Yg1I sHoAprQGWTMXxGifakRC2ykJII6h3lEEQb1HZhUsdW7J3c6VmwFx22UxLGCdzQ8aKy AirULQggdEROpzrqvz6DTW+10nx5H69x5r4WLhZoIzRTdgOpCNi0P2TNTidRjRUQhX yiEE5c+yWe0CA== Original-Received: from pastel (unknown [104.247.244.135]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6ECEB120270; Wed, 8 Sep 2021 22:22:50 -0400 (EDT) In-Reply-To: <83a6knm4t7.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 Sep 2021 19:04:52 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:213869 Archived-At: Eli wrote: > I meant the original input: "ESC [ I" This should be a complete key > sequence, given the following: > > (define-key map "\e[I" #'xterm-translate-focus-in) `xterm-translate-focus-in` works at the level of keysequence remapping, so "ESC [ I" is indeed a complete sequence but *for a remapping* and it's remapped to the empty keysequence, which is not a complete keysequence. In the sense of `C-h k`, "\e[I" is not bound to `xterm-translate-focus-in`. AFAIK we don't currently have a command to query which key-remapping happened for a given sequence of events, IOW, there is no equivalent to `C-h k` that could tell the user that "\e[I" is "bound" to `xterm-translate-focus-in`. The closest that we have is that `C-h k` will tell the users both the remapped keysequence and the original ("untranslated") keysequence. > But for some reason, "C-h k" thinks it's an incomplete key sequence, > because "C-h k" followed by a click on a different frame displays > "ESC [ I-" (note the dash). Do you understand why this happens? Yes because "ESC [ I" is not a sequence of events that is sufficient to successfully find a command bound to it in the normal keymaps (global map, local map, minor mode maps, ...). It's only bound in the key-remapping maps, which are handled at another level (e.g. when the users hit `C-h k mouse-1` in an xterm, they are told which command `mouse-1` runs rather than which function was used to remap the byte sequence into the `mouse-1` event). Lars wrote: > It's not so much wrong as just pretty confusing. That is, the original > complaint is that saying `C-h k' and then focusing on some other app > will leave Emacs saying "Describe the following ...: ESC [ O -", which > wasn't the case in Emacs 26 (because we hadn't enabled mouse-in/out in > xterm.el). Indeed, the echoed keys are poor here. I don't know why we have that here: when I bind `f6` to a prefix keymap and I hit `f6` in xterm, I see `f6-` in the echo area rather than `M-[ 1 7~-`, so there's something odd going on, but AFAICT the problem is "cosmetic" in the sense that it only affects the echoed keys. I thought the bug report here was about a problem beyond the set of keys that were echoed. Stefan