tmalsburg/helm-bibtex

Error (use-package): org-ref/:init: Symbol’s function definition is void: org-cite-register-processor

Closed this issue · 6 comments

I use helm-bibtex and org-ref jointly, and the following error

Error (use-package): org-ref/:init: Symbol’s function definition is void: org-cite-register-processor

shows up when starting emacs or calling helm-bibtex with the configuration below

(use-package org-ref
  :ensure t :ensure helm :ensure ivy-bibtex :ensure helm-bibtex
  :bind (("\C-c«" . helm-bibtex)			     ; helm-bibtex
         ("\C-c )"  . org-ref-insert-link)
         ("\C-x c d" . doi-utils-add-bibtex-entry-from-doi)  ; find based on doi
         ("\C-x c n" . crossref-add-bibtex-entry))	     ; find based on name
  :init
  (require 'org-ref-helm))

If I change the init to config emacs starts normally, however, when calling helm-bibtex the error shows up again. I've then run a debug on error while calling helm-bibtex, which resulted in the following log

Debugger entered--Lisp error: (void-function org-cite-register-processor)
  org-cite-register-processor(helm-bibtex-org-cite-follow :follow helm-bibtex-follow)
  byte-code("\300\301\302\303#\210\304\305!\207" [org-cite-register-processor helm-bibtex-org-cite-follow :follow helm-bibtex-follow provide helm-bibtex] 4)
  autoload-do-load((autoload "helm-bibtex" "Search BibTeX entries.\n\nWith a prefix ARG, the cac..." t nil) helm-bibtex)
  command-execute(helm-bibtex)

As suggested here I've tried to require oc but without any luck. I'm not even sure if it makes sense to use helm-bibtex as a dependency of org-ref, or I should write a separate use-package? Thanks in advance.

Hm, I'm not really familiar with org-ref. If you get the error with a plain helm-bibtex configuration, I'm happy to look into it, but I suspect that the source lies somewhere else. org-cite-register-processor is not used in my code. So I'm not sure where this error is coming from. Configuring org-ref and helm-bibtex indenpendently may be an option, but I don't know whether that produces the results that you want.

org-cite-register-processor is not used in my code.

Are you sure? It seems to be called in helm-bibtex.el. I will try to call helm-bibtex independently and report here the results.

Oh, true. I had checked only in bibtex-completion.el. I guess the question is then why this function is not available on your system. Most likely explanation is that your org mode version is outdated. Org-cite is a relatively recent addition.

Ok...this is confusing. I had a built-in org-mode (9.3) and use-package is installing/using 9.4.6 as it is a dependency for other packages (ox-pandoc, org-ref, org-pdftools, org-noter. ob-async and citeproc). Then I have manually installed (but cannot use, because of the above dependencies) the latest version (9.5.5), which I assume is the one that contains org-cite-register-processor? The relevant parts of my configuration are

;; MELPA controls
(when (>= emacs-major-version 24)  
  (require 'package)
  (setq package-archives
  	'(("melpa" . "https://melpa.org/packages/")
  	  ("gnu" . "https://elpa.gnu.org/packages/")
  	  ))
  (package-initialize))

(use-package org
  :ensure t :ensure cdlatex :ensure adaptive-wrap :ensure ob-async 
  :commands (org)
  :pin gnu
  :mode (("\\.org$" . org-mode))
  :bind (("\C-cl" . org-store-link)     ;; Additional commands
         ("\C-ca" . org-agenda))
  :hook (
         (org-mode . adaptive-wrap-prefix-mode)		; needed for correct display
         (org-mode . visual-line-mode)			; needed for correct display
         (org-mode . org-indent-mode)			; needed for correct display	 
         (org-mode . turn-off-auto-fill)		; needed for correct display
	 )
  :init							
  ;; Lots of other stuff
  )

It seems as an unsolvable problem, as there are conflicts between different packages, each requiring a different org-mode version? Thanks in advance for any help.

Ok, I've managed to solve it by reinstalling everything org-* related. There are secondary effects in my agenda and org-babel, but helm-bibtex and org-ref seem to be working so I will close the issue. Thanks for your help.

Glad to hear that you could figure it out. I've been in similar situations with org. It's annoying and the fact that Emacs includes its own (outdated) version of org mode doesn't make things easier.