From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Visuwesh <visuweshm@gmail.com>
Cc: 58041@debbugs.gnu.org
Subject: bug#58041: [PATCH] docview: Use svg images when using mupdf for conversion
Date: Thu, 12 Jan 2023 11:33:49 -0500 [thread overview]
Message-ID: <jwvwn5rhg2v.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87fscgxng0.fsf@gmail.com> (Visuwesh's message of "Thu, 12 Jan 2023 12:13:27 +0530")
> --- a/lisp/doc-view.el
> +++ b/lisp/doc-view.el
> @@ -921,7 +921,7 @@ doc-view-shrink-factor
> (defun doc-view-enlarge (factor)
> "Enlarge the document by FACTOR."
> (interactive (list doc-view-shrink-factor))
> - (if doc-view-scale-internally
> + (if (or doc-view-scale-internally doc-view-mupdf-use-svg)
> (let ((new (ceiling (* factor doc-view-image-width))))
> (unless (equal new doc-view-image-width)
> (setq-local doc-view-image-width new)
> @@ -941,7 +941,7 @@ doc-view-shrink
> (defun doc-view-scale-reset ()
> "Reset the document size/zoom level to the initial one."
> (interactive)
> - (if doc-view-scale-internally
> + (if (or doc-view-scale-internally doc-view-mupdf-use-svg)
> (progn
> (kill-local-variable 'doc-view-image-width)
> (doc-view-insert-image
Hmm.... `doc-view-mupdf-use-svg` means "use SVG when the backend
is mupdf" but we don't know here whether the backend is mupdf, so this
will misfire when using something else than mupdf, no?
>> I wasn't thinking of duplicating the code, but of rethinking the naming
>> a bit. I think what we meant by "pdf->png" is actually the process that
>> extracts pages (which just happened to use the PNG format and now can
>> also use the SVG format).
> Indeed, it is a misleading name. This change will have to go to master,
> I believe? I have to look around a bit more to see where the function
> is being used.
> There's also the fact that there's more than one more program that can
> generate SVG files (as Gregory pointed out in this thread) so it might
> be nice to have pdf->png and pdf->svg "function variables" and a "super
> function" that actually does the job. Hopefully, this will allow to
> fall back gracefully to PNG if SVG generation is faulty.
Indeed, I think there's some cleanup/orthogonalization in order here.
Stefan
next prev parent reply other threads:[~2023-01-12 16:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-24 10:18 bug#58041: [PATCH] docview: Use svg images when using mupdf for conversion Visuwesh
2022-09-24 12:10 ` Lars Ingebrigtsen
[not found] ` <jwva62yxevs.fsf-monnier+emacs@gnu.org>
2023-01-08 6:09 ` Visuwesh
2023-01-09 14:51 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-09 16:32 ` Visuwesh
2023-01-09 17:18 ` Gregory Heytings
2023-01-09 23:02 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-12 6:43 ` Visuwesh
2023-01-12 8:11 ` Eli Zaretskii
2023-01-12 8:20 ` Visuwesh
2023-01-12 8:48 ` Eli Zaretskii
2023-01-12 16:27 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-14 8:33 ` Eli Zaretskii
2023-01-12 16:33 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-01-12 16:47 ` Visuwesh
2023-01-12 21:11 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=jwvwn5rhg2v.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=58041@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=visuweshm@gmail.com \
/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).