From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64927: 30.0.50; kill-ring with no X Date: Thu, 03 Aug 2023 12:51:23 +0300 Message-ID: <838rasxxlw.fsf@gnu.org> References: <87edkrdp78.fsf@yandex.com> <87a5vfdko3.fsf@yandex.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6202"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64927@debbugs.gnu.org, Lars Ingebrigtsen To: m43cap@yandex.com, Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 03 12:04:36 2023 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 1qRVC7-0001EY-KN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 03 Aug 2023 12:04:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qRV02-0002hF-4S; Thu, 03 Aug 2023 05:52:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRUzz-0002gs-H8 for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2023 05:52:05 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qRUzy-0002e5-W6 for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2023 05:52:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qRUzy-0004ow-Ea for bug-gnu-emacs@gnu.org; Thu, 03 Aug 2023 05:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 03 Aug 2023 09:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64927 X-GNU-PR-Package: emacs Original-Received: via spool by 64927-submit@debbugs.gnu.org id=B64927.169105628318482 (code B ref 64927); Thu, 03 Aug 2023 09:52:02 +0000 Original-Received: (at 64927) by debbugs.gnu.org; 3 Aug 2023 09:51:23 +0000 Original-Received: from localhost ([127.0.0.1]:50911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRUzL-0004o2-4w for submit@debbugs.gnu.org; Thu, 03 Aug 2023 05:51:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qRUzJ-0004np-0b for 64927@debbugs.gnu.org; Thu, 03 Aug 2023 05:51:22 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRUzC-0002Rd-Rz; Thu, 03 Aug 2023 05:51:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Ihf1wQqdZPGra6b7WsLmoGy7fc4y7hE8vBwqSp+G9w0=; b=og9BxARiSOM5 V0NoIgs93ZCQrfFJuw7s2eJPVCq2sMO9sX8/3z04dAm3GfHieWAk1eGnUhKMYlxG3k19/J0Zl+tLe n0GX0E8lSzZ2oRyZRDjcACdFo4v7q0yAauXPZAUhyvVAHAoQQjX4GFTxgcD7RbOCPlUTH/Fl8ZTpY qyi+uR2sUGYm7WrsLE2PE2k60PPimEtJ+aW/n6iI+UddWkuErDlSjqomZDvWUlHiiZusgMCuqolNs tRrm234sKa19ldomqN7oVimPMnKoc3E/JDrJwl7opT1Db9feaVP73tNxbwypJmJMVikKJHaO5EIMl WC/RIjbqX9u9MHhRNQFKvw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qRUzC-00023N-BP; Thu, 03 Aug 2023 05:51:14 -0400 In-Reply-To: <87a5vfdko3.fsf@yandex.com> (message from Colin Baxter on Sat, 29 Jul 2023 12:25:16 +0100) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266577 Archived-At: > From: Colin Baxter > Date: Sat, 29 Jul 2023 12:25:16 +0100 > > >>>>> Colin Baxter writes: > > > 1. Emacs-30.0.50 compiled --with-x-toolkit=no > > 2. emacs -Q > > 3. C-x C-f test.txt > > 4. Enter some text, e.g. "This is a test." > > 5. Enter some more text, e.g. "This is another test." > > 6. Place the cursor somewhere and press > > 7. Select Edit --> Paste from kill menu --> This is test. > > 8. popup-menu: Invalid > > `key-parse' syntax: %S: ["This is a test"] > > Forget to mention that the text 4, 5 has of course to be copied to the > kill-ring using C- M-w. Sorry about that! I can reproduce the same problem on a TTY frame by activating the menu with F10, but not if the menu is activated with a mouse (on a text-mode terminal that has a mouse). Do you see the same problem in the non-toolkit build if you use the mouse instead of the keyboard? This also affects Emacs 29, and is a regression from Emacs 28, which is related to the use of the new key-* functions. Specifically, the error is signaled by the call to key-valid-p issued by possibly_translate_key_sequence, which is a subroutine of lookup-key. The argument KEY of possibly_translate_key_sequence in this case is a vector whose only element is a string with text properties: [#("create a file" 0 13 (face font-lock-comment-face fontified t))] key-valid-p doesn't support such strings, it expects strings that describe key sequences. Significantly, possibly_translate_key_sequence calls key-parse after it calls key-valid-p, and key-parse copes with this string quite well. So I'm thinking of removing the key-valid-p call from possibly_translate_key_sequence, since I believe key-parse can detect any problems by itself? Stefan, WDYT? Colin, can you try such a change and see if it produces any regressions?