Greetings, I did some hacking and it seems the result is at least mostly asynchronous emacs-w3m. The attached patch is against 20010712T2202Z emacs-w3m from CVS but it should apply to the latest (as of this writing) CVS sources as well since only w3m-form.el and Changelog have been modified. I haven't tested all possible functionality of emacs-w3m with my changes, only normal browsing, downloads and forms. Glitches in non-simple-use situations are likely, especially since error handling / recovery and similar stuff still needs tuning, I think. I also encountered some code whose purpose I didn't understand etc. But "it works for me"(tm) well enough that I'll probably try to fiddle with some other things (such as rendering of boxes, ©, ® and similar entities) next. Note that I didn't attempt to make, for example, rendering asynchronous --- just retrieving. Changelog entry is included below. 2001-07-13 Hannu Koivisto <azure@iki.fi> * w3m.el: * (w3m-current-work-buffer) New variable. * w3m-dump-head-source-command-argument -> w3m-dump-head+source-command-argument * (w3m-exec-process-after) New function. * (w3m-exec-process) Now takes a required handler argument and returns a process object. Only asynchronous operation is supported, all other code removed. * (w3m-retrieved-header) New variable. * (w3m-w3m-get-header-after) New function. * (w3m-w3m-get-header) Modified to work with asynchronous w3m-exec-process. * (w3m-w3m-dump-head+source-after) New function. * w3m-w3m-dump-head-source -> w3m-w3m-dump-head+source * (w3m-w3m-dump-head+source) Rewritten to use asynchronous w3m-exec-process; most of the work is now done in w3m-w3m-dump-head+source-after. Now takes a required handler argument. * (w3m-w3m-dump-source-after) New function. * (w3m-w3m-dump-source) Now takes a required handler argument. Modified to use asynchronous w3m-exec-process; most of the work is now done in w3m-w3m-dump-source-after. * (w3m-w3m-retrieve) Rewritten to use asynchronous w3m-w3m-dump-head+source / w3m-w3m-dump-source and to make it cleaner (no useless setqs). * (w3m-retrieve-after) New function. * (w3m-retrieve) Rewritten to use possibly asynchronous w3m-w3m-retrieve. The work buffer where retrieved data is stored is now created here (and destroyed in the case of synchronous retrieval). * (w3m-download-after) New function. * (w3m-download) Now takes an optional handler argument. Rewritten to use asynchronous w3m-retrieve; most of the work is now done in w3m-download-after. * (w3m-exec-after/render) New function. * (w3m-exec-after) New function. * (w3m-exec) Modified to use asynchronous w3m-retrieve. Most of the work is now done in in w3m-exec-after* functions. * (w3m-external-view-after-after) New function. * (w3m-external-view-after) New function. * (w3m-external-view) Modified to use asynchronous w3m-download. * (w3m-goto-url-after) New function. * (w3m-goto-url) Modified to use asynchronous w3m-exec. All the work after exec is done in w3m-goto-url-after. Now takes on option handler argument. Now switches to the result buffer before retrieval. * (w3m-reload-this-page) 'reload -> t for w3m-goto-url's reload parameter. * w3m-macro.el: * Now requires cl at compile time. * (w3m-when-bind) New macro. * (w3m-if-bind) Ditto. * (w3m-with-work-buffer) Now always uses w3m-current-work-buffer as the work buffer and throws an error if being used in a context where it is not set. -- Hannu
Attachment:
emacs-w3m-patch-20010713T1137Z-to-mlist.bz2
Description: the patch