unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 19270@debbugs.gnu.org
Subject: bug#19270: 25.0.50; make PDF mode in EWW customizable
Date: Thu, 04 Dec 2014 15:04:20 +0000	[thread overview]
Message-ID: <87iohro3rf.fsf@violet.siamics.net> (raw)
In-Reply-To: <m2fvcvwl4f.fsf@lunaryorn-air.fritz.box> (Sebastian Wiesner's message of "Thu, 04 Dec 2014 15:22:08 +0100")

>>>>> Sebastian Wiesner <swiesner@lunaryorn.com> 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)
             (eww-update-header-line-format)
             (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	other threads:[~2014-12-04 15:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 14:22 bug#19270: 25.0.50; Make PDF Mode in EWW customizable Sebastian Wiesner
2014-12-04 15:04 ` Ivan Shmakov [this message]
2014-12-04 16:20 ` Stefan Monnier
2014-12-04 16:29   ` Lars Magne Ingebrigtsen
2014-12-04 20:23     ` Stefan Monnier
2014-12-05 13:57       ` Lars Magne Ingebrigtsen
2014-12-05 15:52     ` Lars Magne Ingebrigtsen
2014-12-05 17:32     ` Rüdiger Sonderfeld
2014-12-04 17:10   ` Ivan Shmakov
2014-12-04 20:25     ` Stefan Monnier
2014-12-04 21:24       ` bug#19270: 25.0.50; make PDF mode " Ivan Shmakov
2014-12-05 11:02   ` bug#19270: 25.0.50; Make PDF Mode " Sebastian Wiesner
2014-12-05 15:40     ` Stefan Monnier
2014-12-05 16:13       ` Sebastian Wiesner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iohro3rf.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=19270@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).