diff --git a/README.org b/README.org index 110b1d9..898e868 100644 --- a/README.org +++ b/README.org @@ -5739,22 +5739,19 @@ Listing [[lst:configure-browse-url]] configures =browse-url=. :CUSTOM_ID: sec:emacs-web-wowser :END: -#+caption[Rename =eww= buffers and display =pdf= links properly]: -#+caption: Rename =eww= buffers and display =pdf= links properly. -#+name: lst:rename-eww-buffer-display-pdf-links +#+caption[Display =pdf= links properly in =eww=]: +#+caption: Display =pdf= links properly in =eww=. +#+name: lst:display-pdf-links-in-eww #+begin_src emacs-lisp -n :results silent (with-eval-after-load 'eww + ;; GAV: Renaming `eww' buffers conflicts with `desktop-save-mode'. + ;; GAV: Setting `eww-restore-desktop' to something else fails too. + (setopt eww-restore-desktop nil) + (defun eww-display-pdf-as-binary (fn &rest args) (let ((buffer-file-coding-system 'binary)) (apply fn args))) - (defun eww-rename-buffer () - "Rename the buffer using title or url." - (let* ((title (plist-get eww-data :title)) - (name (or (and (eq "" title) (plist-get eww-data :url)) title))) - (rename-buffer (format "*%s # eww*" name) t))) - - (add-hook 'eww-after-render-hook #'eww-rename-buffer) (advice-add 'eww-display-pdf :around #'eww-display-pdf-as-binary)) #+end_src