May 13, 2006

Emacs

I’ve finally started using the One True Editor. For good.

I had installed Emacs a while back, and had planned to learn using it for a long time. Things got in the way. The first road-block was that the version of Emacs I used wasn’t compatible with Xp’s Clear Type. Consolas, the best programming font ever looks terrible without sub-pixel smoothing.

I finally figured out that GNU Emacs 21.1 did use Clear Type, but it got removed from the latest 21.3 version due to some incompatibilities. I just downloaded the old version.

Now to the joys of Emacs customizations. Here’re some snippets from my .emacs file:

;; Disable file backups 
(setq make-backup-files nil)

;; Disable menu bar 
(menu-bar-mode -1)

;; Disable srcoll bar 
(toggle-scroll-bar -1)

;; Set the colour theme 
(require 'color-theme)
(color-theme-charcoal-black)

;; Start Emacs maximized 
(w32-send-sys-command 61488)

And some code for my blog post needs:

;; functions for blog posts 
(defun markdown-on-region (start end)
  "Convert Markdown syntax to HTML" 
  (interactive "r")
  (shell-command-on-region start end 
                           "python -u path/to/pymarkdown.py" t t))

I can just call this by M-x markdown-on-region… haven’t gotten around to specifying key bindings yet. Similarly, I’ve written functions for SmartyPants formatting, et cetera.

Ciao for now.

Tags:

No comments: