terça-feira, 24 de abril de 2012

Cleaner meaner emacs .init file

Just finished an improved version of my emacs configuration in order to clean up
its increasing complexity. Check out its size:

(defvar *my-default-lib* "~/.emacs.d/lib"
  "Vendor libraries that cannot be installed via the package system")
(defvar *my-conf* "~/.emacs.d/conf/"
  "My configurations")

(add-to-list 'load-path *my-default-lib*)
(add-to-list 'load-path *my-conf*)

(load "package-manager.el")
(load "misc.el")
(load "history.el")
(load "keybindings.el")
(load "ido-conf.el")
(load "autocompletion.el")
(load "eshell-conf.el")
(load "slime-conf.el")
(load "spell-checking.el")
(load "lisp-conf.el")
(load "scheme-conf.el")
(load "ruby-conf.el")
(load "js-conf.el")
(load "haskell-conf.el")

(setq custom-file (concat *my-conf* "custom.el"))
(load custom-file 'noerror)
Basically everything now has its own file. There is also a nice package system that I borrowed from here. That means that everything that can be installed through the package system will be.
(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/")
             '("ELPA"      . "http://tromey.com/elpa/"))


(defvar my-packages '(ac-slime
  "A list of packages to ensure are installed at launch.")

(defun my-packages-installed-p ()
  (loop for p in my-packages
        when (not (package-installed-p p)) do (progn (message "%s" p) (return nil))
        finally (return t)))

(unless (my-packages-installed-p)
  ;; check for new packages (package versions)
  (message "%s" "Emacs is now refreshing its package database...")
  (message "%s" " done.")
  ;; install the missing packages
  (dolist (p my-packages)
    (when (not (package-installed-p p))
      (package-install p))))

quarta-feira, 11 de abril de 2012

What school is all about

I have just finished a piece of John Taylor
Gatto's book. So far it is brilliant, heavy, and truer than the overwhelming material
I have read on schooling (exceptions go to Seymour Papert and Ivan
Illich). One thing that struck me deep was a poem by a high
school senior in Alton, Illinois, two weeks before he committed
I though of sharing it here, for me to remember what
school is all about.

He drew... the things inside that needed saying.
Beautiful pictures he kept under his pillow.
When he started school he brought them...
To have along like a friend.
It was funny about school, he sat at a square brown
desk Like all the other square brown desks... and his
room Was a square brown room like all the other
rooms, tight And close and stiff.
He hated to hold the pencil and chalk, his arms stiff
His feet flat on the floor, stiff, the teacher watching
And watching. She told him to wear a tie like
All the other boys, he said he didn't like them.
She said it didn't matter what he liked. After that the
class drew.
He drew all yellow. It was the way he felt about
Morning. The Teacher came and smiled, "What's this?
Why don't you draw something like Ken's
After that his mother bought him a tie, and he
always Drew airplanes and rocketships like
everyone else.
He was square inside and brown and his hands were
stiff. The things inside that needed saying didn't
need it
Anymore, they had stopped pushing... crushed, stiff
Like everything else.