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.

Saturday, December 31, 2005

Emacs Tip: Viewing Commands Available On A Prefix Key

Emacs, and consequently Emacspeak, uses a number of multi-key sequences. The initial key that makes up such a multi-key sequence --- AKA the prefix-key that leads to all Emacspeak commands is C-e (control-e).

Pressing any prefix-key followed by the help-key (C-h) results in Emacs displaying a *Help* buffer that lists all key-sequences beginning with that prefix.

This can be a very useful way of quickly seeing what keyboard commands are available --- as the resulting listing is shorter than what is produced by C-h b (command describe-bindings) which lists all key-bindings.

To use this feature to review Emacspeak's key-bindings, I have now moved command emacspeak-learn-emacs-mode to C-h C-l and C-e F1 from its original key-binding of C-e C-h --- the change is checked into CVS.

Friday, December 30, 2005

Using The New MPlayer With ALSA Support

New versions of the Linux mplayer can now play RealMedia files in addition to the various DVD and Windows audio and video streams. As an added bonus, mplayer can be built to use ALSA ---(note that default RPMs available on the Web still default to OSS as of December 2006). This, with the additional support for newer RealMedia formats has finally caused me to switch away from trplayer a---a command line RealPlayer that was built against RealPlayer 8.0

Note that building mplayer from source to include ALSA support, and locating all the codecs you need will require a few Google searches. Specifically, to play NPR streams, you will need to grab avisynth.dll from the SourceForge project of the same name. But once this is done, mplayer will happily play multiple streams of audio without requiring multichannel support from the sound card. For Emacspeak users this means that you get auditory icons, and more importantly software TTS while listening to audio streams.

To use software TTS while mplayer is playing audio streams requires that you use a TTS server that uses ALSA; the default Emacspeak servers still use OSS. To build a TTS server for IBM ViaVoice TTS, obtain Emacspeak sources from CVS, and follow the instructions in file servers/linux-outloud/ALSA.

As of a few weeks ago, The Emacspeak CVS repository has been updated so that all access to streaming media goes through mplayer by default. Make sure to configure your mplayer with a smaller cache size if you use it exclusively for streaming audio; by default it uses a rather large cache, and streaming realaudio often takes a long time to start before the cache is configured to be something smaller; I use a cache size of 64kb on my laptop.

Thursday, December 29, 2005

Blogging From Inside Emacs

I'm posting this using a bare-boned atom-blogger that I implemented this morning. It uses curl to process the HTTP Post Request.

Editting Previous Entries

What's more, the bare-bones atom-blogger can now edit previous posts. This is done by getting the desired entry, filtering it for elements that should not be present when submitting updates, and adding a generator element --- all of these steps are required by the Blogger API. Unwanted elements are filtered out using xsltproc.

Wednesday, December 28, 2005

More On Web Command Line

Also, see Time Saving Shortcuts from Yahoo --- these shortcuts have the same structure as url-templates in Emacspeak --- except that in the case of Emacs, you have all of Elisp to build up your URL templates.

For the available Emacspeak url-tempaltes, see the relevant section in the online reference.

-- T. V. Raman

Emacspeak Web Tricks --- The Web Command Line!

The Web browsing environment within Emacs is primitive compared to what is available in mainstream browsers today. However, the bare-bones Emacs/W3 within Emacspeak still provides a bagful of powerful tricks. Here is how:

  • Module Emacspeak-websearch.el implements a set of powerful search wizards.
  • Module emacspeak-url-template.el implements a library for programmable URLs.
  • Additionally, the HTML received by W3 can be filtered via XSLT stylesheets.

Combining the above turns the Emacs minibuffer into a powerful Web CommandLine. The modules enumerated above were implemented within Emacspeak starting in 1998, with url-templates arriving circa early 2000. These tools were an access necessity due to the visual complexity of the Web; it's now interesting to see similar Web tools emerge on the mainstream web to help users complete tasks more rapidly. As an example, search Google for Web Command Line --- you'll see that there are now simple browser add-ons for all the mainstream web browsers that implement similar shortcuts. Another popular means of achieving such Web shortcuts today is via simple Web widgets or portlets that are dropped into one's home page --- as an example, see Google Modules .

Emacspeak Introduction

This was my first posting to my Emacspeak Blog.I'm using Emacs nxml-mode and Curl to post these after having started with Emacs package atom-api --seeEmacsWiki.

The url package from Emacs/W3 on which Emacs atom-api dependsis proving to be too flaky, and curl seems to be a better bet.