emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 5480b8e: Multi-page isearch support in eww


From: Juri Linkov
Subject: [Emacs-diffs] master 5480b8e: Multi-page isearch support in eww
Date: Tue, 30 Dec 2014 23:50:13 +0000

branch: master
commit 5480b8ef252bece2ad225af8898b71ad931f3924
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    Multi-page isearch support in eww
    
    * lisp/net/eww.el (eww-isearch-next-buffer): New function.
    (eww-mode): Set multi-isearch-next-buffer-function to it.
    http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg02300.html
---
 lisp/ChangeLog  |    5 +++++
 lisp/net/eww.el |   15 +++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9bbc92e..4be97b5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-30  Juri Linkov  <address@hidden>
+
+       * net/eww.el (eww-isearch-next-buffer): New function.
+       (eww-mode): Set multi-isearch-next-buffer-function to it.
+
 2014-12-30  Dmitry Gutov  <address@hidden>
 
        * progmodes/xref.el (xref-find-definitions): Mention "no
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index b43dba5..af902de 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -705,6 +705,8 @@ the like."
    (setq-local tool-bar-map eww-tool-bar-map))
   ;; desktop support
   (setq-local desktop-save-buffer 'eww-desktop-misc-data)
+  ;; multi-page isearch support
+  (setq-local multi-isearch-next-buffer-function 'eww-isearch-next-buffer)
   (setq truncate-lines t)
   (buffer-disable-undo)
   (setq buffer-read-only t))
@@ -1885,6 +1887,19 @@ Otherwise, the restored buffer will contain a prompt to 
do so by using
 (add-to-list 'desktop-buffer-mode-handlers
              '(eww-mode . eww-restore-desktop))
 
+;;; Isearch support
+
+(defun eww-isearch-next-buffer (&optional buffer wrap)
+  "Go to the next page to search using `rel' attribute for navigation."
+  (if wrap
+      (condition-case nil
+         (eww-top-url)
+       (error nil))
+    (if isearch-forward
+       (eww-next-url)
+      (eww-previous-url)))
+  (current-buffer))
+
 (provide 'eww)
 
 ;;; eww.el ends here



reply via email to

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