The Dark Balloon

A weblog by Hao Lian.
A terrible secret guarded by golems.
A note that thanks you for being born, all those years ago.

§
global-set-keys, Emacs

Instead of global-set-key calls, use this:

(defun global-set-keys (alist) nil
  (mapcar (lambda (a) nil
            (setcar a (read-kbd-macro (car a)))
            (apply 'global-set-key a)) alist))

An example:

(global-set-keys
 '(
   ("<f7>" markdown)
   ("<f8>" (lambda (warp)
              (interactive "sLevel warp: ")
              (desktop-change-dir
               (gethash warp warp-table (gethash "f" warp-table)))))
   ("<f9>" svn-status)

   ("C-c C-d" delete-region)
   ("M-d" delete-word)
   ("C-<backspace>" backward-delete-word)

   ("C-c C-f" auto-fill-mode)
   ("C-c C-<return>" unfill-paragraph)

   ("C-x C-k" (lambda () (interactive) (kill-buffer nil)))
   ("C-c C-b" electric-buffer-list)

   ("C-c C-r" xsteve-ido-choose-from-recentf)
   ("M-x" ido-execute)

   ("C-z" nil)
   ("C-c C-m" make-directory)
   ("C-?" redo)
   ))
[(2008 June 28) .]

Abandon your ideas.

Use Markdown+, but not HTML. In code blocks, beware angle brackets.