[Top][All Lists]

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

Re: HTML-Info design

From: Juri Linkov
Subject: Re: HTML-Info design
Date: Tue, 30 Dec 2014 01:02:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu)

> `M-x eww RET
> http://www.gnu.org/software/emacs/manual/html_node/emacs/index.html RET'
> and you're off.  The `n'/`p'/`u' commands work as in Info already, so
> the only thing that's missing is the index (which is trivial to add).

Another thing that's missing is a multi-page search like in Info.
It's trivial to add it with this small patch:

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 9d787d3..74a0f4b 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -705,6 +705,8 @@ (define-derived-mode eww-mode nil "eww"
    (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 buffer-read-only t))
@@ -1884,6 +1886,17 @@ (add-to-list 'desktop-locals-to-save
 (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
+      (eww-top-url)
+    (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]