summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2025-09-18 20:41:44 +0100
committerjao <jao@gnu.org>2025-09-18 20:42:39 +0100
commit5ccb0abcb3c1eecefc31cc88911ff520f4c25709 (patch)
tree86df755bf0688bd3c469f79780e77134e035eab9
parent98d8a68cd764798d54d1c63c05c9b872a790f0ca (diff)
downloadelibs-5ccb0abcb3c1eecefc31cc88911ff520f4c25709.tar.gz
elibs-5ccb0abcb3c1eecefc31cc88911ff520f4c25709.tar.bz2
ewww active in mac
-rw-r--r--attic/elisp/misc.el28
-rw-r--r--custom/jao-custom-eww.el35
-rw-r--r--init.el3
3 files changed, 32 insertions, 34 deletions
diff --git a/attic/elisp/misc.el b/attic/elisp/misc.el
index 558202e..d8c2610 100644
--- a/attic/elisp/misc.el
+++ b/attic/elisp/misc.el
@@ -1047,3 +1047,31 @@
:ensure t
:commands (gnuplot-mode gnuplot-make-buffer)
:init (add-to-list 'auto-mode-alist '("\\.gp$" . gnuplot-mode)))
+
+;;; rdrview
+;; https://jiewawa.me/2024/04/another-way-of-integrating-mozilla-readability-in-emacs-eww/
+(define-minor-mode eww-rdrview-mode
+ "Toggle whether to use `rdrview' to make eww buffers more readable."
+ :lighter " R"
+ (if eww-rdrview-mode
+ (progn
+ (setq eww-retrieve-command '("rdrview" "-T" "title,sitename,body" "-H"))
+ (add-hook 'eww-after-render-hook #'eww-rdrview-update-title))
+ (progn
+ (setq eww-retrieve-command nil)
+ (remove-hook 'eww-after-render-hook #'eww-rdrview-update-title))))
+
+(defun eww-rdrview-update-title ()
+ "Change title key in `eww-data' with first line of buffer.
+It should be the title of the web page as returned by `rdrview'"
+ (save-excursion
+ (goto-char (point-min))
+ (plist-put eww-data :title (string-trim (thing-at-point 'line t))))
+ (eww--after-page-change))
+
+(defun eww-rdrview-toggle-and-reload ()
+ "Toggle `eww-rdrview-mode' and reload page in current eww buffer."
+ (interactive)
+ (if eww-rdrview-mode (eww-rdrview-mode -1)
+ (eww-rdrview-mode 1))
+ (eww-reload))
diff --git a/custom/jao-custom-eww.el b/custom/jao-custom-eww.el
index 1b766c9..cdd5c8d 100644
--- a/custom/jao-custom-eww.el
+++ b/custom/jao-custom-eww.el
@@ -157,33 +157,6 @@
(pop-to-buffer buff)
(goto-char (point-min))))
-;;; rdrview
-;; https://jiewawa.me/2024/04/another-way-of-integrating-mozilla-readability-in-emacs-eww/
-(define-minor-mode eww-rdrview-mode
- "Toggle whether to use `rdrview' to make eww buffers more readable."
- :lighter " R"
- (if eww-rdrview-mode
- (progn
- (setq eww-retrieve-command '("rdrview" "-T" "title,sitename,body" "-H"))
- (add-hook 'eww-after-render-hook #'eww-rdrview-update-title))
- (progn
- (setq eww-retrieve-command nil)
- (remove-hook 'eww-after-render-hook #'eww-rdrview-update-title))))
-
-(defun eww-rdrview-update-title ()
- "Change title key in `eww-data' with first line of buffer.
-It should be the title of the web page as returned by `rdrview'"
- (save-excursion
- (goto-char (point-min))
- (plist-put eww-data :title (string-trim (thing-at-point 'line t))))
- (eww--after-page-change))
-
-(defun eww-rdrview-toggle-and-reload ()
- "Toggle `eww-rdrview-mode' and reload page in current eww buffer."
- (interactive)
- (if eww-rdrview-mode (eww-rdrview-mode -1)
- (eww-rdrview-mode 1))
- (eww-reload))
;;; auto-readable
(defvar jao-eww-auto-readable-urls
(regexp-opt '("guardian.co.uk" "theguardian.com" "github.com" "eldiario.es")))
@@ -193,6 +166,7 @@ It should be the title of the web page as returned by `rdrview'"
(eww-readable)))
(add-hook 'eww-after-render-hook #'jao-eww-autoread)
+
;;; package
(use-package shr
:custom ((shr-width nil)
@@ -210,12 +184,7 @@ It should be the title of the web page as returned by `rdrview'"
(eww-download-directory jao-sink-dir)
(eww-header-line-format " %u")
(eww-form-checkbox-selected-symbol "☒")
- (eww-buffer-name-length 180)
- ;; (eww-readable-urls '("guardian\\.co\\.uk"
- ;; "theguardian\\.com"
- ;; "eldiario\\.es"
- ;; "theconversation"))
- )
+ (eww-buffer-name-length 180))
:config
(with-eval-after-load "org" (require 'ol-eww nil t))
diff --git a/init.el b/init.el
index 09b8312..230fa33 100644
--- a/init.el
+++ b/init.el
@@ -1303,8 +1303,9 @@
(add-hook 'LaTeX-mode-hook 'turn-on-reftex))
;;; Browsing
+
(require 'jao-custom-browse)
-(jao-when-linux (require 'jao-custom-eww))
+(require 'jao-custom-eww)
;;; PDFs and other docs