Thursday, November 26, 2009

Emacs screencast: rectangles

I've just made a screencast about using rectangles in Emacs, so I figured I should explain how I made it.

I made it with ScreencastMode for Emacs - which I happen to be the author of.
With it, you can create a screencast by writing the manuscript for the screencast in a mix of natural language and elisp. The playing of the screencast itself is handled by Emacs - by stepping through the manuscript at pace equivalent to as if a human had done them. The video-recording at youtube is done using this.
The mode supplies utility functions for the producer such as pauses, slow typing, and blinking regions.

A simple example screencast file looks like:
(require 'screencast)

(screencast 
  '(
    "This is the message-buffer."
    (i "This is the command-buffer.")n
    "I will now show you how to save the command-buffer:"
    (save-buffer)
  )
"sample"
1.1
)
      
Which results in the following buffer output when the screencast has been played to the end.

Notice how the message-buffer contains the description of the commands done on the command-buffer. That is the way it works: the message-buffer describes what is going on in the command-buffer

More screencast sources can be found here.

Some critical questions has been asked about ScreencastMode, here are my attempts at answering them:
  • Why not read the info pages, which contains more details?
    • some people finds it easier to watch movies than reading static text.
    • screencast-mode displays the capabilities of a mode, instead of describing them.
    • those who just need to know how to use a mode doesn't need all the details of the info-page.
  • If videos are superior, why not just create a regular video?
    • a video is static, it's hard to change it if you discover an error - you'll have to do it in one take unless you got some video editing software.
    • the screencast sources can be edited by others, inviting collaboration (also it's a lot smaller size-wise)
    • the screencast will tell the user if his Emacs is configured right to use the feature it explains

Wednesday, November 25, 2009

Writing blog posts with Emacs

I'll be writing all my blog posts with Emacs (using html-mode), as Emacs is my favorite editor. But a big part of why I use Emacs for this, when a fancy web editor already is present in my browser, is the Firefox plug-in "It's All Text!". This simple plug-in allows me to pop into Emacs from any text box in Firefox, edit the content of the text box as if it was a normal file, save it, pop back to Firefox and watch the content of the text box change to what I just wrote in Emacs! The only setup required was to point "It's All Text!" to my editor program, and setup a shortcut to activate it - and voila: seamless integration between Firefox and Emacs. As a nice side effect, the texts are saved locally, thus I don't have to worry about a browser failure which usually would require me to write the text from scratch once more.

Before switching to "It's All Text!", I used Firemacs. Firemacs provides Emacs like bindings/shortcuts to the text boxes of Firefox - but when it comes to editing longer texts (such as this), then a fully fledged Emacs is superior to a few bindings.

Hello world!

Being a computer science student, I had to make this my first blog entry. The future content of this blog will be about being productive using the right tools. You can be guaranteed to see Emacs, Eclipse and Zsh mentioned often. Posts about shortcuts and general keyboard usage will also be present.