summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--custom/jao-custom-w3m.el8
-rw-r--r--init.el8
2 files changed, 9 insertions, 7 deletions
diff --git a/custom/jao-custom-w3m.el b/custom/jao-custom-w3m.el
index 634d21e..51272ca 100644
--- a/custom/jao-custom-w3m.el
+++ b/custom/jao-custom-w3m.el
@@ -27,13 +27,14 @@
(let ((w3m-message-silent t)
(w3m-fill-column 120)
(mm-w3m-safe-url-regexp nil))
- (condition-case nil
+ (condition-case e
(mm-inline-text-html-render-with-w3m handle)
- (error (delete-region (point) (point-max))
+ (error (message "Error rendering page with w3m: %s" e)
+ (delete-region (point) (point-max))
(let ((shr-use-fonts nil))
(mm-shr handle))))))
-(setq mm-text-html-renderer #'jao-w3m-html-renderer)
+(setq mm-text-html-renderer 'jao-w3m-html-renderer)
;;; org integration
(defun jao-w3m-get-link ()
@@ -102,6 +103,7 @@
;;; package
(use-package w3m
:ensure t
+ :demand t
:custom ((w3m-key-binding 'info)
(w3m-display-mode 'dual-pane))
:init
diff --git a/init.el b/init.el
index 80df4cf..b70eac6 100644
--- a/init.el
+++ b/init.el
@@ -955,7 +955,7 @@
(if (string-match-p "\.epub\\'" file)
(find-file file)
(jao-afio--goto-www)
- (eww-open-file file)))
+ (if jao-afio-use-w3m (w3m-find-file file) (eww-open-file file))))
(defun jao-recoll-open-pdf (file &optional page)
(if (string-match-p "/gnus/Mail/" file)
@@ -1443,7 +1443,8 @@
;;;; downloads using wget
(defun jao-wget--get-title (filename)
- (or (plist-get eww-data :title)
+ (or (and (derived-mode-p 'w3m-mode) (w3m-current-title))
+ (plist-get eww-data :title)
(and (not (string-blank-p (or filename "")))
(subst-char-in-string ?- ? (capitalize (file-name-base filename))))))
@@ -1520,8 +1521,7 @@
(with-current-buffer b
(or (derived-mode-p 'w3m-mode 'eww-mode)
(and (boundp 'exwm-class-name)
- (member (buffer-local-value 'exwm-class-name b)
- '("vlc" "mpv"))))))
+ (member exwm-class-name '("vlc" "mpv"))))))
;; (require 'jao-custom-eww)
(require 'jao-custom-w3m)