From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ruijie Yu via Users list for the GNU Emacs text editor Newsgroups: gmane.emacs.help Subject: Re: command-execute: Wrong type argument: commandp, helm-command-prefix Date: Fri, 05 May 2023 10:45:17 +0800 Message-ID: References: <1ccf06f2-b311-0989-8351-f0e866044936@gmail.com> Reply-To: Ruijie Yu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17697"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.22; emacs 30.0.50 Cc: Hongyi Zhao , help-gnu-emacs@gnu.org To: Platon Pronko Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 05 05:00:55 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 1pulgl-0004Tf-Mc for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 05 May 2023 05:00:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pulfl-0003jP-K3; Thu, 04 May 2023 22:59:53 -0400 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 1pulfk-0003j3-DZ for help-gnu-emacs@gnu.org; Thu, 04 May 2023 22:59:52 -0400 Original-Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pulfi-000291-II for help-gnu-emacs@gnu.org; Thu, 04 May 2023 22:59:52 -0400 Original-Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 8dc70605 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 5 May 2023 02:59:47 +0000 (UTC) In-reply-to: <1ccf06f2-b311-0989-8351-f0e866044936@gmail.com> Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:143511 Archived-At: Platon Pronko writes: > On 2023-05-05 08:34, Hongyi Zhao wrote: >> :bind >> (("" . helm-command-prefix) >> :map helm-command-map >> ("b" . helm-bibtex) >> ("B" . helm-bibtex-with-local-bibliography) >> ("n" . helm-bibtex-with-notes) >> ("" . helm-resume)) >> ``` >> When I hit hey for the first time, the following error will be >> triggered: >> command-execute: Wrong type argument: commandp, helm-command-prefix >> If I hit this key once more, the problem doesn't appear. I'm very >> puzzled by this problem. Any tips will be appreciated. >> See >> https://github.com/tmalsburg/helm-bibtex/issues/429#issuecomment-1535010227 >> for the related discussion. >> Regards, >> Zhao > :bind > (("" . helm-command-prefix) > :map helm-command-map > ("b" . helm-bibtex) > ("B" . helm-bibtex-with-local-bibliography) > ("n" . helm-bibtex-with-notes) > ("" . helm-resume)) When I macroexpand (use-package helm-bibtex :bind ("" . helm-command-prefix)) I get this: ```emacs-lisp (progn (unless (fboundp 'helm-command-prefix) (autoload #'helm-command-prefix "helm-bibtex" nil t)) (bind-keys :package helm-bibtex ("" . helm-command-prefix))) ``` When I macroexpand (use-package helm-bibtex :bind-keymap ("" . helm-command-prefix)) I get this: ```emacs-lisp (bind-key "" #'(lambda nil (interactive) (use-package-autoload-keymap 'helm-command-prefix 'helm-bibtex nil))) ``` Looking at the docstring of `bind-keys', it seems to me that the fact that :bind happens to work sometimes is unintended, and we should prefer :bind-keymap instead. Hongyi, try to move your keybind to `helm-command-prefix' into a :bind-keymap section and see if that helps. FTR, I wasn't able to reproduce the error with :bind "" either. I don't have "" key set, so I can't test that. -- Best, RY [Please note that this mail might go to spam due to some misconfiguration in my mail server -- still investigating.]