From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenjiro NAKAYAMA Newsgroups: gmane.emacs.bugs Subject: bug#16258: 24.3.50;[PATCH] eww: Add new function of region-search. Date: Thu, 26 Dec 2013 12:11:49 +0900 Message-ID: <87zjnoxq5u.fsf@dhcp-193-97.nrt.redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388027598 15314 80.91.229.3 (26 Dec 2013 03:13:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Dec 2013 03:13:18 +0000 (UTC) To: 16258@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 26 04:13:23 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vw1Ny-0007Du-Is for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Dec 2013 04:13:22 +0100 Original-Received: from localhost ([::1]:44121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vw1Ny-0001p7-1W for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Dec 2013 22:13:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vw1Nm-0001n1-Nz for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 22:13:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vw1Ne-0002md-A6 for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 22:13:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vw1Ne-0002mZ-6H for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 22:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vw1Nd-0003zq-Rc for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 22:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kenjiro NAKAYAMA Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Dec 2013 03:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16258 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.138802754615303 (code B ref -1); Thu, 26 Dec 2013 03:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Dec 2013 03:12:26 +0000 Original-Received: from localhost ([127.0.0.1]:42354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vw1N3-0003yl-P0 for submit@debbugs.gnu.org; Wed, 25 Dec 2013 22:12:26 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:48945) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vw1N1-0003ya-5G for submit@debbugs.gnu.org; Wed, 25 Dec 2013 22:12:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vw1Ms-0002dJ-D5 for submit@debbugs.gnu.org; Wed, 25 Dec 2013 22:12:22 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:37379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vw1Ms-0002d7-AG for submit@debbugs.gnu.org; Wed, 25 Dec 2013 22:12:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vw1Mj-0001jy-SE for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 22:12:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vw1Mb-0002Di-Dy for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 22:12:05 -0500 Original-Received: from mail-pb0-x235.google.com ([2607:f8b0:400e:c01::235]:37131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vw1Mb-0002DX-64 for bug-gnu-emacs@gnu.org; Wed, 25 Dec 2013 22:11:57 -0500 Original-Received: by mail-pb0-f53.google.com with SMTP id ma3so7762994pbc.12 for ; Wed, 25 Dec 2013 19:11:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=user-agent:from:to:subject:message-id:date:mime-version :content-type; bh=S3LLbRD4m38+XjgAfBc/bk7CkksDB6xlWSk1GlL9yEs=; b=024ebToSG192oXeg4f5Ah79NJaJv4a292kyoeNLi8mEUH3NtFLbvM9BFYrjnpXM8/L jpFBhH+zd+sKbOj8HM7S8JBq6TjmeM60s56TK6tWljXNMEDi3Ve8xvFe0Tljd2uVGCGX nQfVvUoeh+kExDFCXAtp2Pfwjd+yclBPGBR6w5IbeDRzu+i3rJsZFBQXABKwVI1BsHIJ Yy/gxHVCMfLMR3+a10VoD+Zv3JSYu88XsXGGSGYb5LT99mU8SuVzDWo+i4ileKjHrLxG G+0V/Vf4sv/zk9CUnosnOazmNxJVIunkGC4wIW5H8wADhvJ1Lgw8fYeqoM5SdUjqD3Tp WTMw== X-Received: by 10.68.225.9 with SMTP id rg9mr42007495pbc.122.1388027515543; Wed, 25 Dec 2013 19:11:55 -0800 (PST) Original-Received: from dhcp-193-97.nrt.redhat.com (nat-pool-nrt-t1.redhat.com. [66.187.238.10]) by mx.google.com with ESMTPSA id wd6sm67422560pab.3.2013.12.25.19.11.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Dec 2013 19:11:54 -0800 (PST) User-agent: mu4e 0.9.9.6pre2; emacs 24.3.50.3 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:82617 Archived-At: I think the function to search the selected word withought any input is useful. But it might be a good idea to set this function in .emacs.el or init.el by users. So please judge this function should apply or reject. I send the patch. Signed-off-by: Kenjiro NAKAYAMA * net/eww.el(eww-search-region): New function to search region. (eww-mode-map): New key map to eww-search-region. --- lisp/net/eww.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 25309d1..f5ca8b1 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -433,6 +433,7 @@ word(s) will be searched for via `eww-search-prefix'." (define-key map "B" 'eww-list-bookmarks) (define-key map [(meta n)] 'eww-next-bookmark) (define-key map [(meta p)] 'eww-previous-bookmark) + (define-key map [(meta s)(meta s)] 'eww-search-region) (easy-menu-define nil map "" '("Eww" @@ -1358,6 +1359,12 @@ Differences in #targets are ignored." (setq buffer-read-only t truncate-lines t)) +;; Utilities + +(defun eww-search-region (&optional beg end) + (interactive "r") + (eww (buffer-substring beg end))) + (provide 'eww) ;;; eww.el ends here -- 1.8.3.1