aboutsummaryrefslogtreecommitdiff
path: root/emacs/init.org
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2017-01-14 15:56:29 +0100
committerMiquel Sabaté Solà <msabate@suse.com>2017-01-14 15:56:29 +0100
commitcc95fcb1344b1629f180e13edcc77b4a2628ecc9 (patch)
tree1a3ff8a20df42cd4ff3bed338eb47e3bd7aef36d /emacs/init.org
parent0596d60e9cac133946fc435a4ffacfdd03a7906e (diff)
downloaddotfiles-cc95fcb1344b1629f180e13edcc77b4a2628ecc9.tar.gz
dotfiles-cc95fcb1344b1629f180e13edcc77b4a2628ecc9.zip
emacs: added an html file
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'emacs/init.org')
-rw-r--r--emacs/init.org41
1 files changed, 26 insertions, 15 deletions
diff --git a/emacs/init.org b/emacs/init.org
index 9be404f..a68216e 100644
--- a/emacs/init.org
+++ b/emacs/init.org
@@ -1,7 +1,7 @@
#+TITLE: mssola's GNU Emacs configuration
#+AUTHOR: Miquel Sabaté Solà
#+BABEL: :cache yes
-#+PROPERTY: header-args :tangle init.el
+#+PROPERTY: header-args :tangle ~/.emacs.d/init.el
* Preface
<<sec:preface>>
@@ -14,38 +14,49 @@ byte-compiled. This means that all changes are to be made on the =init.org=
file *always*. The initial contents of the =init.el= are:
#+BEGIN_SRC elisp :tangle no
- ;; We can't tangle without org!
- (require 'org)
+;; We can't tangle without org!
+(require 'org)
- ;; Open the configuration
- (find-file (concat user-emacs-directory "init.org"))
+;; Follow symlinks
+(setq vc-follow-symlinks t)
- ;; Tangle it
- (org-babel-tangle)
+;; Open the configuration
+(find-file (concat user-emacs-directory "init.org"))
- ;; Load it
- (load-file (concat user-emacs-directory "init.el"))
+;; Tangle it
+(org-babel-tangle)
- ;; Finally byte-compile it
- (byte-compile-file (concat user-emacs-directory "init.el"))
+;; Load it
+(load-file (concat user-emacs-directory "init.el"))
+
+;; Finally byte-compile it
+(byte-compile-file (concat user-emacs-directory "init.el"))
#+END_SRC
There is no reason to track the init.el file, and no reason to change this
-file. Moreover, in order to avoid manually tangling and compiling the
-=init.org= file on each change, the following function is provided:
+file. In order to ensure this, make sure to apply the following command after
+cloning:
+
+#+BEGIN_SRC sh
+git update-index --assume-unchanged emacs/init.el
+#+END_SRC
+
+Moreover, in order to avoid manually tangling and compiling the =init.org= file
+on each change, the following function is provided:
#+BEGIN_SRC elisp
(defun tangle-init ()
"If the current buffer is 'init.org' the code-blocks are
- tangled, and the tangled file is compiled."
+ tangled, and the tangled file is compiled. Morever, an init.html is generated."
(when (or (equal (buffer-file-name)
(expand-file-name (concat user-emacs-directory "init.org")))
(string-suffix-p "dotfiles/emacs/init.org" (buffer-file-name)))
- ;; Avoid running hooks when tangling.
+ ;; Avoid running hooks when tangling
(let ((prog-mode-hook nil))
(org-babel-tangle)
+ (org-html-export-to-html)
(byte-compile-file (concat user-emacs-directory "init.el")))))
(add-hook 'after-save-hook 'tangle-init)