firefox - 让 org-protocol 在 Firefox Quantum 上运行 - `No server buffers remain to edit` 错误

标签 firefox emacs org-mode

所以我正在尝试让 org-protocol 首次在 Firefox Quantum 上运行。我浏览了各种博客文章和文档,但仍然无法克服这个特定的错误

Greedy org-protocol handler.  Killing client. 
No server buffers remain to edit.

所以我在 Ubuntu Linux x64 16.04 上使用 emacs 25.3,以及新发布的 Firefox Quantum。

我尝试通过两种方式做到这一点。

  1. 通过创建桌面条目然后在 Firefox 中设置小书签来设置 org-protocol 的传统方法。

  2. 在 Firefox 中使用 org-capture 插件。

两者都给了我同样的错误。

对于方法 1,我遵循 documentation以及一个非常有用的 stackexchange 帖子:

How to make org-protocol work?

还有这个有用的博客 post .

这是我所做的:

A.我创建了一个桌面条目:

[Desktop Entry]
Name=org-protocol
Exec=emacsclient -n %u
Type=Application
Terminal=false
Categories=System;
MimeType=x-scheme-handler/org-protocol;

B.将配置添加到 .spacemacs 文件。

我添加了以下几行:

(server-start)
(require 'org-protocol)

然后我在 .spacemacs 文件中设置捕获模板:

(setq org-capture-templates
      (quote 
              ("p" "org-protocol" entry (file+headline "~/Dropbox/config/org/refile/refile.org")
                "* %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%:initial\n#+END_QUOTE\n\n\n%?")
              ("l" "org-protocol link" entry (file "~/Dropbox/config/org/refile/refile.org")
                "* %? [[%:link][%:description]] \nCaptured On: %U")
... Additional templates.
))

C.然后我创建了带有位置的书签:

javascript:location.href='org-protocol://store-link://l/'+encodeURIComponent(location.href)

javascript:location.href='org-protocol://capture://l/'+encodeURIComponent(location.href)+'/'+encodeURIComponent(document.title)+'/'+encodeURIComponent(window.getSelection())

完成所有这些操作后,我仍然收到上面提到的错误消息。

其次,我尝试了 Firefox 中的 org-capture 插件。但它也不起作用。

不确定错误的原因是什么。如有任何帮助,我们将不胜感激。

在其他阅读中,当 org-capture 模板存在问题时,人们会收到此 Greedy 错误,但我没有发现任何错误。

最佳答案

我过去也遇到过一些麻烦。

现在我使用的解决方案是这个firefox add-on -> 您可以直接从 Firefox 安装它。这真的很简单,就我而言,它开箱即用(Debian 发行版,Firefox 52.5.0)。我不知道它是否适用于 Firefox Quantum。

org-protocol照常配置。就我而言:

cat > "${HOME}/.local/share/applications/org-protocol.desktop" << EOF
[Desktop Entry]
Name=org-protocol
Exec=emacsclient %u
Type=Application
Terminal=false
Categories=System;
MimeType=x-scheme-handler/org-protocol;
EOF

然后

update-desktop-database ~/.local/share/applications/

在您的 Emacs init.el 文件中:

(server-start)
(require 'org-protocol)

(setq org-capture-templates `(
    ("p" "Protocol" entry (file+headline ,(concat org-directory "notes.org") "Inbox")
        "* %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?")
    ("L" "Protocol Link" entry (file+headline ,(concat org-directory "notes.org") "Inbox")
        "* %? [[%:link][%:description]] \nCaptured On: %U")
))

仅此而已。在我的配置下它可以工作,我希望这对你来说也是一样的。

<小时/>

额外:前段时间,我建议了一个小的模板改进来处理 ArXiv.org 标题,详细信息在这里:https://github.com/sprig/org-capture-extension/issues/37

关于firefox - 让 org-protocol 在 Firefox Quantum 上运行 - `No server buffers remain to edit` 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47647948/

相关文章:

emacs - 如何将 clojure 源文件连接到 Emacs 上正在运行的 clojure repl?

emacs 查询替换正则表达式倒置

emacs - org-mode 和 yasnippet 之间的冲突

emacs - 在组织模式下将CREATED date属性添加到TODO

javascript - Firefox 说无法下载搜索插件

html - MP4 视频未在 <video> 标签中在 Firefox 上播放,如果直接打开则播放

jquery - 页面重新加载后移动复选框列表中的复选标记 - 仅限 Firefox

javascript - 为什么 Firefox 会失去对页面重新加载的关注?

emacs - 如何在递归编辑期间防止编译滚动输出出现 "unstuck"?

emacs - 组织模式 C-c a undefined