In ~/.emacs.d/init.el I'm calling my annotated configurations file settings.org like so:

(require 'ob-tangle)
 (expand-file-name "~/.emacs.d/settings.org"))

This generates settings.el however for some reason the file only includes what corresponds to the first 100 lines of code.

Nothing in the section Keymappings is making its way into settings.el. What am I doing wrong?


It solely seems to be a problem with keybinding commands. I moved things around and add stuff to sections that work and none of this causes an issue. Yet keybinding definitions don't seem to work with org-babel.


Lines 86-100 EOF in settings.el

;; Headings
(setq foreground1 "#ea056d")
(setq foreground2 "#e0f200")
(setq foreground3 "#ea056d")
(set-face-attribute 'org-level-1 nil
                     :foreground foreground1
                     :height 1.3
                     :weight 'bold)
(set-face-attribute 'org-level-2 nil
                     :foreground foreground2
                     :slant 'italic)

(setq org-src-fontify-natively 1)

;(require 'org)



The corresponding section in settings.org is this:

Syntax highlighting in org code blocks
#+begin_src emacs-lisp
(setq org-src-fontify-natively 1)

Load org mode
#+begin_src emacs-lisp
;(require 'org)

* Keymappings
** Switching between windows
This defines easy window switching, similar to my vim setup.
#+begin_src emacs-lisp
(define-key evil-normal-state-map (kbd "C-h") 'evil-window-left)
(define-key evil-normal-state-map (kbd "C-j") 'evil-window-down)
(define-key evil-normal-state-map (kbd "C-k") 'evil-window-up)
(define-key evil-normal-state-map (kbd "C-l") 'evil-window-right)
#+end_src emacs-lisp

You have #+end_src emacs-lisp. This confuses org-babel. Use just #+end_src.

Use the easy template system to insert structural elements and avoid such issues. Source blocks are <s <TAB>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.