Trying to convert my personal configuration for Emacs Prelude to use an org-based config. Looked around for a couple of days on this site, github and elsewhere but have not found a way to get org-babel-tangle working correctly to prouduce a working my-init.el file in my personal Prelude directory. What I've tried (at the top of the org file):

+BEGIN_SRC emacs-lisp :tangle yes

"Tangles my-init.org and byte compiles ~/.emacs.d/personal"

(interactive)

(when (equal (buffer-name)

            (concat ~/.emacs.d/personal/my-init.org"))

 (org-babel-tangle)

 (byte-recompile-directory (expand-file-name user-emacs-directory) 0)))

(add-hook 'after-save-hook #'my--tangle-byte-compile-org)

(add-hook 'kill-emacs-hook #'my--tangle-byte-compile-org)

+END_SRC

However M-x eval-region on the code block yields the following. "End of file during parsing". The .el file was created from the org file but with the error listed above. So nothing would load.

Near the end of the file I had the following elisp (right above the require my-init for Prelude which were the very last lines):

+BEGIN_SRC emacs-lisp :tangle yes

(defun my/tangle-dotfiles ()

"If the current file is this file, the code blocks are tangled"

(org-babel-tangle nil "~/.emacs.d/personal/my-init.el")

(byte-compile-file "~/.emacs.d/personal/my-init.el"))

(add-hook 'after-save-hook #'my/tangle-dotfiles)

+END_SRC

But here again the .el file was created but the config failed to load. No other warnings. So I removed each of these blocks one by one, ran org-babel-tangle on the org file but now get the following message:

Compiling file /path/to/.emacs.d/personal/my-init.el at Wed Aug 23 00:35:10 2017 my-init.el:207:8:Error: Invalid lambda variable 92

Compiling no file at Wed Aug 23 00:39:31 2017

Any thoughts or suggestions for getting org-babel-tangle to work nicely with Prelude would be greatly appreciated.

Edit: using the default version of Emacs (25.2) on Fedora including the version of org-mode. Prelude is up to date.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.