[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19270: 25.0.50; make PDF mode in EWW customizable

From: Ivan Shmakov
Subject: bug#19270: 25.0.50; make PDF mode in EWW customizable
Date: Thu, 04 Dec 2014 15:04:20 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

>>>>> Sebastian Wiesner <address@hidden> writes:

 > Currently EWW uses `doc-view-mode' to view PDF data.  This choice is
 > hard-coded in `eww-display-pdf' and cannot be customized.

 > Some users (e. g. http://emacs.stackexchange.com/q/4089/227) however
 > desire to use alternative PDF modes, e. g. PDF Tools from
 > https://github.com/axot/pdf-tools.

 > Please make the PDF mode used by EWW customizable, so that users
 > don't have to resort to advices in order to change it.

        My suggestion would be to replace the (cond …) form in
        eww-render with something as flexible as:

   (let ((try-render (run-hook-with-args-until-success
                      eww-render-hook buffer url headers)))
     (if try-render
         (with-current-buffer try-render
           (when (derived-mode-p 'eww-mode)
             (plist-put eww-data :url url)
             (setq eww-history-position 0)
             (run-hooks 'eww-after-render-hook)))
       (error "No handler for Content-Type: %s (%s)"
              (car content-type) url)))

        Where eww-render-hook is a customizable hook with the default
        value chosen so to imitate the current behavior.

        (Also, I’d like to suggest replacing the hard-coded input
        handling in the ‘eww’ command proper with a similar
        eww-input-hook, so to be able to add support for urn:ietf:,
        ‘!whatever’, etc.)

FSF associate member #7257  np. Man on the Silver Mountain — Dio  … 230E 334A

reply via email to

[Prev in Thread] Current Thread [Next in Thread]