diff options
| -rw-r--r-- | lisp/net/eww.el | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index fe316579142..2fc36e180ee 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -312,11 +312,19 @@ word(s) will be searched for via `eww-search-prefix'." | |||
| 312 | (expand-file-name file)))) | 312 | (expand-file-name file)))) |
| 313 | 313 | ||
| 314 | ;;;###autoload | 314 | ;;;###autoload |
| 315 | (defun eww-search-words (&optional beg end) | 315 | (defun eww-search-words () |
| 316 | "Search the web for the text between BEG and END. | 316 | "Search the web for the text between BEG and END. |
| 317 | See the `eww-search-prefix' variable for the search engine used." | 317 | If region is active (and not whitespace), search the web for |
| 318 | (interactive "r") | 318 | the text between BEG and END. Else, prompt the user for a search |
| 319 | (eww (buffer-substring beg end))) | 319 | string. See the `eww-search-prefix' variable for the search |
| 320 | engine used." | ||
| 321 | (interactive) | ||
| 322 | (if (use-region-p) | ||
| 323 | (let ((region-string (buffer-substring (region-beginning) (region-end)))) | ||
| 324 | (if (not (string-match-p "\\`[ \n\t\r\v\f]*\\'" region-string)) | ||
| 325 | (eww region-string) | ||
| 326 | (call-interactively 'eww))) | ||
| 327 | (call-interactively 'eww))) | ||
| 320 | 328 | ||
| 321 | (defun eww-open-in-new-buffer () | 329 | (defun eww-open-in-new-buffer () |
| 322 | "Fetch link at point in a new EWW buffer." | 330 | "Fetch link at point in a new EWW buffer." |