;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/w3m/w3m-unisearch.el (require 'edit) (require 'get-search-string) (require 'string) (require 'w3m) (require 'w3m-search) (require 'w3m-tabs) (defun web-search () (interactive) (let*((search-engine (or w3m-search-default-engine "google-en")) (search (get-search-string search-engine))) (when (string-data-p search) (let ((tab-label (format "%s: %s" search-engine search))) (switch-to-buffer (w3m-new-tab tab-label)) (w3m-search w3m-search-default-engine search) )))) (defun wiki-search (&optional lang) (interactive "P") (or lang (setq lang "en")) (w3m-web-search (format "https://%s.wikipedia.org/w/index.php?title=%%s" lang) (get-search-string (format "wiki [%s]" lang)) )) (defun w3m-web-search (pat key) (w3m (format pat key) t) ) (provide 'w3m-unisearch)