Jump to zotero from emacs failed

Viewed 30

I'd like to jump to zotero when I click zotero links like zotero://select/items/1_2S5A64QI in my org file, but at the first time it doesn't work (no response). After opened the .emacs file and M-x RET eval-buffer RET, I backed to the org file, this time I can jump to the zotero successfully. What cause it?

(defun zotero-org (path)
(browse-url (format "zotero:%s" path)))
(org-add-link-type "zotero" 'zotero-org)

This is what I use to add a new link type.

1 Answers

You need to add-link after org is loaded.

Besides, org-add-link-type is obsolete since 9.0; use org-link-set-parameters instead.

(defun org-zotero-open (path)
  (browse-url (format "zotero:%s" path)))

(with-eval-after-load 'org
  (org-link-set-parameters "zotero" :follow #'org-zotero-open))
Related