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: Platon Pronko
Subject: Re: command-execute: Wrong type argument: commandp, helm-command-prefix
Date: Fri, 5 May 2023 09:40:08 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1

On 2023-05-05 08:34, Hongyi Zhao wrote:
Hi here,

I'm using the following configuration for `helm-bibtex`:

```
(use-package helm-bibtex
   :init
   (setq

    ;; bibtex-completion-bibliography (directory-files-recursively
    ;;                     (concat (getenv "HOME")
"/texmf/bibtex/bib/local") "^[A-Za-z].+.bib$")


    ;;bibtex-completion-library-path (concat (getenv "HOME") "/pdf")
    ;;bibtex-completion-notes-path (concat (getenv "HOME") "/notes")
    bibtex-completion-pdf-field "File"
    ;;https://github.com/tmalsburg/helm-bibtex#insert-latex-cite-commands
    bibtex-completion-cite-prompt-for-optional-arguments nil)


   :config
   (require 'helm-config)
   :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))

   :config
   ;;https://github.com/tmalsburg/helm-bibtex#application-used-for-opening-pdfs
   ;;https://github.com/tmalsburg/helm-bibtex/issues/386
   (defun bibtex-completion-open-pdf-external (keys &optional fallback-action)
     (let ((bibtex-completion-pdf-open-function
        (lambda (fpath) (start-process "evince" "*helm-bibtex-evince*"
"/usr/bin/evince" fpath))))
       (bibtex-completion-open-pdf keys fallback-action)))

   (helm-bibtex-helmify-action bibtex-completion-open-pdf-external
helm-bibtex-open-pdf-external)

   (helm-add-action-to-source
    'helm-bibtex
    '(("P" helm-bibtex-open-pdf-external "Open PDF file in external
viewer (if present)")))

   
;;https://github.com/tmalsburg/helm-bibtex#browser-used-for-opening-urls-and-dois
   (setq bibtex-completion-browser-function
     (lambda (url _) (start-process "firefox" "*firefox*" "firefox" url)))

   )
```

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

Hi!

Can you provide a minimal test config for this issue? I tried to reproduce it 
with the following, but it doesn't throw any errors for me:

```(require 'package)
(setq package-archives '(
  ("gnu" . "http://elpa.gnu.org/packages/";)
  ("melpa" . "https://melpa.org/packages/";)))
(package-initialize)

(require 'helm)

(use-package helm-bibtex
  :init
  (setq
   bibtex-completion-bibliography (directory-files-recursively
                        (concat (getenv "HOME")
                                "/texmf/bibtex/bib/local") "^[A-Za-z].+.bib$")


   ;;bibtex-completion-library-path (concat (getenv "HOME") "/pdf")
   ;;bibtex-completion-notes-path (concat (getenv "HOME") "/notes")
   bibtex-completion-pdf-field "File"
   ;;https://github.com/tmalsburg/helm-bibtex#insert-latex-cite-commands
   bibtex-completion-cite-prompt-for-optional-arguments nil)


  :config
  (require 'helm-config)
  :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))

  :config
  (defun bibtex-completion-open-pdf-external (keys &optional fallback-action)
    (let ((bibtex-completion-pdf-open-function
       (lambda (fpath) (start-process "evince" "*helm-bibtex-evince*"
"/usr/bin/evince" fpath))))
      (bibtex-completion-open-pdf keys fallback-action)))

  (helm-bibtex-helmify-action bibtex-completion-open-pdf-external
helm-bibtex-open-pdf-external)

  (helm-add-action-to-source
   'helm-bibtex
   '(("P" helm-bibtex-open-pdf-external "Open PDF file in external
viewer (if present)")))

  
;;https://github.com/tmalsburg/helm-bibtex#browser-used-for-opening-urls-and-dois
  (setq bibtex-completion-browser-function
    (lambda (url _) (start-process "firefox" "*firefox*" "firefox" url)))

  )
```

--
Best regards,
Platon Pronko
PGP 2A62D77A7A2CB94E




reply via email to

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