Try to open pdf files properly in EWW
This commit is contained in:
parent
61697f07e5
commit
319cb5bd71
19
README.org
19
README.org
@ -829,6 +829,7 @@ defined in this Org file.
|
|||||||
(smart-latex-engrave-org-source-blocks :no-manual t)
|
(smart-latex-engrave-org-source-blocks :no-manual t)
|
||||||
(toggle-engrave-faces-latex-face-apply-override :no-manual t)
|
(toggle-engrave-faces-latex-face-apply-override :no-manual t)
|
||||||
(toggle-engrave-faces-latex-face-mapper-override :no-manual t)
|
(toggle-engrave-faces-latex-face-mapper-override :no-manual t)
|
||||||
|
(toggle-eww-display-pdf-around :no-manual t)
|
||||||
(toggle-org-babel-python-format-session-value-override :no-manual t)
|
(toggle-org-babel-python-format-session-value-override :no-manual t)
|
||||||
"Python"
|
"Python"
|
||||||
(choose-common-python-interpreter :no-manual t))))
|
(choose-common-python-interpreter :no-manual t))))
|
||||||
@ -4960,11 +4961,15 @@ Listing [[lst:configure-browse-url]] configures =browse-url=.
|
|||||||
nil t)))))
|
nil t)))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+caption[Configure =eww= rendering]:
|
#+caption[Rename =eww= buffers and display =pdf= links properly]:
|
||||||
#+caption: Configure =eww= rendering.
|
#+caption: Rename =eww= buffers and display =pdf= links properly.
|
||||||
#+name: lst:configure-eww-rendering
|
#+name: lst:rename-eww-buffer-display-pdf-links
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(with-eval-after-load 'eww
|
(with-eval-after-load 'eww
|
||||||
|
(defun eww-display-pdf-as-binary (fn &rest args)
|
||||||
|
(let ((buffer-file-coding-system 'binary))
|
||||||
|
(apply fn args)))
|
||||||
|
|
||||||
(defun eww-rename-buffer ()
|
(defun eww-rename-buffer ()
|
||||||
"Rename the buffer using title or url."
|
"Rename the buffer using title or url."
|
||||||
(let* ((title (plist-get eww-data :title))
|
(let* ((title (plist-get eww-data :title))
|
||||||
@ -4972,6 +4977,14 @@ Listing [[lst:configure-browse-url]] configures =browse-url=.
|
|||||||
(rename-buffer (format "*%s # eww*" name) t)))
|
(rename-buffer (format "*%s # eww*" name) t)))
|
||||||
|
|
||||||
(add-hook 'eww-after-render-hook #'eww-rename-buffer))
|
(add-hook 'eww-after-render-hook #'eww-rename-buffer))
|
||||||
|
|
||||||
|
(with-eval-after-load 'emacs
|
||||||
|
(defun toggle-eww-display-pdf-around ()
|
||||||
|
"Toggle `eww-display-advice' advice."
|
||||||
|
(interactive)
|
||||||
|
(toggle-advice 'eww-display-pdf :around #'eww-display-pdf-as-binary))
|
||||||
|
|
||||||
|
(toggle-eww-display-pdf-around))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** [[https://en.wikipedia.org/wiki/Media_type#Mailcap][Mailcap]]
|
*** [[https://en.wikipedia.org/wiki/Media_type#Mailcap][Mailcap]]
|
||||||
|
Loading…
Reference in New Issue
Block a user