From 3bdc6ce7e34705dc09a938d07296230436ea089c Mon Sep 17 00:00:00 2001 From: Kenjiro NAKAYAMA Date: Fri, 14 Nov 2014 04:46:11 +0100 Subject: [PATCH] Bind `M-s M-s' globally to `eww-search-words' Fixes: debbugs:16258 * etc/NEWS: Mention the new `M-s M-s' keystroke. * lisp/bindings.el (search-map): Bind M-s M-s to `eww-search-words'. * net/eww.el (eww-search-words): New command. --- etc/ChangeLog | 4 ++++ etc/NEWS | 3 +++ lisp/ChangeLog | 8 ++++++++ lisp/bindings.el | 1 + lisp/net/eww.el | 6 ++++++ 5 files changed, 22 insertions(+) diff --git a/etc/ChangeLog b/etc/ChangeLog index b3f4afa93a0..983fcaa28eb 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2014-11-14 Lars Magne Ingebrigtsen + + * NEWS: Mention the new `M-s M-s' keystroke. + 2014-11-13 Paul Eggert Fix minor Bazaar leftovers. diff --git a/etc/NEWS b/etc/NEWS index 911fe6a8380..2172d078c44 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -51,6 +51,9 @@ Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to. ** C-h l now also lists the commands that were run. +** The new M-s M-s key binding uses eww to search the web for the +text in the region. + ** M-x suggests shorthands and ignores obsolete commands for completion. ** x-select-enable-clipboard is renamed select-enable-clipboard. x-select-enable-primary and renamed select-enable-primary. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5c0ec99f04f..8238dc5a36d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2014-11-14 Lars Magne Ingebrigtsen + + * bindings.el (search-map): Bind M-s M-s to `eww-search-words'. + +2014-11-14 Kenjiro NAKAYAMA + + * net/eww.el (eww-search-words): New command (bug#16258). + 2014-11-13 Lars Magne Ingebrigtsen * net/shr.el (shr-inhibit-images): Add a doc string. diff --git a/lisp/bindings.el b/lisp/bindings.el index ac31723e02d..5864581d3cc 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -926,6 +926,7 @@ if `inhibit-field-text-motion' is non-nil." (define-key esc-map "s" search-map) (define-key search-map "o" 'occur) +(define-key search-map (kbd "M-s") 'eww-search-words) (define-key search-map "hr" 'highlight-regexp) (define-key search-map "hp" 'highlight-phrase) (define-key search-map "hl" 'highlight-lines-matching-regexp) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 61504e91465..9462d03d54a 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -198,6 +198,12 @@ word(s) will be searched for via `eww-search-prefix'." "/") (expand-file-name file)))) +;;;###autoload +(defun eww-search-words (&optional beg end) + "Search the web for the text between the point and marker." + (interactive "r") + (eww (buffer-substring beg end))) + (defun eww-render (status url &optional point buffer) (let ((redirect (plist-get status :redirect))) (when redirect -- 2.39.5