MobileOrg

October 22nd, 2009

2009-10-20: MobileOrg is in review at the App Store!

Why is this good news? Org-mode is a really nice Emacs mode for taking notes, outlining things, writing documents, keeping a calendar, diary, to-do list and timesheet, and making coffee. The App Store is where you can get programs for a device called the iPhone; you may have heard of it. MobileOrg promises to be an iPhone app that makes the two talk with each other. Having recently bought a Hong Kong-grade unlocked iPhone, I decided to take a look.

I checked out the sources from git and started the program on the iPhone emulator. I had some problems with org-mobile-push, so hopped on irc (#org-mode on freenode.net), where I was told to try the cvs version of org-mode instead of the version from emacs cvs. The gentleman advising me turned out to be the developer of MobileOrg, so I started pestering him with bug reports; his answer infallibly was two minutes of silence and then “pull and try again”. After some rounds of this I sent two buglet reports to Carsten Dominik (who handles the emacs side of things) (Update: and fixed the bugs within 3 hours!) and am now *very* much looking forward to having this app on my iPhone!

The way the integration between MobileOrg and emacs org-mode works is as follows: You tell org-mode which files (or directories) you want on your mobile. M-x org-mobile-push creates an index file containing links to all these files, and copies them (and all files they link to) to a staging directory. This staging directory should reside (or be copied to) a WebDAV server — I got a free account at mydisk.se, as the MobileOrg page recommends. M-x org-mobile-pull gets new and changed nodes from the staging directory and merges them with the local files.

iPhone-(or iPod touch-)side, you get a slick app that lets you browse the headers of your org files as hierarchical menus and lets you edit node contents. New nodes can also be created on the phone and end up in a special file on the emacs side after the next sync, where they can be refiled as normal in org-mode. Syncing is manual (i.e. no network traffic unless you tell so), and the app can work offline without problems.

The part I like best, though, is the “View Node as Document” command, which gives you a nice html view of the document or document part. Oh, and the fact that I can move my to-do / remember / agenda workflow to org-mode and iPhone.

(Didn’t take any screenshots yet, so go and look at the ones on MobileOrg’s webpage.)

AppleScript ScriptingAdditions not running under Snow Leopard?

October 1st, 2009

Hi Googler! If your newly-downloaded scripting addition seems to be in the right place but your AppleScript script doesn’t recognize it, make the AppleScript Editor run in 32-bit mode (Get Info on the icon, check “Open in 32-bit mode” in the “General” section).

July 21st, 2009

When I sit down to write something (these days, usually a paper or part of the thesis), I usually have a pretty clear picture of the flow of arguments, the overall structure and also have some key sentences ready. This is because I got in the habit of explaining stuff that interests me to an imaginary, sympathetic listener, an intelligent, curious guy who doesn’t know anything about the specifics of what I am busying myself thinking about.

If that imaginary guy becomes confused by my explanation, I know I don’t have a clear picture of what I want to say myself, and writing it down is premature.
And if the listener becomes bored, I know I have a problem … Chances are I am bored by the subject as well, and will make anything to become excited again. This usually means procastinating until deadlines become so tight that writing down boring stuff is exciting by itself because of the feeling of working “without a net”.

VirtualBox 3.0 hangs with Linux guest :(

July 8th, 2009

I installed VirtualBox 3.0 (on an OS X host) but got frequent hangs of the Ubuntu Linux client VM (Windows XP seemed to work fine). Going back to VirtualBox 2.4.4 lets me continue working.
I didn’t need the 3D acceleration anyway …

On tail recursion

May 28th, 2009

Like many, I was not very interested in tail recursion – it’s just a way of writing a loop in a more verbose way, right?  Luckily, Joe Marshall wrote a series of blog posts that made me reconsider my view – while self-calls might “only” be loops, mutual, never-ending tail-calls implement continuation-passing style, state machines etc.  Glad I got one more erroneous belief out of my system!

On Line Wrapping in Emacs 23(pre)

May 25th, 2009

Emacs, my editor of choice, is currently in pre-test; the next version, 23, will feature unicode, anti-aliased fonts and many other goodies.  It will also feature soft (visual) line wrapping and the attendant redefinition of next-line and previous-line commands for moving by lines-as-seen-on-screen instead of lines-as-contained-in-the-file.  This is very good for text modes and proportional fonts, but breaks programming modes, editing tabular data and keyboard macros.

Normally, functionality like this is implemented as a minor mode (viz. show-paren-mode, transient-mark-mode, font-lock, …), but cursor movement by visual line is a global setting instead, causing no end of discussions on the emacs mailing list.  The maintainers’ current stance seems to be “we’re in pre-test, so can only accept bug fixes for regressions from emacs 22, and this was already discussed 6 months ago.”

Luckily, emacs is quite customizable, so I implemented the behavior I want: visual line mode (soft word-wrapped lines) and visual line movement (cursor moves down one visual line instead of one text-file line) for text modes, and the normal behavior in all other modes.

(setq line-move-visual nil)
(add-hook 'text-mode-hook 'turn-on-visual-line-mode)
(add-hook 'text-mode-hook
          (lambda () (set (make-local-variable 'line-move-visual) t)))

Unbreak the Eee S101 keyboard

February 9th, 2009

The Eee S101 (and other netbooks^Wsmall laptops of that lineage) have as one of their distinguishing features a right-shift key that lies beyond the cursor-up key, thereby making the machine unusable for touch-typists.

Here is an adapted script from linuxquestions.org that just exchanges the right shift key and the cursor-up key:

#!/bin/sh

# set up keyboard to exchange the Shift and Up keys, and the Down and Right keys
xmodmap -e "keycode 62 = Up" # Shift => Up
xmodmap -e "keycode 109 = Prior" # Shift-shift => PgUp
xmodmap -e "keycode 111 = Shift_R" # Up => Shift
xmodmap -e "keycode 112 = Control_R" # PgUp => Shift-shift
xmodmap -e "add shift = Shift_R" # Make the new Shift key actually do shifting
xset r 62 # Make the new Up key autorepeat
xset r 109 # Make the new PgUp autorepeat
xset -r 111 # Prevent the new Shift key from autorepeating

I did not manage to get Fn-Shift_R working as a PgUp key (xev reports the same keycode for Fn-Shift_R and Shift_R) so left the xmodmap / xset lines in as a reminder to investigate further.

Ovi.com E71 sync fail

January 24th, 2009

Title says it all, really … I have 375 contacts, but after 300 of them I get an out-of-memory error during the inital sync with ovi.com (immediately after reboot, no other applications running).
:(

ʇsodƃoʃq-uʍop-ǝpısdn x-W

January 12th, 2009

Things to do when you’re vacationing in one of the most beautiful places in the world (i.e., Bali):

Why, implement code to turn text upside-down in your favorite editor, of course!

Emacs switcheroo

April 21st, 2008

I realized that I had customized Aquamacs to the point where it was behaving just like standard emacs, except when it wasn’t (”Ok, M-q to reindent, then … gnah, it quit again!”), so I switched to a normal Carbon Emacs build. So far I’m happy and not missing anything.