Emacs/W3 is still the best Web page rendering option inside
Emacspeak given the ability to apply XSL transforms, as well as
obtaining aural styling via ACSS.
However W3's url handling layer often breaks when faced with
multiple redirects, especially when some of these happen through
the Host:
HTTP header. Additionally,
HTTPS
authentication sometimes fails mysteriously in
the presence of redirects.
In many of these cases, lynx
happily fetches the
pages correctly; however you're then stuck using a fairly weak
auditory interface in that Emacspeak degrades to being
aterminal level screenreader.
An effective solution to this problem is to use
lynx
within an Emacs terminal, and after finding the
content that is worth reading, handing off that content to
Emacs/W3. The next few paragraphs show how.
lynx-site.cfg
FileThis is where you add site-specific configurations.
Here are the lines I have in my lynx-site.cfg
to
integrate lynx
and Emacs.
Before you use any of this, make sure you have executed M-x
server-start
in your running Emacs, and make sure that all
is well by experimenting with emacsclient
to ensure
that external programs can hand-off editting tasks to the
currently running Emacs.
#site defaults #for bookshare: DOWNLOADER:BKS Unpack:bks.pl %s %s:TRUE PRINTER:Edit:emacsclient %s:TRUE KEYMAP:???:EDITTEXTAREA # use external editor to edit a form textarea PRETTYSRC:TRUE SOURCE_CACHE:MEMORY SAVE_SPACE:~/.wget/ BOLD_HEADERS:TRUE PRINTER:W3:emacsclient -e '(w3-open-local "%s")':TRUE
Below, I'll describe what each of the above lines do:
DOWNLOADER:BKS Unpack:bks.pl %s %s:TRUE
bks-unpack.pl
invokes the BookShare unpack
tool with the appropriate options.PRINTER:Edit:emacsclient %s:TRUE
\
before invoking print.KEYMAP:???:EDITTEXTAREA # use external editor to
edit a form textarea
??
with
the desired key sequence.PRETTYSRC:TRUE
SOURCE_CACHE:MEMORY
PRINTER:W3:emacsclient -e '(w3-open-local
"%s")':TRUE
source view
before invoking
this so that Emacs/W3 gets handed the HTML markup.bks-unpack.pl
#!/usr/bin/perl -w #$Id: bks.pl,v 1.1 2003/07/04 15:41:55 tvraman Exp tvraman $ #Description: Bookshare downloader for Lynx use strict; my $location="$ENV{HOME}/books/book-share"; my $password = 'xxxxxxx'; my $grabbed = shift; my $target = shift; my $dir =qx(basename $target .bks); chomp $dir; my $where = "$location/$dir"; qx(mkdir -p $where); qx(mv $grabbed $where/$target); chdir $where; qx(echo $password | bks-unpack -q $target 1>&- 2>&- &);