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.help Subject: Re: Get key-binding for a command and print key binding in kbd syntax Date: Thu, 09 Feb 2023 13:20:44 +0100 Message-ID: <874jrvm3mr.fsf@gmail.com> References: <87lel72mqs.fsf@gnu.org> <87cz6jm8tk.fsf@gmail.com> <87h6vv2jmu.fsf@gnu.org> <878rh72ie4.fsf@gnu.org> <878rh7m5bj.fsf@gmail.com> <874jrv2gcb.fsf@gnu.org> 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="13540"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 09 13:21:20 2023 Return-path: Envelope-to: geh-help-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 1pQ5vU-0003NQ-Lj for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 09 Feb 2023 13:21:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQ5v1-0004zn-Vi; Thu, 09 Feb 2023 07:20:52 -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 1pQ5v0-0004zW-Cu for help-gnu-emacs@gnu.org; Thu, 09 Feb 2023 07:20:50 -0500 Original-Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQ5uy-00041r-Si; Thu, 09 Feb 2023 07:20:50 -0500 Original-Received: by mail-wr1-x433.google.com with SMTP id a2so1569295wrd.6; Thu, 09 Feb 2023 04:20:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date :gmane-reply-to-list:references:in-reply-to:subject:cc:to:from:from :to:cc:subject:date:message-id:reply-to; bh=oh1+bU5wDU5StUnzq85iNjz26NRvImOFpLKdr99W4GI=; b=nWyC6uuVPosaBjvjsaRoEQrfti7XJwLZtU3NvXCukZOwhsCE8G2lLs0H2lTWgRZRuy cTRf8fGmFQ1YAI7paYmULYXV5C8qu8SXDxDKep5ZG7ayrM5dlRtrZ+1w9YckSxID1u2S ZCKEuSaoHAo4zA85jfWmWyDztINBWi0g8wVEIn4EI5phisuuqVVKA1/FheLO0k7fesqr unPO3qhDib4+n9pBd6G0AwOeHPM/9ZhHNiUiJk+dOiCQ0s87tAlTFM5FLuXKD3v1FFLp IRc7qnsr2x6WiRyBMh7ZJSaSm7rO041apBNavviRNkDZOTsa/+JYDK8b60X8dpb3i6jk sCjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date :gmane-reply-to-list:references:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oh1+bU5wDU5StUnzq85iNjz26NRvImOFpLKdr99W4GI=; b=fuFWz4vBq+LJYdMlKEuxAY4/EJJTrK0CjC57zcz+2TdNMqrXs0WkalE/gX5pU0ZXtu qXum40Mx9EBhxxb19k4gQEeqVJMSzcl0xA+DCTD7n0sZqKCAP4QPjK7Mo5j/p2vyLClm M4dvAkqqREuFVuvxa0QvpsEzegnYT+wUXk1jRd+6QpuAg1OvGFPROsBihfsbqPYjEWhR Lvu2X+jYLzE3TJ+VRF2UgI8XSwRC3fEd5fbyPGBnI0UHDvBLV80XaO88eHnkix4a854P SwLiohsmi1jdjNWMRsFdZGakb6FseO22EMBRKBFyzGc/E2RiMkEhOIUwvMn82fTlNG7j BIJQ== X-Gm-Message-State: AO0yUKW5974c25i2HNkri7AHW+7IHFYZVij29xDbAV3PlVkzm75h13UG GCGZh38RqcTMRlEr0d68zQebqzrKdfU= X-Google-Smtp-Source: AK7set/Q9eX+6f/k+Gxx1b7+jJ7h8PNYXKEGeuRZETRFkn7bPn/ypu3ihsBDuT/8pJWNpznAnVpxsw== X-Received: by 2002:adf:f3cc:0:b0:2c4:592:2e47 with SMTP id g12-20020adff3cc000000b002c405922e47mr5423210wrp.31.1675945245725; Thu, 09 Feb 2023 04:20:45 -0800 (PST) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id f18-20020a056000129200b002366e3f1497sm1116581wrx.6.2023.02.09.04.20.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 04:20:45 -0800 (PST) In-Reply-To: <874jrv2gcb.fsf@gnu.org> (Tassilo Horn's message of "Thu, 09 Feb 2023 12:58:37 +0100") Gmane-Reply-To-List: yes Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=rpluim@gmail.com; helo=mail-wr1-x433.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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142673 Archived-At: >>>>> On Thu, 09 Feb 2023 12:58:37 +0100, Tassilo Horn said: Tassilo> No, no. I've meant that with substitute-command-keys I have t= he correct Tassilo> key-descriptions in the buffer with help-key-binding face. Ho= wever, I Tassilo> would also like to have them clickable so I think I need to "p= arse" the Tassilo> buffer and add keymap properties to the text having the help-k= ey-binding Tassilo> face. Tassilo> So for example, there is the text "[j]ump to some maildir" whe= re the j Tassilo> is a key-description (recognizable by its help-key-binding fac= e), I need Tassilo> to translate back the j to the command mu4e-search-maildir in = order to Tassilo> add a keymap where RET and mouse-2 are bound to that command. I=CA=BCm not sure I=CA=BCm getting it. - You insert (substitute-command-keys "\\[mu4e-search-maildir]") - At that point you can add a 'keymap property to the text you=CA=BCve just inserted, binding RET and mouse-2 to #'mu4e-search-maildir Why do you need to lookup "j" in the local map at all? (as an aside, clickable stuff is probably better done with buttons than by inventing your own thing). Robert --=20