emacs-diffs
[Top][All Lists]
Advanced

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

master 4ee8b4d: Only do multi-isearch in eww if there's next/prev links


From: Lars Ingebrigtsen
Subject: master 4ee8b4d: Only do multi-isearch in eww if there's next/prev links
Date: Mon, 13 Sep 2021 04:03:33 -0400 (EDT)

branch: master
commit 4ee8b4d225176191bc0778ab9cbe5bb481d4704c
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Only do multi-isearch in eww if there's next/prev links
    
    * lisp/net/eww.el (eww-handle-link): Only do multi-isearch if
    there's a next/prev link in the HTML (bug#50497).
    (eww-setup-buffer): Clear the function.
    (eww-mode): Don't set it here.
---
 lisp/net/eww.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 62f1992..16a13bb 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -668,9 +668,12 @@ Currently this means either text/html or 
application/xhtml+xml."
                   ("home" . :home)
                   ("contents" . :contents)
                   ("up" . :up)))))
-    (and href
-        where
-        (plist-put eww-data (cdr where) href))))
+    (when (and href where)
+      (when (memq (cdr where) '(:next :previous))
+        ;; Multi-page isearch support.
+        (setq-local multi-isearch-next-buffer-function
+                    #'eww-isearch-next-buffer))
+      (plist-put eww-data (cdr where) href))))
 
 (defvar eww-redirect-level 1)
 
@@ -840,6 +843,8 @@ Currently this means either text/html or 
application/xhtml+xml."
     (remove-overlays)
     (erase-buffer))
   (setq bidi-paragraph-direction nil)
+  ;; May be set later if there's a next/prev link.
+  (setq-local multi-isearch-next-buffer-function nil)
   (unless (eq major-mode 'eww-mode)
     (eww-mode)))
 
@@ -1080,8 +1085,6 @@ 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)
   (setq-local thing-at-point-provider-alist
               (append thing-at-point-provider-alist



reply via email to

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