2010 in review

The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here’s a high level summary of its overall blog health:

Healthy blog!

The Blog-Health-o-Meter™ reads Wow.

Crunchy numbers

Featured image

A Boeing 747-400 passenger jet can hold 416 passengers. This blog was viewed about 7,800 times in 2010. That’s about 19 full 747s.

In 2010, there were 9 new posts, growing the total archive of this blog to 33 posts. There were 14 pictures uploaded, taking up a total of 941kb. That’s about a picture per month.

The busiest day of the year was March 30th with 408 views. The most popular post that day was Converting from TaskPaper to Emacs Org-Mode.

Where did they come from?

The top referring sites in 2010 were planet.emacsen.org, Google Reader, twitter.com, joelgreutman.wordpress.com, and google.com.

Some visitors came searching, mostly for aquaterm snow leopard, gnuplot aquaterm snow leopard, aquaterm 64bit, gnuplot snow leopard, and gnuplot aquaterm.

Attractions in 2010

These are the posts and pages that got the most views in 2010.

1

Converting from TaskPaper to Emacs Org-Mode March 2010
12 comments

2

gnuplot with AquaTerm on OSX Snow Leopard January 2010
8 comments and 1 Like on WordPress.com,

3

Importing contacts from OSX Addressbook to Emacs BBDB August 2009
3 comments

4

Emacs function to add new path elements to the $PATH environment variable January 2010
1 comment

5

Tips for using emacsclient and server-mode on OSX August 2009
2 comments


Three nifty alternatives to the M-TAB key in Emacs, and a replacement.

