tmalsburg/helm-bibtex

Symbol's function definition is void: helm-bibtex-helmify-action

Closed this issue · 3 comments

I adjust the example configuration here for helm-bibtex, as shown below:

(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-actions
 'helm-bibtex
 '(("P" helm-bibtex-open-pdf-external "Open PDF file in external viewer (if present)"))) 

But I meet the following error with the above configuration:

Warning (initialization): An error occurred while loading ‘/home/werner/.emacs.d/init.el’:

Symbol's function definition is void: helm-bibtex-helmify-action

Any hints for fixing this problem?

Regards,
HY

I can't reproduce your specific issue. In my setup helm-bibtex-helmify-action is found and works. Are you sure helm-bibtex is loaded when you run this code? A reproducible example would be helpful.

However, there is another problem: You're using helm-add-actions but that function doesn't exist. You need to use helm-add-action-to-source.

I'm going to close this issue but feel free to reopen when you have a reproducible example.

You need to use helm-add-action-to-source.

According to your above comment, I change to the following and the problem disappeared:

;https://lucidmanager.org/productivity/emacs-bibtex-mode/
(setq bib-files-directory (directory-files-recursively
                             (concat (getenv "HOME") "/texmf/bibtex/bib/local") "^[A-Za-z].+.bib$")
      ;pdf-files-directory (concat (getenv "HOME") "/pdf")
      ;bib-notes-directory (concat (getenv "HOME") "/notes")
      )

(use-package helm-bibtex
  :config
  (require 'helm-config)
  (setq bibtex-completion-bibliography bib-files-directory
        ;bibtex-completion-library-path pdf-files-directory
        ;bibtex-completion-notes-path bib-notes-directory
        bibtex-completion-pdf-field "File"
        ;https://github.com/tmalsburg/helm-bibtex#insert-latex-cite-commands
        bibtex-completion-cite-prompt-for-optional-arguments nil)
  :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
   (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))) 
  

    ;https://github.com/tmalsburg/helm-bibtex#predefined-searches
    (defun helm-bibtex-my-publications (&optional arg)
      "Search BibTeX entries authored by “Jane Doe”.
        With a prefix ARG, the cache is invalidated and the bibliography reread."
      (interactive "P")
      (helm-bibtex arg nil "Jane Doe"))

    ;; Bind this search function to Ctrl-x p:
    (global-set-key (kbd "C-x p") 'helm-bibtex-my-publications))

But if I add the :demand t option of use-package to the above configuration, the following problem will appear:

Error (use-package): helm-bibtex/:config: Wrong number of arguments: (3 . 4), 2 Disable showing Disable logging

Any hints for this problem?

Regards,
HY

No idea. I'm not familiar with use-package. Sorry.