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.devel Subject: Re: easy-menu-define keys for key-valid-p (was: Info-mode patch) Date: Tue, 04 Jul 2023 14:33:25 +0300 Message-ID: <83r0pnlxmi.fsf@gnu.org> References: <867cropyh3.fsf@mail.linkov.net> <86mt0kulli.fsf@mail.linkov.net> <86wmzmzs1s.fsf@mail.linkov.net> <86edluyxhl.fsf@mail.linkov.net> <86bkgxfm34.fsf@mail.linkov.net> <86zg4gddtf.fsf@mail.linkov.net> <86v8f2xkr4.fsf@mail.linkov.net> <835y72noo4.fsf@gnu.org> <83zg4dmd4k.fsf@gnu.org> <83pm59m8vs.fsf@gnu.org> <86sfa46e1l.fsf@mail.linkov.net> <833524n7pk.fsf@gnu.org> <86jzvgnqfo.fsf_-_@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22888"; mail-complaints-to="usenet@ciao.gmane.io" Cc: arthur.miller@live.com, emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 04 13:33:43 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qGeHt-0005ex-V6 for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jul 2023 13:33:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGeH3-0007LH-OK; Tue, 04 Jul 2023 07:32:49 -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 1qGeH2-0007L0-7G for emacs-devel@gnu.org; Tue, 04 Jul 2023 07:32:48 -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 1qGeH1-0003dB-Jj; Tue, 04 Jul 2023 07:32:47 -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=mGIP75K3w/DyowQyNCrIKWtxQ9681NvvtbnlOi/pghI=; b=HLIqmnHDiDpo e3oMQhHx9i3SirmJ+Bv5mQWObEwLb/dMPRZ14aHQkMBMkV0DNXh1WBA8z6kH4ufOFYdaEFEn0DzTC /bu6vUQI1AHjr8YDchDFw9nYZpGg/RjuAD6lyH5Y1n9Fq3jjrsxXPrHeo+bfbf2mqFdkHBbSK8yli SLBYZqdX1xtcPCsPT6fGyjbW6W1OrurzZ+JgJrpFnftmqbtgkbxef386KVwKQBQBCrLNhM8RLR5Du w/pViMwz5NKfKyN1Bfra52iH/byffws1ZWbDQjKBEM/4ySVpAKuaJgn8aUbS3xCCVWLrlUqyxN15H Nf+yCEWdda9tq7n69+ROVA==; 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 1qGeH0-0006pj-QV; Tue, 04 Jul 2023 07:32:47 -0400 In-Reply-To: <86jzvgnqfo.fsf_-_@mail.linkov.net> (message from Juri Linkov on Tue, 04 Jul 2023 09:50:47 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307410 Archived-At: > From: Juri Linkov > Cc: arthur.miller@live.com, emacs-devel@gnu.org > Date: Tue, 04 Jul 2023 09:50:47 +0300 > > >> This symbol is generated automatically by 'easy-menu-define' > >> from the menu item "Back in History" with spaces inside. > > > > key-valid-p invalidates keys that have embedded whitespace, so we need > > to decide whether we want to add that or modify easy-menu-define to > > produce more reasonable symbols. > > Currently easy-menu-intern keeps spaces in strings: > > (defsubst easy-menu-intern (s) > (if (stringp s) (intern s) s)) > > Replacing it with: > > (defsubst easy-menu-intern (s) > (if (stringp s) (intern (string-replace " " "-" (downcase s))) s)) > > produces from the menu item "Back in History" a more reasonable > symbol 'back-in-history' for which > > (key-valid-p " C-") > > returns t and can be used in defvar-keymap. > > OTOH, [tool-bar C-Back\ in\ history] worked in 27.2 but broke in 28.2 > with " C- is undefined". > > After the change above, [tool-bar C-back-in-history] works again. Stefan, WDYT about this? What is the best way of fixing this inconsistency between easy-menu-define and key-valid-p?