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.
This commit is contained in:
Kenjiro NAKAYAMA 2014-11-14 04:46:11 +01:00 committed by Lars Magne Ingebrigtsen
parent ba88f19533
commit 3bdc6ce7e3
5 changed files with 22 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2014-11-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
* NEWS: Mention the new `M-s M-s' keystroke.
2014-11-13 Paul Eggert <eggert@cs.ucla.edu>
Fix minor Bazaar leftovers.

View file

@ -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.

View file

@ -1,3 +1,11 @@
2014-11-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
* bindings.el (search-map): Bind M-s M-s to `eww-search-words'.
2014-11-14 Kenjiro NAKAYAMA <nakayamakenjiro@gmail.com>
* net/eww.el (eww-search-words): New command (bug#16258).
2014-11-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
* net/shr.el (shr-inhibit-images): Add a doc string.

View file

@ -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)

View file

@ -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