From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: 29.0.60; keymap-local-set and keymap-global-set became less strict Date: Thu, 02 Feb 2023 10:40:54 +0100 Message-ID: <87357oo15l.fsf@gmail.com> References: <5876987d-2479-f512-5767-218c8c16a909@daniel-mendler.de> <875ycngyji.fsf@gnus.org> <87zg9zvzuc.fsf@gmail.com> <831qna3frm.fsf@gnu.org> <87mt5yogct.fsf@gmail.com> <83y1pi1wz4.fsf@gnu.org> <87ilgmodk4.fsf@gmail.com> <83mt5y1r5u.fsf@gnu.org> <87bkmdo8e4.fsf@gmail.com> <831qn91qo0.fsf@gnu.org> <137753af-777d-2da3-c111-7e2d414633f1@daniel-mendler.de> <83sffpze9h.fsf@gnu.org> <309dee07-e404-4f84-a839-8b99815376f8@daniel-mendler.de> <83mt5xz42d.fsf@gnu.org> <21d9dd07-22f6-03be-1c8b-5d7e4fd1ff80@daniel-mendler.de> <831qn8zh84.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10049"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Daniel Mendler , monnier@iro.umontreal.ca, larsi@gnus.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 02 10:41:52 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 1pNW6I-0002NO-TL for ged-emacs-devel@m.gmane-mx.org; Thu, 02 Feb 2023 10:41:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNW5f-0005bA-1D; Thu, 02 Feb 2023 04:41:11 -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 1pNW5W-0005a9-2K for emacs-devel@gnu.org; Thu, 02 Feb 2023 04:41:03 -0500 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNW5S-0005xa-GN; Thu, 02 Feb 2023 04:41:00 -0500 Original-Received: by mail-wr1-x42d.google.com with SMTP id q10so1121712wrm.4; Thu, 02 Feb 2023 01:40:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=D1VbtziVXI+ROuX3V89JxuaPum7fYviWoj+NBYkmqjU=; b=a5OpFQMdXPkW3VnQ0YWr7WZBwEyry/Zu6ijvKAm8+6MXTYK89v16nLSQHpIE94aRW2 Beo7a4sIjL/tySXZhW1J4r3JcSgb3MERnqJmsCgWjVwYBVEJMPsnq0p69/xnY8ySkIN/ vttsSXBoPx95/XD4avT3r0T6shgesyHtqEiMJq1BOlKAC2lWSYAFO/vSUj+fFWmwRrrE bywCvXYiNeKWO9mQ9MKc8FpBhEDXfSpczTiX40F/8xvAYQoQ1mjb/O7vTWRv89lNKyLA fgprdVvQgCLTgxhOW7jQun9IQ0IzgKN+ZdL4XWrWm+a72lg8KkjXxdUCvs80hO+G2/27 rHyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=D1VbtziVXI+ROuX3V89JxuaPum7fYviWoj+NBYkmqjU=; b=HOfoR3vyiPnrMR/TVE1S0Wi4pFtXD0zBYc9Y0vZewOeawh0FxYn3xOKc7G7oBvOXJs 8zWQGNJ4GOxbwjBVQObLbesD/FllzAsDOBkKXjA8CEf7ybhWkXLwjl4BI6eg7Rl2mzbe FEGyOemlCHeyqXsPcdxEnFuHmEna2VM8HewsAtieY+XkfzZqwoYdHaFewHsEkEGAPma9 WXeXc1BzJZ70v9NtWGcJuK8l3qBrG/IWG8RYxymojAJwjGS4SYwtw4wfSUyKmmhvx6YV 1plXr+dw00IIJNoC6FKGXMCvCV7EK013bm6qSxqW7OV1MKZH4T7C9YRsWiR+qnSu+4nv gt8g== X-Gm-Message-State: AO0yUKUGdjsFumhIRWYUeIK9tbDF+oVlfaMXlqgKGw8OJM3WeOc0cFaZ jYSbs5TXzqcSQ+BbRUE9uI9HfrIX10I= X-Google-Smtp-Source: AK7set+9rSCe3nYymiQL0kQo6xAnNqHDokaGDftdvk/7BgQeV8RTTj2qif6iWgCnTRJ6gwiQSp02gA== X-Received: by 2002:adf:fd88:0:b0:2bf:5dc0:56c8 with SMTP id d8-20020adffd88000000b002bf5dc056c8mr4602222wrr.51.1675330856106; Thu, 02 Feb 2023 01:40:56 -0800 (PST) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id a18-20020a5d5092000000b002bdd8f12effsm19204608wrt.30.2023.02.02.01.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Feb 2023 01:40:55 -0800 (PST) In-Reply-To: <831qn8zh84.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 02 Feb 2023 08:58:19 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=rpluim@gmail.com; helo=mail-wr1-x42d.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:302897 Archived-At: >>>>> On Thu, 02 Feb 2023 08:58:19 +0200, Eli Zaretskii said: Eli> So, Robert, please install your last patch, and thanks. With `advertised-calling-convention', perhaps? diff --git a/lisp/keymap.el b/lisp/keymap.el index de90b03ba64..7008bac8b24 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -65,7 +65,7 @@ keymap-set (setq definition (key-parse definition))) (define-key keymap (key-parse key) definition)) -(defun keymap-global-set (key command) +(defun keymap-global-set (key command &optional interactive) "Give KEY a global binding as COMMAND. COMMAND is the command definition to use; usually it is a symbol naming an interactively-callable function. @@ -75,13 +75,14 @@ keymap-global-set Note that if KEY has a local binding in the current buffer, that local binding will continue to shadow any global binding that you make with this function." - (declare (compiler-macro (lambda (form) (keymap--compile-check key) form))) - (interactive "KSet key globally:\nCSet key %s globally to command: ") - (unless (stringp key) + (declare (compiler-macro (lambda (form) (keymap--compile-check key) form)) + (advertised-calling-convention (key command) "29.1")) + (interactive "KSet key globally:\nCSet key %s globally to command: \np") + (when interactive (setq key (key-description key))) (keymap-set (current-global-map) key command)) -(defun keymap-local-set (key command) +(defun keymap-local-set (key command &optional interactive) "Give KEY a local binding as COMMAND. COMMAND is the command definition to use; usually it is a symbol naming an interactively-callable function. @@ -90,12 +91,13 @@ keymap-local-set The binding goes in the current buffer's local map, which in most cases is shared with all other buffers in the same major mode." - (declare (compiler-macro (lambda (form) (keymap--compile-check key) form))) - (interactive "KSet key locally:\nCSet key %s locally to command: ") + (declare (compiler-macro (lambda (form) (keymap--compile-check key) form)) + (advertised-calling-convention (key command) "29.1")) + (interactive "KSet key locally:\nCSet key %s locally to command: \np") (let ((map (current-local-map))) (unless map (use-local-map (setq map (make-sparse-keymap)))) - (unless (stringp key) + (when interactive (setq key (key-description key))) (keymap-set map key command))) Robert --