Modified deft-mode to multiple directories

After some hacking, I've been able to modify the wonderful Deft mode by Jason R. Blevins to support several directories. I had my notes divided in several directories, including my TO-DO entries, and I thought it would be nice to give Deft the possibility to support several directories, and at the same time, an exercise for my Emacs Lisp.

I tried to make the least modifications as possible to the original source, so that the change can be made with a patch, if the original author considers it (this is also why I didn't change the name of the mode either.) You can download it, and read instructions of installation and usage here:

deft-multidir on GitHub

As always, feedback is highly appreciated.

Macros Emacs para facilitar introducir entradas

Continuando con el formato org-mode, he añadido también un esqueleto que rellena de forma automática los campos de una entrada del blog, para que sólo tenga que escribir el texto y las categorías. Es la siguiente función Emacs-Lisp:

(define-skeleton add-new-post
  "Add a new post with the current date and time. Ask for the post title."
  "Post title: "
  "(new-post" \n
  > "\"" str "\"" \n
  > ":body \"" _  "\"" \n
  > ":categories '('general)" \n
  > ":body-format 'string" \n
  > (format-time-string
     ":hours %H :minutes %M :day %e :month %m :year %Y)"
     (current-time)) \n )

La función new-post me permite añadir una entrada al blog. Es código Common Lisp, por lo que se ve que comienza por un parémtesis. El patrón (definido por el macro de Emacs-Lisp define-skeleton después me pregunta por el título de la entrada (el uso de la variable str hace que me pregunte a la hora de insertar el patrón). Después, añade el cuerpo vacío y también la fecha actual de la entrada obtenida de la función de Emacs-Lisp (current-time). Finalmente, el carácter _ indica la posición en la que queda el cursor, con lo que puedo empezar a escribir el cuerpo de la entrada.

Translation within Emacs using Google Translate

Just to show a little Emacs-Lisp script I wrote the other day. We're in the process of translating all our class material into English, and thought of getting some help from Google Translator. Selecting a phrase and calling the insert-translation function substitutes current text with its traduction into English. You know, Google Translate fails a fair bit, but it helps, and you don't have to write all the slides again...