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.

§
Push-down.

Well-put:

I tried to use a word processor to edit a 14-page interview a couple of weeks ago. I can’t believe anyone puts up with that. You have to position the mouse cursor just so to select a region of text, then cut it, then position the mouse cursor just so and then paste it.

mr_chromatic, reddit

Pick Emacs or vim; learn it. Text editing without them is a bleary swamp land surrounding these two bastions of freedom.

[(2008 October 23, 5!) .]

§
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) .]

§
2007 predictions, final updates

Let’s wrap up the 2007 predictions with as little crying as possible, OK?

[Mac OS X failing], with Vista, will leave a power vacuum in the OS market, one that is not filled by Linux, which will lack an OS to copy from which to copy any more features.

TRUE. 2007 was not a good year for operating systems. Unless, of course, you count the release of Emacs 22.1. What happened to version 22, you ask? It’s currently lost in the beard of Richard Stallman, and no amount of open source communism is enough to entice anybody to go and retrieve it.

Web 2.0 will stagnate.

TRUE. Web 2.0 is no longer cool. Lame Internet fads are cool again.

Language interpreters will become a bottleneck.

TRUE. Python is cool now. We all know Python is not interpreted; it’s, in fact fed through van Rossum’s head before he manually flips the diodes in your monitor. That’s right, I’m making this public: Python only runs on LCDs. Deal with it, bitches.

Perl 6.0 will not be released. Python 3000 will not be released.

DOUBLE TRUE. Perl now has Rakudo, Pugs, and about twenty other mini-languages. Apparently, “focus” in the Perl community is a weird way of spelling “vapor.” As in vaporware. MORPHEME BURN. Sizzle sizzle, bitches. (Seriously, when C++0x adds a whole bunch of unnecessary features, it’s lame. But when Perl 6 does it, it’s “Come on, we have nightly builds?”)

dotfloofy dotblog will reach its fourth anniversary.

FALSE. We had a continuity jump and we are, indeed, in our sixth anniversary by now. Scientists, with their sciencing, widely believe this is due to anomalies caused by the pesto sauce I spilled back around June of 2007.

[(2008 April 1) .]

§
Order.

Make your title bar in GNU Emacs useful.

;; File names in title bars with a twist: Replace HOME with ~ while
;; still working with Emacs' / and HOME's \. And it works for
;; Windows-style HOMEs.
(setq frame-title-format 
      '(:eval 
        (if buffer-file-name
	    (replace-regexp-in-string
	     "\\\\" "/"
	     (replace-regexp-in-string 
	      (regexp-quote (getenv "HOME")) "~"
	      (convert-standard-filename buffer-file-name)))
          (buffer-name))))

Delete, not kill.

;; Damn it, stop messing with my clipboard.
(global-set-key "\C-c\C-d" 'delete-region)
(add-hook 'minibuffer-setup-hook
          '(lambda ()
             (define-key minibuffer-local-map "\C-c\C-d"
               '(lambda ()
                  "Delete everything in minibuffer"
                  (interactive)
                  (delete-minibuffer-contents)))))
[(2007 September 11) .]