Monthly Archives: February 2009

Emacs creeps up on me

I have used vim for years—since I started coding PHP. (Sometimes I preferred the Zend Studio editor because nothing does a better job of cross-linking in PHP projects. Unfortunately, almost anything could do a better job of memory management. As WordPress grew, the Zend editor became too slow to be usable. Too bad. I miss it.) Now that I am writing some Erlang, I am learning to use emacs.

The credit for this switch belongs entirely to the lovely erlang-mode. (I tried TextMate’s erlang mode but I couldn’t get past TextMate’s strange navigation keys, etc. I wish there were standard navigation keys in OS X. Too bad. I’ve heard TextMate is great.) The emacs erlang-mode helps me write beautiful code. Now that I’m also learning to use emacs in php-mode I rarely become disoriented and type “:w” to save a file. (I don’t miss vim.)

Not everything about emacs is perfect. It doesn’t understand my Mac’s right-delete key. Left-delete (backspace) won’t delete a tab; it converts it the tab spaces and deletes one of them so that I have to hit backspace many times to delete a single tab. And in php-mode, the indentation rules are far more complex than the WordPress coding standards; I just want tabs in php-mode.

Even though I have these problems, you have to hand it to emacs for being customizable. It took a couple of hours to find all the solutions, but I solved all of the above problems above by adding these lines to my .emacs file:

;; Map OS X Terminal SSH delete key                                                                                                                                  
(global-set-key (read-kbd-macro "ESC [ 3 ~") 'delete-char)

;; Backspace should delete, not convert tabs to spaces                                                                                                               
(setq c-backspace-function 'backward-delete-char)

;; In PHP, never indent; always insert TAB.
(require 'php-mode)
(defun my-php-mode-hook ()
  (local-set-key (kbd "TAB") 'self-insert-command))
(add-hook 'php-mode-hook 'my-php-mode-hook)

This works for me even though I understand less than half of it. There is so much to learn.

Smoke… for the children!

The health of American children will rest on the shoulders of a dying breed if President Obama signs the SCHIP Reauthorization Act of 2009. Click the PDF version and scroll to page 265, Title VII—Revenue Provisions. Taxes on tobacco and related products will increase by as much as 3,057%. Here’s a sample:


(a) Cigars- Section 5701(a) of the Internal Revenue Code of 1986 is amended–

(1) by striking `$1.828 cents per thousand ($1.594 cents per thousand on cigars removed during 2000 or 2001)’ in paragraph (1) and inserting `$50.33 per thousand’,


(c) Cigarette Papers- Section 5701(c) of such Code is amended by striking `1.22 cents (1.06 cents on cigarette papers removed during 2000 or 2001)’ and inserting `3.15 cents’.

Funding child health care by taxing smoking, an activity which is increasingly targeted for eradication by government campaigns, creates an indirect conflict of interests. You can’t have it both ways. But according to the rhetoric of our times, individuals are morally compelled to sacrifice themselves for the good of the collective.

So find a place where it’s still legal and light up, smokers! Spread the good news to your non-smoking friends: to quit is to condemn future generations. These are the times that try men’s lungs.

If you smoke a non-tobacco substance, put away the reusable smoking paraphernalia and puff your stuff in papers taxed under 5701(c). Better yet, use the wrapper from a cigar taxed under 5701(a) and remind yourself that you did it for the children.