help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: command-execute: Wrong type argument: commandp, helm-command-prefix


From: Ruijie Yu
Subject: Re: command-execute: Wrong type argument: commandp, helm-command-prefix
Date: Fri, 05 May 2023 10:45:17 +0800
User-agent: mu4e 1.9.22; emacs 30.0.50

Platon Pronko <platon7pronko@gmail.com> writes:

> On 2023-05-05 08:34, Hongyi Zhao wrote:

>>    :bind
>>    (("<menu>" . helm-command-prefix)
>>     :map helm-command-map
>>     ("b" . helm-bibtex)
>>     ("B" . helm-bibtex-with-local-bibliography)
>>     ("n" . helm-bibtex-with-notes)
>>     ("<menu>" . helm-resume))
>> ```
>> When I hit <menu> 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
>   (("<f8>" . helm-command-prefix)
>    :map helm-command-map
>    ("b" . helm-bibtex)
>    ("B" . helm-bibtex-with-local-bibliography)
>    ("n" . helm-bibtex-with-notes)
>    ("<f8>" . helm-resume))

When I macroexpand

    (use-package helm-bibtex :bind ("<f8>" . 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
             ("<f8>" . helm-command-prefix)))
```

When I macroexpand

    (use-package helm-bibtex :bind-keymap ("<f8>" . helm-command-prefix))

I get this:

```emacs-lisp
(bind-key "<f8>"
  #'(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 "<f9>" either.  I
don't have "<menu>" 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.]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]