summaryrefslogtreecommitdiffstats
path: root/emacs/.emacs.d/org/preparation.org
blob: 4baffc6a72b0e3c57e27bba6d08485fe1fc8600d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#+STARTUP: showall

Some things have to be done to make sure that everything works as it
should. This includes enabling lexical binding, loading Cask and
keeping some comments.

* Use lexical binding

  For some of my functions, and general coolness, lexical binding is a
  must. Without it, closures cannot be made for example.

  #+BEGIN_SRC emacs-lisp :padline no
    ;; -*- lexical-binding: t -*-
  #+END_SRC

  This line needs to appear at the beginning of the file to work. Just
  to keep things looking nice I put it at the beginning of the file.

* Keep package.el from changing my init

  Some time ago my init file was changed by Emacs. It added a single
  line of code and some explanatory comments. Apparently I need to
  keep this comment in my initialization file so that Emacs doesn't
  try to add the code again. I actually use [[http://cask.readthedocs.org/en/latest/][Cask]] to manage and load my
  packages so I don't need this.

  #+BEGIN_SRC emacs-lisp
    ;; (package-initialize)
  #+END_SRC

* Load Cask

  I use Cask to manage my installed packages and for that to work I
  need to load Cask at the start of the initialization file. This
  should be executed both when byte-compiling and loading at run-time
  so that other bits and pieces can byte-compile without warnings or
  errors.

  #+BEGIN_SRC emacs-lisp
    (eval-and-compile
      (require 'cask "~/projects/ext/cask/cask.el")
      (cask-initialize))
  #+END_SRC