Some Custom Commands from Prot

Protesilaos Stavrou (Prot) has another video up in which he discusses a few of the commands he’s implemented to make his workflow easier. There’s no overriding theme, just some functions he’s written that ease his work in various ways.

For example, his first command deals with inserting comments. It puts the comment in the proper place using a heuristic based on where the point is but also adds a prefix consisting of a keyword and the date or a keyword and a date/time stamp. It is, as Stavrou says, not a big deal but it does make it easier to add comments as you code.

Next he considers diffing the current buffer. If the buffer has been modified, it diffs the buffer with the underlying file. If the current buffer is clean (has not been modified) it diffs it with the version in version control (if any). Again, this is pretty simple but very useful. When called with the universal argument, the function will highlight word-wise changes.

His next bit of Elisp is concerned with narrowing. Stavrou says it’s a simplification of some code by Bozhidar Batsov but I find Artur Malabarba’s code more useful.

The next bit of code involves escaping URLs and email address for Markdown. They’re nice but we Org mode users probably won’t find much use for them.

Finally, he presents some code to ease grepping. It uses the built-in grep function but puts a wrapper around it so that you don’t have to input all the information the standard implementation requires.

He has a sort of coda to the video that mentions a few things that he doesn’t discuss at length but that he finds useful.

There’s a lot of material in the video but it’s only 31 minutes, 27 seconds long. That short enough that you can probably fit it in easily but long enough that you’ll still have to schedule some time for it.

This entry was posted in General and tagged . Bookmark the permalink.