从Emacs跳到Zotero失败

发布于 2025-02-13 23:57:25 字数 348 浏览 4 评论 0原文

当我单击Zotero链接时,我想跳到Zotero,例如zotero:// select/itect/tock/1_2s5a64qi在我的org文件中,但第一次行不通(无响应)。打开.emacs文件和mx ret rest-buffer ret后,我返回到了org文件,这次我可以成功地跳到Zotero。什么原因?

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

这是我用来添加新链接类型的方法。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半边脸i 2025-02-20 23:57:25

加载组织后,您需要添加链接。

此外,org-add-link-type自9.0起就被过时了。使用org-link-set-parameters

(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))

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))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文