The M-<TAB> key in Emacs provides a useful completion function (`completion-at-point’), which tries to complete the current symbol at point to something useful, usually based on other symbols in the buffer which have the current partial symbol as a prefix.

However, using this key is a pain in most OS GUI systems, since it is usually mapped to the Task Switching function as well. Note that the <Alt> key doubles as <Meta> on most keyboards.

Emacs provides two documented alternatives, <Esc>-<TAB> – which requires a trip away from the home rows to the <Esc> key, and “C-M-i”, which is far easier to type.

In fact, there is a third way of inputting an equivalent key sequence: “C-[ C-i”, which is “<Control>-[“ followed by “<Control>-i”.

This works because “<Control>-[“ (that is the left square bracket) is equivalent to the <Esc> key, and also works as a <Meta> key.

control-bracket-2010-09-29-22-06.png

The Alternative to <Meta>

In fact, “C-[“ can be used anywhere a <Meta> is required. E.g.,

M-x” can be replaced with “C-[ x

<Esc> <Esc> <Esc> (to invoke `keyboard-command-quit’) can be replaced with “C-[ C-[ C-[“.

Using “C-[“ instead of <Esc> or <Meta> has the advantage that the key sequences can be invoked from the home screen, reduces hand movement (at least on a QWERTY keyboard), and also helps avoid the finger contortions that are otherwise often needed to access the <Meta> key.

Note that sequences which involve both <Meta> and <Control> keys can also be invoked, as long as the “C-[“ is entered first. E.g.,

C-M-x” (to invoke `eval-defun’ in an Emacs lisp buffer) can be replaced with “C-[ C-x”.  Sweet.


How I Learned to stop using Firefox and love the Chrome

One word: SPEED.

Seriously. I have been a long proponent and user of Firefox, having been lured into it by its relative elegance and the extension framework many moons back. Also, the web development support has always been far better than its competition, with Firebug and Web Developer to name just two great reasons for it being the developer’s browser of choice.

firefoxbrowserfreewaystocustomizeyourinternet1.png

The sheer number of Firefox add-ons and extensions (about 13,000 in the last count) is staggering – and list absolute essentials such as Adblock Plus, XMarks and DownThemAll! This combined with the themes (I suggest GrApple Yummy on the Mac) has been making the web browsing experience a far better one for me than Safari.

But the problem with Firefox is … it is SLOW.

With just seven add-ons (Adblock Plus, XMarks, DownThemAll!, 1Password, LastPass, FlashBlock and Firefox PDF Plugin for Mac OS X) it takes about 3-4 seconds to launch the application opening a blank home page on an OS X 10.6.3 MacBook. Another 2-3 seconds before any reasonable page is fully rendered. This becomes excruciatingly slow when I am busily opening tabs from a RSS reader or another application – and frustrating when it has to launch the first time I click on a link in another application.

Also, while a custom theme does look pretty – it sometimes does expose artifacts in the chrome (no pun intended) when rendering new pages – especially in the “awesome bar”.

All in all, while the experience is nice, it certainly is not perfect. Speed of launch and rendering are the main gripes.

googlechrome-getafastnewbrowser-forpcmacandlinux.png

I have been toying with Google Chrome ever since the beta for OS X came out. I was initially put off by the inverted tabs as well as lack of extensions (hey, a 21st century browser with no extensions, come on!) Also, the single URL bar/search bar UI seemed … odd. So while the beta version did stay on the HDD, it did not see much use, and Firefox remained the work horse for daily use.

However, with the recent launch of the stable OS X version, I became interested again. And this time Chrome did have a pretty mature extensions ecosystem, some of which seemed to be reasonable replacements for the Firefox equivalents. Time for a spin!

The first thing which struck me was the speed of launch as well as page renders, and the UI feels much more “fluid”. The Inverted tabs still look odd and out of place, but I understand the need to squeeze the additional 20-30 pixels for actual page use.

Actual page rendering in terms of quality is more or less at par with Firefox, though a few oddball sites (especially the work related sites) sometimes get weird effects. I blame it on the IE centric development though. :-)

The unified bar is also starting to make sense, as it actually helps in not having to remember one extra key short cut for searching. It has good support for Firefox like keyword searches as well (example, ‘wk’ for Wikipedia searches) provided you set them up.

I also found more or less feature equivalent extensions:

Xmarks is available for Chrome
Lastpass is available for Chrome
AdThwart in replacement of AdBlock Plus

I found that FlashBlock does exist for Chrome, but I don’t really need it anymore.

The one big hole in the extensions/add-on replacement is DownThem All! There are quite a few download managers, but none can match the Firefox one in terms of features (I am still looking).

The extension manager is also pretty nice, and arguably better than the Firefox one (at least for FF 3.6.3). However, the actual extensions gallery on Google is not quite as user friendly as the Firefox one. The extensions are not categorized completely, which makes it somewhat of a pain to search and find the right one.

extensions1.png

All in all, the Chrome experience has been a refreshing one so far, and Firefox has not seen much use of late – except where I needed to use DownThem All! (simultaneously downloading all chapters of the free audiobooks from www.librivox.org is one example). If anyone has recommendation for a good replacement, let me know.

So there you have it. My infatuation with Chrome has already lasted more than a week, and I still find it a pleasure to use. Have not really dabbled much with the extensions (and themes – Chrome does have support for these as well) – but am finding that I don’t really need to.


Emacs 23.2 has been released.

Emacs 23.2 has been released.

The source downloads are available at: ftp.gnu.org/gnu/emacs/

For those who prefer access to the VCS, the read-only bzr URL is:

http://bzr.savannah.gnu.org/r/emacs/emacs-23.

Enjoy!


Converting from TaskPaper to Emacs Org-Mode

Why TaskPaper and Org-Mode?

TaskPaper is a simple and elegant task management software for the OSX platform. It combines the simplicity of a text micro-format to mark the tasks, and the elegance of a Mac UI. It also provides a quick launch time and a nice system-wide quick entry window that is accessible with a single shortcut key.

tasks.png

taskpapercapturewindow.png

I have been a heavy user of Emacs’ Org-Mode for some years now, and love the power and flexibility it offers for tracking not just outlines and tasks, but any text based item, including notes and calendar entries. In fact Org-Mode has become one of the primary software that I use regularly, every day.

So where does the link between TaskPaper and Org-Mode come in? Both are text based, and have their own light-weight formats to define outlines and tasks. The underlying files are plain text with the meaning readable even when not viewed by the appropriate software. Org-Mode is obviously much more feature rich than TaskPaper, which by design keeps things simple.

However, there is one big difference that has led me to looking at integration: Org-Mode is Emacs based and hence takes ages to launch. TaskPaper on the other hand launches in under a second, and also offers a nice quick entry form that is available system-wide via a a global short-cut key.

Emacs aficionados will protest now – after all – Emacs is meant to be launched and never shutdown! This is true, but in my usage patterns, Emacs does get closed once in a while and having to launch it just to make a few quick Org-Mode entries (even with the excellent remember mode) becomes a pain.

My usage has now become more of the following:

  1. Use TaskPaper as an initial capture mechanism (sort of as a pre-Inbox store). I make heavy use of the quick entry window here
  2. Use a script to collect the TaskPaper entries and reformat them into a Org-Mode compatible file
  3. Append the converted entries into my primary Org-Mode Inbox whenever I have Emacs open

This (for me) provides best of both worlds – quick and ubiquitous data capture, and the power and flexibility of Org-Mode.

The Ruby Conversion Script

Without further ado, the script to convert from TaskPaper to Org-mode is:

#!/usr/bin/env ruby
#
# Converts Taskpaper files to Emacs org-mode files.
#
# Author: Anupam Sengupta, 2010
#
# Distributed under the BSD license (<a href="http://www.opensource.org/licenses/bsd-license.php">http://www.opensource.org/licenses/bsd-license.php</a>)
#
# Usage: From the command line, enter the command:
#
#  ./tpaper2org.rb &lt;taskpaperfilename&gt;
#
# The output is on STDOUT, which can be redirected to an Org-mode file.
# Whether the generated org-mode file should use odd-level prefix stars
# See <a href="http://orgmode.org/manual/Clean-view.html">http://orgmode.org/manual/Clean-view.html</a> for details.
ORG_USES_ODD_LEVELS = false

LINE_PATTERN = /^(\t*)          # Leading tabs
               -                # Followed by a dash (the taskpaper task identifier)
               (.*?)            # The task description
               ((@\w+\s*)*)     # The tags, if any
               $/x

all_tags = Hash.new(0)

Shiftlvl = ORG_USES_ODD_LEVELS ? 2 : 1 # Determine the number of stars to use in Org-mode entries

while (line = gets()):
  line.chomp!
   md = LINE_PATTERN.match(line)          # Match and extract each line
  if md then                                                # ................ A Task line
    tags = md[3].split(/ +/).reject {|tag| “@done” == tag } # get the tags, except @done tags
    tags = [‘’, tags, ‘’].flatten unless tags.empty?
    puts ‘*’ * (1 + Shiftlvl * (md[1].length + 1)) + (line =~ /@done/ ? “ DONE” : “ TODO”) + md[2] + tags.join(‘:’)
    tags.each { |tag| all_tags[tag] += 1} if tags # Keep a list of all tags
  elsif line =~/:$/                               # ................ A project line
    print “* “
    puts line.chomp(“:”)
  else                          # ................ Any other line
    puts line
  end
end

# Lets do a summary of the tags used.
puts &lt;&lt;END
# The tags used till now.
#+TAGS:#{all_tags.keys.sort.join(‘ ‘)}
END

Note that Org-mode supports multiple prefix styles with ‘*’. In particular, the odd-levels versus the odd-even levels is interesting and useful. The script has a ‘ORG_USES_ODD_LEVELS’ global variable that can be set to true if this is the desired export format.

In addition, the script also adds the tags used in the TaskPaper file as a ‘#+TAGS’ entry in the exported org-mode file. You can comment this if this is not required.

The TaskPaper format

The TaskPaper format is simple, and the file (which by default ends with the extension ‘.taskpaper’) is essentially a plain text file that can be opened and edited in any text editor.

The format can be summarized as (from the TaskPaper User’s Guide):

A project is a line ending with a colon:

      A Project:

A task is a line starting with a dash followed by a space:

    - My First Task

A Note is any line that is NOT a project or a task (i.e., does not start with a dash or end with a colon):

    Notes for a task

A tag is any word prefixed with the @ symbol. The tag can optionally have a value in parentheses after the tag name:

      - My First Task @atag @another_tag(1)

Outlining is done by indenting the tasks with tabs:

     - My First Task @atag
         - My sub-level task

Usage

Using the script is simple. Assuming that TaskPaper’s file is named tasks.taskpaper, from the OS X terminal, run the following command:

        $ tpaper2org.rb tasks.taskpaper >> tinbox.org

Where tinbox.org is the destination org-mode file.

This shell command can be put into a cron job or invoked from within Emacs to pull in the tasks as required. You may also want to delete the TaskPaper file (or empty its contents) after this is done, to prevent duplicate entries being imported the next time the Ruby Script is run.

Links

taskpaper.el is an Emacs mode for emulating the TaskPaper interface with support for projects and tasks. The tags support seems to be missing.

Discussion on the Org-Mode mailing list about Taskpaper and Org-Mode.


Firefox 3.6 finally allows true Fullscreen mode on Mac OSX

Updated to Firefox 3.6 today. As usual, a very solid update, and was pleasantly surprised by the full-screen mode (finally!) that works exactly as you would want it. This was one of the few areas where Firefox on OSX was lagging behind as compared to other platforms.

There were a few plugins that claimed to enable this in prior versions, but never worked very well.

The option is available under the “View”menu and has a standard Apple-Shift-F shortcut as well.

firefox1.png


Emacs function to add new path elements to the $PATH environment variable

A very simple eLisp function to add new path elements to the PATH environment variable. Very useful for adding new comint executables from within .emacs/init.el files.

(defun my-add-path (path-element)
 "Add the specified path element to the Emacs PATH"
  (interactive "DEnter directory to be added to path: ")
  (if (file-directory-p path-element)
    (setenv "PATH"
       (concat (expand-file-name path-element)
               path-separator (getenv "PATH")))))

Follow

Get every new post delivered to your Inbox.

Join 67 other followers