Friday, January 27, 2006

Browsing Sourceforge Download Servers

Sourceforge is a nice service, but it can also be painful to use because of the heavy-weight Web page design, and the need to repeatedly click before you get the download you want.

The most irksome of these is the download mechanism provided by Sourceforge --- where you first need to browse a list of download servers, pick a mirror, and then download what you want. Emacspeak implements a Smart URL that enables one to download from Sourceforge in a single step.

By default, this uses a North American mirror; the behavior can be customized if outside the US. Use smart URL Sourceforge Browse Mirror and specify the name of a SF hosted project when prompted. This brings up the index page for the project's download area, sorted by date. Move to the bottom of the page and hit b to move to the latest available download.

The smart URL sets up the W3 buffer with a context-sensitive download function; when on a download link, hit C-d to start downloading. This command will prompt for the URL; rather than hitting return (which would bring you to the browse mirrors page, hit M-p to get the download URL for your SF mirror. Note that this wizard uses GNU wget to perform the download via Emacs module w3-wget.

BBC Channels On Emacspeak

Since the BBC's various channels are what I listen to the most, launching BBC channels has always been a couple of keystrokes in Emacspeak. As a first step, directory realaudio/radio contains shortcut files for launching live streams from the various BBC channels.

In addition, module emacspeak-url-template defines a number of Smart URLs for single-click access to BBC programs. The ones I use the most are:

  • Smart URL BBC Channels On Demand, and
  • Smart URL BBC Genres On Demand

These smart URLs prompt for the channel or genre respectively and bring up a Web page that lists the various shows that are available --- note that the BBC archives shows for a whole week. The resulting Web page is easy to browse in W3; the most effective way to skim the buffer is to repeatedly hit i which moves through the various items on the page. Hitting e e (that's the letter e twice) while on a hyperlink will launch the corresponding media stream by calling a context-aware command that knows about transforming the URL to one that accesses the program stream; --- note that simply following the hyperlink will get you first to a page about the program, rather than to the program stream itself.

To find out what channels and genres are available, browse the BBC Web site --- channel and genre names are not hard-wired into Emacspeak since these can change over time with channels and genres being added or renamed.

Thursday, January 26, 2006

Emacspeak World Clock For Timezone Travel

Command emacspeak-speak-time bound to C-e t speaks the current time. An additional convenience offered by this keystroke is to get the time at a specified time zone using Emacs' completion facility.

To use this feature, simply precede the keystroke with an interactive prefix arg i.e., use C-u C-e t. This will prompt for the timezone in the minibuffer. Using two C-u C-u will set the default timezone after speaking the time --- a useful way of avoiding jet-lag as you travel.

Sunday, January 22, 2006

Emacspeak Web Wizards: Obtaining Context From The Calendar

Emacspeak implements a number of smart URLs in module emacspeak-url-template.el --- see earlier post on Web Command Line. Many of these smart URLs prompt the user for the date, e.g. you can use smart URL NPR On Demand to play archived NPR shows.

The most intuitive means of specifying a date is of course using a calendar that functions as a date-picker, and Emacs has a very powerful built-in calendar. Emacspeak ties these two together by arranging for commands that prompt for a date to use the current date in the Emacs Calendar as the default. So the easiest way to play NPR Morning Edition for Monday, January 2, 2006 is to do the following:

  • Switch to the Emacs Calendar and move to the desired date Monday January 2, 2006 by pressing gd.
  • Invoke the NPR On Demand smart URL by pressing C-e u RET NPR RET
  • Specify the program code for Morning Edition by pressing me RET
  • Hit enter to pick the default date that is offered in the minibuffer.
  • Sit back and listen ...

Tuesday, January 17, 2006

Viewing Atom Feeds Within Emacspeak

The most effective way of viewing Atom Feeds in Emacspeak is to use command emacspeak-atom-display and specifying the URL of the feed when prompted. Thus, M-x emacspeak-atom-display RET http://emacspeak.blogspot.com/atom.xml displays a Web page generated from the Emacspeak Blog.

Notice the following in the generated Web page:

  • It starts with a navigable table of contents.
  • Each Blog entry has a link labeled edit next to it.
  • Each Blog entry ends with a link labeled Bookmark.
  • There is a link labeled Post at the top of the page.

The above links help you easily create and edit posts to the Blog if you have write access using commands provided by module atom-blogger. Eventually, I may add commands to these hyperlinks to automatically invoke the appropriate command from atom-blogger; for now, I find it sufficiently convenient to copy the URL under point to the kill-ring and later yank it back into the minibuffer when prompted by atom-blogger.

Finally, note that this and subsequent posts to this Blog will show up automatically on the Emacspeak Mailing List at Vassar.

Viewing Formatted Source Code In Emacs/W3

While reading online texts on programming in Python and Ruby, I noticed that Emacspeak was not announcing indented lines in preformatted source-code examples, even with audio indentation turned on. The reason is that many of these texts use an HTML non-breaking space for indentation, and though W3 was rendering these correctly, the default syntax table in W3 had not defined the resulting octal 240 to be of class white-space. Consequently, Emacspeak's audio indentation code was not treating the non-breaking space as white space.

I've checked in a patch to emacspeak-w3.el that modifies the syntax table in w3-mode by adding the appropriate lines to w3-mode-hook.

Saturday, January 14, 2006

Speech-Enabled ATOM-Blogger

Module atom-blogger is a light-weight Emacs client for creating or editting blogger posts using ATOM. Emacspeak bundles atom-blogger and speech-enables it via module emacspeak-atom-blogger.

Module emacspeak-setup.el has been updated to set up the Emacs' load-path to locate package atom-blogger, so if correctly installed, Emacspeak users should be able to launch and use atom-blogger with no further configuration.

Thursday, January 12, 2006

Emacspeak And Ruby

Emacspeak now speech-enables ruby-mode to support developing Web applications using Ruby On Rails. I presently use nxml-mode for editing the .rhtml files, but am looking for an alternative to using multi-mode or its variants when editing the embedded Ruby code. Sadly, one has to turn off nxml-mode's validity checking while editing .rhtml files --- otherwise it complains about the <% directives.

Monday, January 02, 2006

Emacspeak Wizard: Recording Audio Streams For Later Playback

Emacspeak includes a large collection of wizards implemented in module emacspeak-wizards.el One of these ---emacspeak-wizrds-rivo works hand-in-hand with script etc/rivo.pl to provide a simple record for later playback facility that can be used to record live realaudio streams for future playback. This is useful for listening to live broadcasts at a more convenient time.

Wizard emacspeak-wizrds-rivo prompts for the time at which to record, the length of the recording, the stream to record, and the location in which the recording is to be stored. It then uses command trplayer (text-mode RealPlayer) with command vsound to capture the audio stream, and converts the result to MP3 using command lame. ToDo: With mplayer now able to play RealAudio streams, the etc/rivo.pl script should be updated to use mplayer since this will :

  • Remove the vsound dependency.
  • Enable us to record more than just RealAudio streams.