From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Interest in keymap-set + use-package (+ bind-key)? Date: Thu, 2 Jan 2025 11:00:58 -0600 Message-ID: References: <348bdf40-6c00-2f42-4859-a56f40e28833@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25279"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Jim Porter , =?UTF-8?B?U2ViYXN0acOhbiBNb27DrWE=?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 02 18:03:01 2025 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 1tTOb7-0006UK-BD for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Jan 2025 18:03:01 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTOZR-0003Uo-TF; Thu, 02 Jan 2025 12:01:18 -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 1tTOZG-0003KI-P3 for emacs-devel@gnu.org; Thu, 02 Jan 2025 12:01:11 -0500 Original-Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTOZB-0001lC-OF for emacs-devel@gnu.org; Thu, 02 Jan 2025 12:01:05 -0500 Original-Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5d3ecae02beso14139281a12.0 for ; Thu, 02 Jan 2025 09:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735837259; x=1736442059; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=r6m3QFIexo01EczOVSoJ6yqKCIm85GPqAF+3g/9jyt8=; b=IfpAD289maKhDyCNsAhKrZrLqmzyPmsLWRvRv7qUI7tIl3B45VoY+Ud6wtXScOkFf/ FkLey0VDQoPaM5kt/VNg82ENO7vkJJfNBgB2Db+kQT+DbLo9yw1JnuJfQ91HbmD2ameT qhSztfqTyAFfLCNIlxunO9b7Q7ti5pveBpW0KpUNXvFBZglrBWY0fAWG4oel2ZocnPBd amvWel8+yuQzQ/7PGwChw1c6Sn97Fx5X0Piv2JL3k2IbXZSvKyJlwEOmx1QD9aEu+8BS rcMWNOqFMmDVY5cgLD1Fh+n7lLRYvGG05ZUZHagNV4hdH9O+VKcC1xCfdKpu/ikmz7XY GxFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735837259; x=1736442059; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=r6m3QFIexo01EczOVSoJ6yqKCIm85GPqAF+3g/9jyt8=; b=csHIHbL97B5Z2vhAAwJy41Bux/2cyUL0ASEho4LZfzNi1jFhjgiXvmb2VkbLjozRSY 4LoigAsW5ruqNa9zF3fQyDHTDFSrs8soWHLOvcIVjvERD/qtFTPwze3zFkGOh9Z7w/jd TxtmEQC1zZTvOpEL8/ugO7zbXYTCtmDYcK+AcT2NXcINiEQMwUNEhGe3gW0+h3VG/wZs LyCQVemXd7j/gIVhjCKxlQkUZnJrPmZJ7WH4iELkq0IzsG5FrkrwJ4Ujy5Y+d7NyjDtb 8yX1GaBrnwL5vu4rHhxX6VbpLn4hda0YZ6+1Q8IS1BZvXB3e/pwAh4n2XFG/OFjtrpDi ohJA== X-Gm-Message-State: AOJu0YxhiEth3EjqrOsaNV6ltrsNxitvCiaeA6ei9ho8l78xWKbGtlRT DeSHFzKhgD+vRIZxI/yOAcZRxQi5pEenQx2fdbvCd1k4ftKyjxY2ZB8fD7FYW7HHULH3JOxz2PF svvP0YG8KfmGebaaTYvJmpZvM1CM= X-Gm-Gg: ASbGnct3soEiJ2REk66kB29VCFw9DCM+TcnZ/VP5Ese5pcKcTjGt8DBgxPDamtP/Vr2 KWtXHIhbl/gIEah/VnnMqbvj+TQGnfroSdJJLDoA= X-Google-Smtp-Source: AGHT+IHqHgPeLSv6kHQHpRp4JSv7iavO8WKK6oYMiBxJKRCuyWbjHBLTLasSxnS1UjG9KpHVvX+v/+DUimm/jj9gH6M= X-Received: by 2002:a05:6402:84c:b0:5d0:b925:a8a with SMTP id 4fb4d7f45d1cf-5d81dda80bemr46081953a12.16.1735837258465; Thu, 02 Jan 2025 09:00:58 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 2 Jan 2025 11:00:58 -0600 In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=stefankangas@gmail.com; helo=mail-ed1-x52b.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:327574 Archived-At: Jim Porter writes: > On 11/14/2024 6:13 AM, Sebasti=C3=A1n Mon=C3=ADa 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? (Sorry for the late reply here...) FWIW, your plan sounds good to me.