[ Content | Sidebar ]

Archives for Emacs

Keeping Temporary Files Out Of The Way In Emacs

Found some very useful emacs info in this this blog post. Put the following into your config and your temporary and autosave files will not clutter up your project directory. (defvar user-temporary-file-directory (concat temporary-file-directory user-login-name “/”)) (make-directory user-temporary-file-directory t) (setq backup-by-copying t) (setq backup-directory-alist `((“.” . ,user-temporary-file-directory) (,tramp-file-name-regexp nil))) (setq auto-save-list-file-prefix (concat user-temporary-file-directory “.auto-saves-”)) (setq [...]

Caps Lock to Control Key in Ubuntu

I like to remap my caps lock key to an extra control key (this can be common practice in the emacs world).  It’s closer to the common keys that are paired with control.  And besides, I only ever turn on caps lock by mistake.  Recently, while installing Ubuntu on a box, I was looking for the [...]

Static vs Dynamic Scope

// start pseudo-code var y = “global”; function print-y() { print(y); } function test-scope() { var y = “local”; print-y(); } test-scope(); // statically scoped languages print “global” // dynamically languages print “local” print-y(); // all languages should print “global” // end pseudo-code This is the standard type of example used to explain what static [...]

“wc”-like Unix Command in Emacs Lisp

Inspired by reading a Steve Yegge blog post. (require ‘cl) (defsubst wc-whitespace-char? () “is current character whitespace?” (not (looking-at “[A-Za-z0-9]“))) (defun wc-buffer (b) “count words in a buffer” (interactive “bBuffer to Analyze “) (let ((word-count 0) (in-word nil) (char-count 0) (line-count 1)) (save-excursion (set-buffer b) (beginning-of-buffer) (while (not (eobp)) (if in-word (if (wc-whitespace-char?) (setq in-word [...]

Startup Scripts on OS X

I have a set number of programs that I usually want to start when my macbook pro boots up. But sometimes I want to boot in a hurry and all the startup items bother me. I came up with a solution I thought I’d pass on. I load Aquamacs automatically, as I use it for [...]