I'm trying to write a simple function: send a request to the w3m browser, and then find a specific place on the web page:
(defun w3m-define-word (word)
(interactive "sDefine: ")
(progn (w3m-search "Dictionary" word)
(set-window-start nil (search-forward "Search Results"))))
It is not so that it w3m-searchdoes not wait for the page to reload and set-window-startis executed on the older page. The page then reloads and places the cursor at the beginning of the buffer.
(sleep-for ..)between w3m-searchand set-window-starthelps, but since the loading time is arbitrary, it is not very convenient.
How can I rewrite this function so that it will wait for the buffer to reload, and then the rest?
source
share