Archive - March 2007

Opera 9.20 beta 1

2007-03-28 15:49

Opera 9.20 is out. Here’s stuff for you to read:

So, what’s new?

  • There’s now a menu item in Tools -> Advanced that brings you to a landing page for developer tools. The developer console really is quite nifty
  • Speed Dial, a default blank page which allows you to keep up to nine URLs handy, with thumbnails and instant keyboard shortcuts (Ctrl-1 to Ctrl-9 accesses your speed dial sites directly). If you’d just prefer the regular plain old blank page, go to opera:config#UserPrefs|SpeedDialState and set the value to ‘3’ to turn it off. The allowed values are:
    • 0: Folded
    • 1: Shown
    • 2: Read only, and always show speed dial
    • 3: Disable speed dial
  • Multiple other fixes, for rendering, stability and security. Too much to list, read the changelogs if you need the details.

You know you want it, so go get it!

Komodo: Open current selection as file

2007-03-22 17:33

When switching to Komodo Edit, I missed the ability to open file named by the current selection. Luckily, because of the macro support, getting this feature is fairly easy. This macro will re-enable that feature. It opens the current URL in the editor. If the URL appears to be relative, it lets Komodo resolve the URL, but it also supports absolute URIs and for absolute URL’s it has support for the file, http, ftp and scp protocols. If there is no current selection, you will get prompted to type a URL (this is a deliberate choice, because if I want to browse for a document, I can use the regular Open dialog).

So, how do you get this? Create a JavaScript macro with the following contents, and bind it to your favorite key (mine is Ctrl-Alt-O):

try {
    komodo.assertMacroVersion(2);
    if (komodo.view) { komodo.view.setFocus() };
    var sel = komodo.editor.selText;
    if (!sel.length)
    {
      sel = prompt("Choose filename");
    }
    // resolve path if not absolute
    var re = new RegExp("^(\/|(file|http|ftp|scp):\/\/)");
    if (!re.test(sel))
    {
      var dir = komodo.document.displayPath.replace(komodo.document.file.baseName,'');
      sel = dir+sel;
    }
    else
    {
      var re = /^((http|ftp|scp):\/\/[^\/]+)/;
      if ((sel[0] == "/") && (re.test(komodo.document.displayPath) ))
      {
         var matches = re.exec(komodo.document.displayPath);
         if (matches[1])
         {
            sel = matches[1]+sel;
         }
      }
    }
    komodo.openURI(sel);
}
catch(e)
{
    alert(e)
}

Edit: Small fix to make relative URI’s work properly on remote files.

Feed consolidation

2007-03-21 11:39

In an attempt to make the subscription options for this site a bit easier to understand, and as the early start of a major revamping of this site, I am starting by making one small change: There will no longer be a separate summaries feed, just a full-text feed. If you desire just summaries, please choose a newsreader that lets you choose whether you want to see the summaries or the full text. Thank you.

So, any of my readers still subscribed to my summaries feed, should change their subscription address to http://virtuelvis.com/feeds/fulltext — you will already have been automatically and permanently redirected by the time you read this, but I still encourage you to change the address, as that’s the best guarantee you have against future problems.

On my original list of feeds to consolidate into the main feed was also the feed for my bookmarks - but before doing this, I guess I should ask my readers: Do you want this consolidated, and have the occasional post of links rolled into the main feed?

Komodo Edit add-ons

2007-03-20 16:26

Since making the switch to Komodo Edit, I’ve made a few customizations to it, to make my day-to-day editing of markup a bit easier. The files are available through SVN. Documentation follows.

I see a shitstorm coming

2007-03-15 10:17

I just noticed this assertion of intellectual property rights on canvas from Apple, Inc (That is, they claim to own patents on the technology). Without elaborating further, and only speaking on behalf of myself: This has the potential to make people upset.

Editor love, baby

2007-03-08 15:48

I recently asked for a good editor that was not VI, Emacs or a couple of other alternatives. Kevin pointed me towards Komodo Edit from ActiveState. A big thank you, Kevin. This is Editor Love.

The feature list gives some indication of what it can do, I’ll add my own list of things I like.

  • Cross-platform
  • Emacs style keybindings. Note that they’re not the same keybindings by default, but all of the keybindings are customizable, so you can quite probably make it work exactly that way.
  • If your inclination is towards VI, there is a VI mode for you.
  • Good support for client-side web technologies: HTML, CSS, JavaScript +++
  • Good autocompletion and code intelligence. There are default API catalogs for Dojo, MochiKit, Prototype and YUI, which makes it especially good for JavaScript developers. If these aren’t enough, you can add your own.
  • Indentation and code folding Just Works™ — which is more than I can say about some of the other editors I’ve tried.
  • Snippets. I write a lot of stuff involving angle brackets. The snippets function is wonderful. For instance a <em>[[%(w:else:)]]|</em> (The ‘|’ represents the cursor position after snippet insertion) would take the word under the cursor, wrap it in an <em> — or, if there is a text selection, wrap the selection.
  • Macros. This is just wonderful. You can, of course, just record and save them, but in addition you can write them from scratch in either JavaScript or Python. I should add that the API is quite nice.
  • You put your macros and snippets in Toolboxes, which can be moved between Komodo Edit installations.
  • Extensions. Yes. All Firefox-style extensions, but this is fairly undocumented, so I’ll just add it as a potential future plus.
  • User-defined language support so if you need that COBOL mode, you can have it.
  • Custom XML autocompletion using XML Catalogs using either DTD’s or RelaxNG.
  • The snippets, macros and XML catalogs makes this editor an excellent choice for anyone doing lengthy editing of anything with angle brackets.
  • Split view with separate tab groups. Also note that insertion points and code folding is bound to the view rather than the document, which is decidedly useful if you want to look at function definitions when you edit in the other pane.
  • Free as in Beer.

