;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/w3m/w3m-sem.el (require 'cl-lib) (require 'w3m-search) (require 'w3m-tabs) (defun w3m-sem (search hit &optional max) (or max (setq max 10)) (switch-to-buffer (w3m-new-tab "SEM")) (w3m-search w3m-search-default-engine search) (let ((slp 6)) (sleep-for slp) (cl-loop for i from 1 to max do (if (search-forward hit (point-max) t) (progn (goto-char (match-beginning 0)) (w3m-view-this-url) (cl-return (message "hit page %d" i)) ) (if (search-forward ">" (point-max) t) (progn (goto-char (match-beginning 0)) (w3m-view-this-url) (sleep-for slp) ) (cl-return (message "no hit, can't continue from page %d" i)) ))))) (provide 'w3m-sem)