Function: eww-search-words

eww-search-words is an autoloaded, interactive and byte-compiled function defined in eww.el.gz.

Signature

(eww-search-words)

Documentation

Search the web for the text in the region.

If region is active (and not whitespace), search the web for the text between region beginning and end, subject to user's confirmation controlled by eww-search-confirm-send-region. Else, prompt the user for a search string. See the variable eww-search-prefix for the search engine used.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/net/eww.el.gz
;;;###autoload
(defun eww-search-words ()
  "Search the web for the text in the region.
If region is active (and not whitespace), search the web for the
text between region beginning and end, subject to user's confirmation
controlled by `eww-search-confirm-send-region'.  Else, prompt the
user for a search string.  See the variable `eww-search-prefix'
for the search engine used."
  (interactive)
  (if (use-region-p)
      (let ((region-string (buffer-substring (region-beginning) (region-end))))
        (if (not (string-match-p "\\`[ \n\t\r\v\f]*\\'" region-string))
            (when
                (or (not eww-search-confirm-send-region)
                    (yes-or-no-p
                     (format-message
                      "Really send the region to the search engine? ")))
              (eww region-string))
          (call-interactively #'eww)))
    (call-interactively #'eww)))