Ok, before I start sounding religious, there’s downsides:

  • Extensions documentation. Either the mechanism is undocumented, or the documentation is hard to find.
  • Memory. Komodo seems to use a lot of memory, but the memory usage stays relatively constant once the application is running.
  • A Mac-using co-worker claimed Komodo Edit looked a bit off from what he’s learnt to expect from OS X applications.
  • Not Free as in Speech.
  • If you want to go all the way and use the Komodo IDE, the price is fairly steep at $295. I could’ve wished for more differentiated pricing for personal use vs. professional use.

All-in-all, I think Komodo is an excellent alternative for people serious about editing both code and text. Yes, that’s even if you use Emacs or VI. If you’re using any other editor than those two, just switch to Komodo. Today. It really is that good.

Command-line usability

2007-03-06 15:18

On doing a quick check of what update-manager can actually do, I did what I should and checked which command line options are available, and found a little usability gem (highlighted):

arve@carnage:~$ update-manager -help
Usage: update-manager [options]

Options:
  -h, --help            show this help message and exit
  -c, --check-dist-upgrades
                        Check if a new distribution release is available
  -d, --devel-release   Check if upgrading to the latest devel release is
                        possible
  -p, --proposed        Try to run a dist-upgrade
  --dist-upgrade, --dist-ugprade
                        Try to run a dist-upgrade

I like that. Another typo-helper is to locate the nearest shell and do sudo apt-get install sl. You’ll quickly learn to type ls correctly.

Just gimme a good editor, dammit

2007-03-05 16:32

Ok. My frustrations are now permanent. I’m looking for a good editor. One that serves the dual purpose of both being good at editing stuff with angle brackets, and that is more than half-decent for client-side web programming, plus some occasional Python

Before anyone suggests anything at all, here’s the list of what I don’t want.

  • VI, VIM or any related editor: Having to make your own parchment, ink, and quill, and then persuade elves to hide and retrieve your documents from their secret cave in the enchanted forest would be a major improvement to using vi to edit files on any computer system.
  • Emacs. I used to use Emacs years ago, and if I have to edit anything in a shell, I use Emacs because I can’t stand VI. Emacs on Linux, even the Emacs 22 snapshots look like a total ass on any system I’ve tried it (Yes, I have tried this, but that particular package refuses to provide anything but some proportional font, no matter what I put in .Xresources). While the menus now use pretty fonts, the actual text you edit looks like shit. Add to it that Emacs is not particularily good at editing HTML. Plus, configuring Emacs is a major pain, and rather than spending a couple of days setting it up properly after having avoided it for anything but editing cron jobs and .htaccess files, I don’t want to redo them all. Nor do I want to spend time writing a decent JavaScript mode. I know one exists, and it’s not decent by any means. (Nor do I have the neccesary lisp-fu to do so).
  • Bluefish. I gave up on Bluefish back when it crashed if you pressed “Esc” when a warning dialog was open. I don’t miss it.
  • Screem: By default, it uses almost all of my screen estate on icons, is far too “friendly” (no, I didn’t want to close that tag, dammit. Listen to me. Listen to me.), is wizard and click-oriented and lacks elementary text editing functions.
  • Anjuta: While venting my editor frustrations on IRC, I installed Anjuta, tried to open an SVG and ran away in horror. I might sound superficial, but when the color sense of the developer of a tool is this hideous, I don’t actually trust that he knows what it means to edit anything at all.
  • SciTE: Since switching from Windows, this is what I’ve mostly been using, mostly because it doesn’t attempt any hand-holding. It is however missing a few features, and writing markup can sometimes be a bit painful, because keyboard shortcuts are a bit missing, especially ones special to editing markup. Plus, it’s wrapping functionality borders on braindead. The only options you have is either to have wrap on or off, which means screen edge, not word wrap after some specified column.

But, instead of ranting, I am repeating what I did with Media Players, ask. Are there any non-sucky editors out there? Please don’t suggest Kate, I know a few people are satisfied with it, but KDE is going nowhere near my boxes. Nor is suggesting Eclipse any good, because while the editing facilities are OK, it’s totally overkill, and for editing out-of-project static markup documents it’s certainly not suitable.

So, what do I want? When I still was a Windows user, I mostly used EditPlus, which was well-suited for what I do, but running it under Wine is sadly not an option. An editor should have a featureset similar to EditPlus, UltraEdit and similar editors.