commit d1ad5225f9d2e15d60caa1994180ffaab616207e
parent f73744c92c84e8037b288cf829ebfc05df1256fa
Author: Alex Balgavy <alex@balgavy.eu>
Date: Mon, 11 Apr 2022 16:51:19 +0200
emacs: fix org block execution problem
Diffstat:
1 file changed, 22 insertions(+), 7 deletions(-)
diff --git a/emacs/config.org b/emacs/config.org
@@ -737,6 +737,25 @@ Perhaps nicer would be to exclude based on the property ~:STYLE: habit~, but I h
#+end_src
Maybe check [[https://old.reddit.com/r/orgmode/comments/8rl8ep/making_orgcaldav_useable/e0sb5j0/][this]] for a way to sync on save.
+*** export
+#+begin_src emacs-lisp
+ (custom-set-variables '(org-export-backends '(ascii html icalendar latex odt md)))
+#+end_src
+** org-ref
+It's a great package, but seems to be a bit buggy in my setup.
+Basically, having this package loaded would cause an error when executing a source block.
+So, install it, but only require it if we're not running in daemon mode.
+If we're running in daemon mode, add it as a hook [[*Daemon][below]].
+
+TODO: this should be reported as a bug at some point!
+
+#+begin_src emacs-lisp
+ (unless (package-installed-p 'org-ref)
+ (package-install 'org-ref))
+ (unless (daemonp)
+ (require 'org-ref))
+#+end_src
+
** calfw
Basically provides a way to show the org agenda as a standard GUI calendar app would.
@@ -897,11 +916,6 @@ Like virtualenvwrapper.sh, but for Emacs.
(setq venv-location "~/.config/virtualenvs"))
#+end_src
-** org-ref
-#+begin_src emacs-lisp
- (use-package org-ref)
-#+end_src
-
** org-noter
#+begin_src emacs-lisp
(use-package org-noter)
@@ -1569,11 +1583,12 @@ Then, if I'm in an emacsclient, I want to bind C-x C-c to that function (if not,
(global-set-key (kbd "C-x C-c") #'za/emacsclient-c-x-c-c))
#+end_src
-Furthermore, I want to set the theme correctly whenever I connect with 'emacsclient':
+Furthermore, I want to set the theme correctly whenever I connect with 'emacsclient', and org-ref needs to be loaded after a frame is created for some reason:
#+begin_src emacs-lisp
(if (daemonp)
- (add-hook 'after-make-frame-functions #'za/auto-select-theme))
+ (add-hook 'after-make-frame-functions #'za/auto-select-theme)
+ (add-hook 'after-make-frame-functions (lambda () (require 'org-ref))))
#+end_src
* Notmuch
Define some saved searches (i.e. mailboxes):