[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

question about emacspeak-websearch



Hi Yvonne,

Whenever I need to change the way something in emacspeak works, or for
that matter any other emacs code, I find emacs' advice facility (see
defadvice and the emacs lisp manual for details), very useful. Its
main advantage is that you can modify a functions behavior without
editing the original code - this avoids having to re-edit everytime
you do an upgrade. In fact, emacspeak makes extensive use of this
facility itself. Its also very simple - essentially, you are writing a
"wrapper" function which can be used to alter inputs before they are
passed to the original function, alter the return value from the
function or totally replace the function. 

One minor correction to a statement in your post. You don't have to
have w3 installed to do web browsing within emacs/emacspeak. Other
alternatives are w3m and lynx within a terminal window. 

It may be possible for Raman to add a customize setting to select the
preferred web browser. However, this can sometimes be difficult
because in some instances, there is no 1-to-1 mapping of functions
between w3 and w3m - that is to say, where in w3 you may be able to
achieve some particular functionality with just minor coding, doing
the same within a different browser may require considerably more
coding. Raman favors w3 over w3m because it offers some features which
are not available in other browsers like w3m. For example, w3 supports
auditory cascading style sheets (ACSS) which makes it very easy to
define a style sheet which will use certain audio attributes for
various html elements. 

Finally, Raman is often more receptive to making changes if the
request includes patches or lisp code which either achieves the
required modification or goes a long way to doing the job. The main
reason for this is because he often doesn't have the time to actually
do the changes himself. so, if you work out some functions to add the
ability to select the preferred browser for operations like web
searching and provide them along with your request, the likelyhood of
them being added to the standard distribution is higher. 

I strongly recommend checking out emacs' advice mode. You can find
lots of examples of its use within emacspeak. I would have to say I
have found it to be one of the most powerful and simple mechanisms for
modifying emacs/emacspeak's behavior. Often, when I think there is
some part of emacs which I would like to behave differently, I will
first attempt to achieve the different functionality via defadvice,
use it for a while and possibly refine it. Once it has stabilized and
appears to be working well, I may then either convert this into a
stand-alone mode or submit patches to the package author. However,
most of the time, a simple defadvice is sufficient and I just leave it
in my personal advice .el file which I load at startup. 

HTH

Tim
>>>>> "Yvonne" == Yvonne Thomson <yvonne@thewatch.net> writes:

 Yvonne> Hi.  I've been struggling with a problem in
 Yvonne> emacspeak-websearch for a while now, until I got the time to
 Yvonne> do what I should have done in the first place, look at the
 Yvonne> code.

 Yvonne> The problem is I'm using w3m as a web browser, and the first
 Yvonne> time I'd run emacspeak-websearch in a session, it'd suddenly
 Yvonne> dump me into w3 with no warning. After looking at the code, I
 Yvonne> realised that, by default, emacspeak-websearch *always* comes
 Yvonne> up in w3 enitially if you have the w3 program, which seems
 Yvonne> kind of nuts since you *have* to have w3 if you're web
 Yvonne> browsing with emacspeak. All I've done so far is comment this
 Yvonne> piece of code out in emacspeak-websearch. I know, I know,
 Yvonne> you're never supposed to do it that way, but I have no idea
 Yvonne> how else to override this. Does anyone have any better ideas?
 Yvonne> Can it be made a customize option or something?

 Yvonne> Thanks for any help.

 Yvonne> -----------------------------------------------------------------------------
 Yvonne> To unsubscribe from the emacspeak list or change your address
 Yvonne> on the emacspeak list send mail to
 Yvonne> "emacspeak-request@cs.vassar.edu" with a subject of
 Yvonne> "unsubscribe" or "help"

-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@cs.vassar.edu" with a
subject of "unsubscribe" or "help"


Emacspeak Files | Subscribe | Unsubscribe | Search