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: woman.el broken? Date: Wed, 03 Mar 2021 08:25:52 +0200 Message-ID: <83lfb469e7.fsf@gnu.org> References: <20210301193951.7EB04C217D7@raman-glaptop.localdomain> <878s763bah.fsf@gnus.org> <83r1ky7icm.fsf@gnu.org> <87zgzm1vvf.fsf@gnus.org> <83mtvm7hkt.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30011"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, emacs-devel@gnu.org To: Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 03 07:26:55 2021 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 1lHKyE-0007ez-Qv for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Mar 2021 07:26:54 +0100 Original-Received: from localhost ([::1]:56028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHKyD-00013f-M6 for ged-emacs-devel@m.gmane-mx.org; Wed, 03 Mar 2021 01:26:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHKxN-0008IR-R2 for emacs-devel@gnu.org; Wed, 03 Mar 2021 01:26:01 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60144) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHKxN-0003ew-2b; Wed, 03 Mar 2021 01:26:01 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4627 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lHKxL-0001Zb-OL; Wed, 03 Mar 2021 01:26:00 -0500 In-Reply-To: (message from Stefan Kangas on Tue, 2 Mar 2021 20:23:53 -0600) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:265862 Archived-At: > From: Stefan Kangas > Date: Tue, 2 Mar 2021 20:23:53 -0600 > Cc: emacs-devel@gnu.org > > >> Yes, fixing the lookup to be more forgiving here would be nice. > > > > Stefan, would you please make that happen? Without that, the switch > > to easymenu is an incompatible change, ironic as it may be. > > Would something along these lines be okay or do we strictly need all of > this to be in C for some reason? If this is performant enough, I don't at the moment see any reason to have it in C. Of course, the few places that call Flookup_key from C will need to be analyzed whether they need to call the internal function or the Lisp wrapper, and modified accordingly. > (defun lookup-key (keymap key accept-default) > (or (lookup-key-internal keymap key accept-default) > (and (vectorp key) > (let ((lc-key `[,@(mapcar > (lambda (s) > (intern (downcase (symbol-name s)))) > key)])) > (when (not (equal lc-key key)) > (lookup-key-internal keymap lc-key accept-default)))))) This is not the only transformation we should apply, IMO: we should also convert "Foo Bar Baz" into "foo-bar-baz". See the Dired menus for examples.