From unknown Fri Jun 20 07:18:32 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#61505 <61505@debbugs.gnu.org> To: bug#61505 <61505@debbugs.gnu.org> Subject: Status: [PATCH] Handle anonymous commands in C-h K Reply-To: bug#61505 <61505@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:18:33 +0000 retitle 61505 [PATCH] Handle anonymous commands in C-h K reassign 61505 emacs submitter 61505 Eshel Yaron severity 61505 wishlist tag 61505 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 14 02:39:10 2023 Received: (at submit) by debbugs.gnu.org; 14 Feb 2023 07:39:10 +0000 Received: from localhost ([127.0.0.1]:52388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRpuA-0005HT-3m for submit@debbugs.gnu.org; Tue, 14 Feb 2023 02:39:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:39880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRpu7-0005HL-Ok for submit@debbugs.gnu.org; Tue, 14 Feb 2023 02:39:08 -0500 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 1pRpu7-0007dR-FK for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 02:39:07 -0500 Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRpu5-0002wh-Lk for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 02:39:06 -0500 From: Eshel Yaron DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1676360344; bh=S5yoO/DWlvSlUky373w5y2Xq0uzxp3hZCKfO3LEEMGc=; h=From:To:Subject:Date:From; b=xI0Huy4CrHENWUfg/lXnmc77wCajx1IvM7yakI19N4A7wVr+ou7CMb/c7R/NDnZYE WDViylydVLtkEmVqy+vTqKXu2tlrYC/uJLPdVTZVUpDwgvGJg9DnJ9MCqrGN0EZzVa T4qyBwIzjNGe69mV3JEF9gHMxNI216fadFuI68eJmHUL8i27LKBtkQYEKT4k2fyRr/ buIywR62VJilBt8EqAePHGrGONz5aQaplGLZgsFd8CNIbOsuBjk31dmqBh16GXzkDx 92Xp4r6SQ39bePmeCIx3vaK13Aeu/rjpJ83+2BbZ5hYpASi6nySG54MApVQFC/UWQD 4CuH9ehiDKd3Q== To: bug-gnu-emacs@gnu.org Subject: [PATCH] Handle anonymous commands in C-h K Date: Tue, 14 Feb 2023 09:39:00 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Tags: patch Currently C-h K (Info-goto-emacs-key-command-node) throws an error when used on anonymous commands, for example: 1. emacs -Q 2. Evaluate this form: (keymap-global-set "C-c m" (lambda () (interactive) (message "foo"))) 3. Type C-h K C-c m 4. Get this error: Info-goto-emacs-command-node: Wrong type argument: symbolp, (closure (t) nil (interactive) (message "foo")) This patch makes Info-goto-emacs-key-command-node detect and handle such cases by printing an informative message instead of calling Info-goto-emacs-command-node. In GNU Emacs 30.0.50 (build 6, x86_64-apple-darwin22.2.0, NS appkit-2299.30 Version 13.1 (Build 22C65)) of 2023-02-11 built on esmac.lan Repository revision: 838415525bd4e77a79e18af8e4f01ed004196c71 Repository branch: master Windowing system distributor 'Apple', version 10.3.2299 System Description: macOS 13.1 Configured using: 'configure --with-native-compilation --with-json --with-xwidgets --with-mailutils --with-imagemagick --without-dbus' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Handle-anonymous-commands-in-C-h-K.patch >From b835e3ab3803ba0344a068dd00b2fc413c3cc970 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Tue, 14 Feb 2023 09:18:37 +0200 Subject: [PATCH] Handle anonymous commands in C-h K * lisp/info.el (Info-goto-emacs-key-command-node): Don't call Info-goto-emacs-command-node for anonymous commands. --- lisp/info.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/info.el b/lisp/info.el index 035dff66e75..cf11b782bef 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -4671,8 +4671,11 @@ Info-goto-emacs-key-command-node (eq command 'execute-extended-command)) (Info-goto-emacs-command-node (read-command "Find documentation for command: "))) + ((symbolp command) + (Info-goto-emacs-command-node command)) (t - (Info-goto-emacs-command-node command))))) + (message "%s invokes an anonymous command" + (key-description key)))))) (defvar Info-link-keymap (let ((keymap (make-sparse-keymap))) -- 2.39.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 05:01:49 2023 Received: (at control) by debbugs.gnu.org; 4 Sep 2023 09:01:49 +0000 Received: from localhost ([127.0.0.1]:48597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd5Sv-00062t-48 for submit@debbugs.gnu.org; Mon, 04 Sep 2023 05:01:49 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:52280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd5Ss-00062c-C4 for control@debbugs.gnu.org; Mon, 04 Sep 2023 05:01:48 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2b962535808so17230291fa.0 for ; Mon, 04 Sep 2023 02:01:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693818100; x=1694422900; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=6mdYwF5fMWziDk47RgJF8mGQQb9xE9e314xY1JuPzlc=; b=ddhpEb9406Tq6lhmv9Hy1uPrJehc9xTUzdHSfLqFl4xcsGbuF8E6WS1pWI0yX6j5Vi I+d5HHlDF1tLZTWDpAywZk/yexjxy3s9BmR4CcOkiHLJvmfRCougWHUbydzt8WXpMF78 BNz1z5QBYjIVLh4I/ThqjxBu4gflsxv89bTsY2bl1XlrQhHPxkzuukpPlGImtLFsLPOx NJ/ElO6e5Y2V+jJtbq79YN/ESHBp7K/ne9yR5twBNuMOCS3jpYlYEN80faKkQB8V7KEG wr1hKR64tp/v/6gxXQsJfiTKMw7+U7aN0rynYeh7BY3YhzBsw7N3hxU3b/ugTHafUY9O MENA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693818100; x=1694422900; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6mdYwF5fMWziDk47RgJF8mGQQb9xE9e314xY1JuPzlc=; b=exEC0XmXIa4ZT73t7MJgAK9cTmaCLAyDBz/10BJDGn3Lgm40Exhx5GCkqnajEwcN+2 62SSG8V+tr734P5ZRkSOCFkeJgLPqRWaL7s2scF9EOkQWn6B/dtyqWexyPxBd0YNkLTE RjKvmEPv5jWBnS5rpJuCBOU3+WmI85Kn7wmyLxQ2CqVZicXIHS8ausW7D+uVFqH7siHI +/gzBxAIGhRcdBgEr7Ea1qTa38DcGOcY69mm57hMOhkTE+xGxTPyYsd2Wjz9sFqfJO32 5ASvhVxyvRV0+Sin6RL24TKtiz6KSCdgtihMpzaBEwLGEnrpBjjqqwjoL2YpJM8FmRbc xbsQ== X-Gm-Message-State: AOJu0Yw+hqe3mAiYpn9wFvAwgfl3R7UmdkvEMp9UHkkOO79t0gk5+ylC C4BICiUFa3M8nsS3nUzdJsbFXF9YAX7SOAW+fN0nQh083BI= X-Google-Smtp-Source: AGHT+IFSfvuuNTicq8lCvpvtOBCNFVkF7bTOA4iJDx/FuiLbJUkTQP0OSUYxQPABm3Nmqvv5tNXFy+YC7PR1qUNEbCQ= X-Received: by 2002:a05:6512:b86:b0:500:c936:f38a with SMTP id b6-20020a0565120b8600b00500c936f38amr7594597lfv.50.1693818100351; Mon, 04 Sep 2023 02:01:40 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 4 Sep 2023 02:01:39 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 4 Sep 2023 02:01:39 -0700 Message-ID: Subject: control message for bug #61505 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 61505 wishlist quit From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 10 17:51:39 2024 Received: (at 61505-done) by debbugs.gnu.org; 10 Jan 2024 22:51:39 +0000 Received: from localhost ([127.0.0.1]:43517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNhQA-0005bd-Qy for submit@debbugs.gnu.org; Wed, 10 Jan 2024 17:51:39 -0500 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:49484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNhQ9-0005bO-8D for 61505-done@debbugs.gnu.org; Wed, 10 Jan 2024 17:51:37 -0500 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2ccbc328744so56796981fa.3 for <61505-done@debbugs.gnu.org>; Wed, 10 Jan 2024 14:51:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704927092; x=1705531892; darn=debbugs.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=uzZDNB8GKyJah5xjj88J4u025zkw0suI9nrcwgIt/f4=; b=Rt7nGzkENBXSDHsfie7KY2Qfg9iGqwbe5EXHyy5iEED/BpNXpY+3LEsvWA0vVd3UHq NIgfu5ZKB0N2608Fpwx23UGNITy/4qX6o3dT0ogavOHCD/RyJXLDvRFIEmCJinpztNoR rPjSZ7usBrK8ZtBH0U45/pPNY+NyJAC7uj3jScLBRoA3kSV8Mx+rtNcz8u3RUCZGiqRp 0eo4OgWF4otItmXSwVPFKjTqIRThQ/flKix94hm1RUrU9WqvJdMrKa1f2XKF2T5d9VUa h+LFHuvDAQjphH0FSIxGTgLShj/d1Gb0Bx7QY7+s4wJ5NoHpGaIRQ8M6E3xyYb55byeF yhMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704927092; x=1705531892; 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=uzZDNB8GKyJah5xjj88J4u025zkw0suI9nrcwgIt/f4=; b=nbhDB7LiAHUM+b1HxoclRBYOWBI0cKoocoN47A4Psgr8C0lr0TBShpITEF67e/e5fT Ug6JVyUdpQV+qYUdWGoYZ5wMnNITw4tIhr7+qyTdTgD6TlNr9JPgAKLLzvZXNwTt4Qtv DKb+lxWvyIXsu+23Zjpn+56O0kCIIEFxFf/Tuk8mWXKCBkfRSYwdV1VCCGkBrKomdCSj csgOiqeChfsWqtl5aAXgMI4TMXw2Wd16FMQJKBSnPpzBkAcm5gIETA4AzM01a3fhQ6X1 KNAGqvjSf0BxB8lgFMJLEzZSWJvyogrphcUJnrnJ2feqzR4yc4Kmtv2cuWAq3aPTOFHZ JJcQ== X-Gm-Message-State: AOJu0YyNQFg2nauZUKQUHbRaaOI6tQY7AJDCuN4q5P9pYvbyEo6Rg/ku yDZ3ptNYLBCR4OkR8kWcrtxZcrDA6wlExoCmDsuwYV8I2pOX1Q== X-Google-Smtp-Source: AGHT+IGAvHClYkwg7UQlsFnqvEFwcpSMJVqPZ71xGJYfkLmh9iDAk/HQ+FzaGiofJUFve+AJ0pH/ceMU1GKuufz3LEY= X-Received: by 2002:a2e:90d1:0:b0:2cc:d665:db21 with SMTP id o17-20020a2e90d1000000b002ccd665db21mr110690ljg.66.1704927092035; Wed, 10 Jan 2024 14:51:32 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 10 Jan 2024 14:51:31 -0800 From: Stefan Kangas In-Reply-To: (Eshel Yaron's message of "Tue, 14 Feb 2023 09:39:00 +0200") References: MIME-Version: 1.0 Date: Wed, 10 Jan 2024 14:51:31 -0800 Message-ID: Subject: Re: bug#61505: [PATCH] Handle anonymous commands in C-h K To: Eshel Yaron Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61505-done Cc: 61505-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Version: 30.1 Eshel Yaron writes: > Currently C-h K (Info-goto-emacs-key-command-node) throws an error when > used on anonymous commands, for example: > > 1. emacs -Q > 2. Evaluate this form: > (keymap-global-set "C-c m" > (lambda () > (interactive) > (message "foo"))) > 3. Type C-h K C-c m > 4. Get this error: > Info-goto-emacs-command-node: Wrong type argument: symbolp, (closure = (t) nil (interactive) (message "foo")) > > This patch makes Info-goto-emacs-key-command-node detect and handle such > cases by printing an informative message instead of calling > Info-goto-emacs-command-node. Thanks, makes sense to me, so I installed it on master (9eed00c8e5a). I changed the message to be slightly more clear in a followup commit to look like this: C-c m invokes an anonymous command defined with =E2=80=98lambda=E2=80= =99 I also made it use `substitute-command-keys'. From unknown Fri Jun 20 07:18:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 08 Feb 2024 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator