diff options
author | jao <jao@gnu.org> | 2021-05-20 06:13:31 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-05-20 06:13:31 +0100 |
commit | c29f6653150081aafa1ddcb7d6518cccb464b7c2 (patch) | |
tree | 19213708d62fbf396a389ba3f38aa1f6cab22324 /eww.org | |
parent | 64087b0f9620c0273d5258430f4c1f73b783f49f (diff) | |
download | elibs-c29f6653150081aafa1ddcb7d6518cccb464b7c2.tar.gz elibs-c29f6653150081aafa1ddcb7d6518cccb464b7c2.tar.bz2 |
eww/w3m consult narrowing refactored
Diffstat (limited to 'eww.org')
-rw-r--r-- | eww.org | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -52,6 +52,34 @@ (eww-reload t)) (call-interactively 'eww-reload))) #+end_src +* Consult narrowing + #+begin_src emacs-lisp + (with-eval-after-load "consult" + (defvar jao-eww-consult-history nil) + (defvar jao-eww-buffer-source + (list :name "eww buffer" + :category 'eww-buffer + :hidden t + :narrow (cons ?e "eww") + :annotate (lambda (c) (get-text-property 0 'url c)) + :history 'jao-eww-consult-history + :action (lambda (b) + (jao-afio--goto-www) + (switch-to-buffer (get-text-property 0 'buffer b))) + :items + (lambda () + (seq-map (lambda (b) + (with-current-buffer b + (let ((tl (or (plist-get eww-data :title) "")) + (url (or (eww-current-url) "<no url>"))) + (propertize (if (string-blank-p tl) url tl) + 'buffer b 'url url)))) + (seq-filter (lambda (b) + (eq 'eww-mode + (buffer-local-value 'major-mode b))) + (buffer-list)))))) + (jao-consult-add-buffer-source jao-eww-buffer-source "Web" ?e)) + #+end_src * Images #+begin_src emacs-lisp (defun jao-eww-next-image () |