From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler Newsgroups: gmane.emacs.bugs Subject: bug#60867: 29.0.60; keymap-set-after does not accept the AFTER=t argument Date: Thu, 19 Jan 2023 12:19:19 +0100 Message-ID: References: <878ri2gx3r.fsf@daniel-mendler.de> <87r0vtaxtu.fsf@gmail.com> <3d2cc069-d258-f0b6-9679-eb13a1415202@daniel-mendler.de> <87edrsb5o3.fsf@gmail.com> <9d95e891-22ad-d700-3fab-69948a8a1a17@daniel-mendler.de> <87o7qualwa.fsf@gmail.com> <17aa757a-935d-547c-b432-9529d1ed6d6b@daniel-mendler.de> <87k01iakxz.fsf@gmail.com> <5bbc8220-6745-a123-a143-6b740caec8fa@daniel-mendler.de> <87bkmuainz.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40254"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 60867@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 19 12:20:24 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 1pISxz-000ADu-TJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Jan 2023 12:20:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pISxf-0007xY-QD; Thu, 19 Jan 2023 06:20:03 -0500 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 1pISxe-0007xL-Dw for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 06:20:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pISxe-0001yg-5Z for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 06:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pISxd-0004jY-Oc for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 06:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jan 2023 11:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60867 X-GNU-PR-Package: emacs Original-Received: via spool by 60867-submit@debbugs.gnu.org id=B60867.167412717018150 (code B ref 60867); Thu, 19 Jan 2023 11:20:01 +0000 Original-Received: (at 60867) by debbugs.gnu.org; 19 Jan 2023 11:19:30 +0000 Original-Received: from localhost ([127.0.0.1]:42775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pISx7-0004ig-Uh for submit@debbugs.gnu.org; Thu, 19 Jan 2023 06:19:30 -0500 Original-Received: from server.qxqx.de ([178.63.65.180]:42341 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pISx5-0004iM-T1 for 60867@debbugs.gnu.org; Thu, 19 Jan 2023 06:19:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ntbjwhEXkGC+XQvR5DZMXO55fQLU2xvbK/XjbBkBmLE=; b=PT0Cvqls160fx4DZfTwnP8r2Hn MR8TfO4dXlFN5oRU7R5M3WAZC1SQ771/QVnBAWHYiJvPK/DjosmgoP1GX7llqtVcZ5qavV621J3IZ 1c/TQvx4yX8ueMaH24+laWR9cGhMsBzYxbjAJwSh9GLbNY5Hh+NEC+gR9gtQAXmtEWS0=; Content-Language: en-US In-Reply-To: <87bkmuainz.fsf@gmail.com> 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:253699 Archived-At: On 1/19/23 12:05, Robert Pluim wrote: >>>>>> On Thu, 19 Jan 2023 11:39:34 +0100, Daniel Mendler said: > > Daniel> On 1/19/23 11:16, Robert Pluim wrote: > Daniel> Robert, speaking of `key-parse', I wonder why this function accepts > Daniel> invalid key strings. Why don't we move the `key-valid-p' check to > Daniel> `key-parse'? This would alleviate the need for many additional > Daniel> `key-valid-p' checks across keymap.el. One could maybe even get rid of > Daniel> the `keymap--check' helper. > >> > >> Do you have an example of such an invalid string? > > Daniel> Just try something like this: > > Daniel> (key-valid-p "bug") > Daniel> (key-parse "bug") > > Ah, the old "do we have to put spaces between keys" issue. Iʼm not > sure how best to deal with that, Iʼll have to read through keymap.el > some more. This: My point is that it would be expected from `key-parse' that it is equally strict as the other keymap functions, otherwise we miss bugs where `key-parse' wasn't used properly. Furthermore we would avoid all these `key-valid-p` and `keymap--check' calls, as I mentioned. Of course `kbd' should stay as lax as it has always been. > >> I think itʼs too late to make such changes for emacs-29. Iʼm not even > >> sure that the minimal changes I proposed will be accepted :-) > > Daniel> I don't think so since of all these functions are new. These seem like > Daniel> simple internal refactorings. Adding a NOERROR argument to key-parse > Daniel> seems like the least intrusive approach. > > I know emacs-29 hasnʼt been released yet, but changing a function to > error by default when it didnʼt do previously seems risky. It is mostly used internally. There are only 9 call sites in the Emacs code. > Iʼll make > that change locally and see what happens. (Update: it did not go well, > there are test-suite failures). This is hardly an argument. You should check all the call sites and adjust accordingly. In particular `kbd' must pass 'noerror. I would expect this to be a pretty small patch given the small number of call sites. Daniel