[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#16258: 24.3.50; [PATCH] eww: Add new function of region-search.
From: |
Kenjiro NAKAYAMA |
Subject: |
bug#16258: 24.3.50; [PATCH] eww: Add new function of region-search. |
Date: |
Thu, 26 Dec 2013 22:11:40 +0900 |
User-agent: |
mu4e 0.9.9.6pre2; emacs 24.3.50.3 |
Sorr, since this is new functionality, I should have sent after the feature
freeze is over.
nakayamakenjiro@gmail.com writes:
> 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 <nakayamakenjiro@gmail.com>
>
> * 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