Lightweight multiple modes for semi-literate programming

Sometimes you don’t want a 100% reproducible system (org-mode, noweb, polymode) and instead just want an easy way to work with multiple languages within the same document (MuMaMo). Sometimes you don’t even want to go that far though and just want a really easy way to hack on different languages that have somehow ended up in the same file.
Jon posted the link here to Zane’s solution. Very cool. Nice reminder that if we were to read the Emacs and Emacs Lisp user manual, we would all know how to do this. Another nice reminder, even if we don’t, kind people provide the information and solutions for us, the very definition of community. I wanted a slightly different approach with just a couple additional things: line numbers instead of the point, safety checks for use via code, and a little more documentation:
Continue reading “Lightweight multiple modes for semi-literate programming”

How may one be sure that the OSX computer is actually asleep?

OSX provides many pleasant energy saving features. It is so efficient that it is difficult to know whether or not the machine is turned off (or sleeping) or just the screen is turned off. Trying to determine a method to answer that question I found many approaches that relied too much upon poorly understood features and nothing as clear as “there is a little light turned on” simply because there is no light and no clear answer assumedly. Probably that is by design. Eventually I suppose that the logical end is to learn about how the system level flags that prevent sleep (compiled or not) interact with the energy saving mechanism.

Whitespace

Most modern programming languages do not consider white space characters (spaces, tabs and newlines) syntax, ignoring them, as if they weren’t there. We consider this to be a gross injustice to these perfectly friendly members of the character set. Should they be ignored, just because they are invisible? Whitespace is a language that seeks to redress the balance. Any non whitespace characters are ignored; only spaces, tabs and newlines are considered syntax.

Whitespace must be learned.

God Mode — no more RSI

Lot of posts recently about the desire to reduce RSI from too much keyboard use in Emacs. Although I didn’t look up any studies or evidence of this, the idea of hacking how to handle keybindings in Emacs is always interesting.
God mode is one way to “simplify” things.
Basically you go in and out of the mode, and when in it, single key strokes are automatically prefaced with a control, and meta commands are prefaced with a g instead.