From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: Interest in keymap-set + use-package (+ bind-key)? Date: Thu, 14 Nov 2024 13:47:19 -0800 Message-ID: References: <348bdf40-6c00-2f42-4859-a56f40e28833@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22911"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: =?UTF-8?B?U2ViYXN0acOhbiBNb27DrWE=?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 14 22:48:14 2024 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 1tBhhG-0005tm-6R for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Nov 2024 22:48:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBhgS-0007M8-E6; Thu, 14 Nov 2024 16:47:24 -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 1tBhgR-0007Lz-4a for emacs-devel@gnu.org; Thu, 14 Nov 2024 16:47:23 -0500 Original-Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBhgP-0004KG-PW for emacs-devel@gnu.org; Thu, 14 Nov 2024 16:47:22 -0500 Original-Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-7f4324503d7so851166a12.3 for ; Thu, 14 Nov 2024 13:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731620840; x=1732225640; darn=gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=TzpBK0r5KOlpCvp+lUSdWlBCnpSIMC2Qzhrr3wvUyAc=; b=blVBP2rZMfBiU+2FHP4VdWUbmECAY4DrbAjzkX83GBbpWYU+tzs8eX6V+xO1cgswz/ 7l/B8inFrxURZuGfaj6LBobc+HmcC98EdTlDZTem3z3f0MkDzkSWRCiOy4tPItQy2tiJ pNt9NghOHTvVqa8SHfQHLwRt+iDd1538v7cwvlUKhSc+V0M2imi/n5m6KvQGiw2teocD I6xBPi/vMRI4/yAt1onpSF20XIhl90AD6W6MSRymE+qam+NZs6xP7Z48frfwlpU0sTRh Ca4/owvdI7Wcrd/LfoauZVSHgcpflogHJIkKoJnMPqVOzur8lDFockHRi0riHI0dA6Wm weiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731620840; x=1732225640; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TzpBK0r5KOlpCvp+lUSdWlBCnpSIMC2Qzhrr3wvUyAc=; b=mYs55iHF5SeIzjpRHmKXC3G5CxFp9hGYyQDMQqJN54/4pR8Ivu6yWUZRysYpo3/Mmq IIzAqA+0ag3A0fBiufxNXX+ee7dUdBGL85Zu7USZihjUzLZ/+4Yk+TECaBYwpj8DXkQc IMvbIYrDGgDBGJ+mmvNf1FmcxneuWWg0aPiW0rER9T06C2MH+kz8a3B6WXvnzfyM62q7 zT3l8ilnpbkHVHfqnen7xXCh+A3E8BqtPkltvCMvo2yPZ12+icQrwNtCtPuCyvsZyzkH aiEdJCFpl2Z4mug+phXT1rKXHMgQBC1nAtSvLyxJvdZaWovPM8loPBj5kYFMThEF04Ri rT0g== X-Gm-Message-State: AOJu0YwBIBKQcNuJe5wiEhHis9f4UANLI00Djo+lR8TgSMKT/iIPzhHg kQ44GvEMbLfys/IxRuTs6yFawLL4zgHwlVIF78U7wpRyx53DxOUVgfMsjw== X-Google-Smtp-Source: AGHT+IH9h/oPAUgNfiq89SjbphIH7zFQEHxZc1JZ4OOTu3l21wsSFV/Gbl9or7FrLDzJq3py0Ak54A== X-Received: by 2002:a05:6a21:6d9f:b0:1d9:c743:860f with SMTP id adf61e73a8af0-1dc90b1e5c4mr363325637.11.1731620840198; Thu, 14 Nov 2024 13:47:20 -0800 (PST) Original-Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-7247720e2ecsm103625b3a.199.2024.11.14.13.47.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Nov 2024 13:47:19 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=jporterbugs@gmail.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:325454 Archived-At: On 11/14/2024 6:13 AM, Sebastián Monía wrote: > Wouldn't it make sense to have bind-key use that syntax going forward, > though? Maybe it can't be done without breaking existing code, and > that's why we would need a new keyword? If we can do that in a way that doesn't break existing calls, I think that would be ok. Maybe we could replace the calls to 'define-key' with something like... (if (key-valid-p KEY) (keymap-set KEYMAP KEY DEFN) (lwarn 'bind-key :warning "Legacy key value detected!") (define-key KEYMAP KEY DEFN)) That way, if KEY is valid according to the new keymap.el standards, we prefer 'keymap-set'. Otherwise, fall back to the old way and emit a warning so the user can fix their config. Then, sometime a few years from now, we could remove the 'define-key' fallback?