emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] [emacs] 01/01: Bind `M-s M-s' globally to `eww-search-word


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] [emacs] 01/01: Bind `M-s M-s' globally to `eww-search-words'
Date: Fri, 14 Nov 2014 03:46:30 +0000

larsi pushed a commit to branch master
in repository emacs.

commit 3bdc6ce7e34705dc09a938d07296230436ea089c
Author: Kenjiro NAKAYAMA <address@hidden>
Date:   Fri Nov 14 04:46:11 2014 +0100

    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(+), 0 deletions(-)

diff --git a/etc/ChangeLog b/etc/ChangeLog
index b3f4afa..983fcaa 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
+2014-11-14  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * NEWS: Mention the new `M-s M-s' keystroke.
+
 2014-11-13  Paul Eggert  <address@hidden>
 
        Fix minor Bazaar leftovers.
diff --git a/etc/NEWS b/etc/NEWS
index 911fe6a..2172d07 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 5c0ec99..8238dc5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2014-11-14  Lars Magne Ingebrigtsen  <address@hidden>
+
+       * bindings.el (search-map): Bind M-s M-s to `eww-search-words'.
+
+2014-11-14  Kenjiro NAKAYAMA  <address@hidden>
+
+       * net/eww.el (eww-search-words): New command (bug#16258).
+
 2014-11-13  Lars Magne Ingebrigtsen  <address@hidden>
 
        * net/shr.el (shr-inhibit-images): Add a doc string.
diff --git a/lisp/bindings.el b/lisp/bindings.el
index ac31723..5864581 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 61504e9..9462d03 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]