all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Platon Pronko <platon7pronko@gmail.com>
To: Hongyi Zhao <hongyi.zhao@gmail.com>,
	help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: command-execute: Wrong type argument: commandp, helm-command-prefix
Date: Fri, 5 May 2023 09:40:08 +0800	[thread overview]
Message-ID: <1ccf06f2-b311-0989-8351-f0e866044936@gmail.com> (raw)
In-Reply-To: <CAGP6PO+YCVnjkN59o0sx2Dt7Bu7=YmBeodSpLJnReZP8rj5TUQ@mail.gmail.com>

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	other threads:[~2023-05-05  1:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-05  0:34 command-execute: Wrong type argument: commandp, helm-command-prefix Hongyi Zhao
2023-05-05  1:40 ` Platon Pronko [this message]
2023-05-05  2:45   ` Ruijie Yu via Users list for the GNU Emacs text editor
2023-05-05  4:18     ` Hongyi Zhao
2023-05-05  5:04     ` Michael Heerdegen
2023-05-05  5:13       ` Hongyi Zhao
2023-05-05  5:18       ` Ruijie Yu via Users list for the GNU Emacs text editor
2023-05-05  5:59         ` Hongyi Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ccf06f2-b311-0989-8351-f0e866044936@gmail.com \
    --to=platon7pronko@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.