Skip to content

Instantly share code, notes, and snippets.

@cjp
Last active Feb 21, 2021
Embed
What would you like to do?
How to get org-protocol to work with spacemacs
;; I have no idea why it works. This is the product of 4 hours of trial-and-error.
(defun dotspacemacs/user-init ()
"Initialization function for user code.
It is called immediately after `dotspacemacs/init'. You are free to put almost
any user code here. The exception is org related code, which should be placed
in `dotspacemacs/user-config'."
(server-start)
(require 'org-protocol)
)
(defun dotspacemacs/user-config ()
"Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration. You are free to put any user code."
(with-eval-after-load 'org
(add-to-list 'org-modules 'org-protocol)
(setq org-capture-templates '(
("p" "Protocol" entry (file+headline "~/org/notes.org" "Inbox")
"* %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?")
("L" "Protocol Link" entry (file+headline "~/org/notes.org" "Inbox")
"* %? [[%:link][%:description]] \nCaptured On: %U")))))
Copy link

ghost commented Mar 31, 2018

nice one, ty for sharing!
I moved "(require 'org-protocol)" to user-config to make it work.

Loading

@vv111y
Copy link

vv111y commented May 18, 2018

You saved me much misery,
how will I ever repay you?
Thanks kindly

Loading

@snuffop
Copy link

snuffop commented Jul 9, 2018

Another 👍 from Me

Loading

@jaens
Copy link

jaens commented Oct 6, 2018

(on the develop branch)
Putting the require into user-init causes other org-mode modules to break with errors like Problems while trying to load feature ‘org-info’.
Putting it into user-config seems to work though.

Loading

@LaloHao
Copy link

LaloHao commented Sep 23, 2019

(on the develop branch)
Putting the require into user-init causes other org-mode modules to break with errors like Problems while trying to load feature ‘org-info’.
Putting it into user-config seems to work though.

Yes, you need to wait for spacemacs to finish loading, and then configure org mode, since they use their own version, otherwise you are loading old org mode with the require and then spacemacs tries to load it's own version

Loading

@mprokopov
Copy link

mprokopov commented Feb 21, 2021

also no need to (server-start),
use

 ;; If non-nil, start an Emacs server if one is not already running.
   ;; (default nil)
   dotspacemacs-enable-server t

instead.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment