-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 =pod If you write tests, you probably get tired of changing: lang:Perl use Test::More tests => 41; to use Test::More tests => 42; every time you add a test. I finally got around to automating this in emacs by adding this to my C<.emacs> file: lang:Common Lisp (defun increment-number-at-point (&optional amount) "Increment the number under point by `amount'" (interactive "p") (let ((num (number-at-point))) (when (numberp num) (let ((newnum (+ num amount)) (p (point))) (save-excursion (skip-chars-backward "-.0123456789") (delete-region (point) (+ (point) (length (number-to-string num)))) (insert (number-to-string newnum))) (goto-char p))))) (defun increment-test-counter (&optional amount) "Increment the Test::More test counter by `amount'" (interactive "p") (save-excursion (goto-char (point-min)) (re-search-forward "tests\s+=>\s+" nil nil nil) (increment-number-at-point amount))) Then you just need to: (defun cperl-hooks () (local-set-key "\C-ct" 'increment-test-counter)) (add-hook 'cperl-mode-hook 'cperl-hooks) Now you can hit C to increment the test counter. You can also say C to increment the test counter by 42, if you want. This is so convenient. Next on my lispy agenda is to write a TAP parser so I can have a "green bar" that shows the status of my unit tests (and runs them when I'm not busy). -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQCVAwUBRs51hdAZeFPdJeQvAQK6VAQAvVgRvO5yRvQ7A71AESlD5rt3cuv/4Rpg jcn2txrybXryhodyPV2xJdSsWOKBOYuyenA0TvtfaJ+hB2p1J2+yofcz+517nSxS uOtBhHflZUOT1F/K4vaqtssz7pMGZ3ZNmO94F4toKQ2x+W1eU9XRwQ9DKYNDZY3t SDkix9UbpaU= =dPDc -----END PGP SIGNATURE-----