From: Tassilo Horn <tsdh@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Manuel Giraud <manuel@ledu-giraud.fr>,
morgan@ice9.digital, emacs-devel@gnu.org, visuweshm@gmail.com
Subject: Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback)
Date: Mon, 23 Sep 2024 16:51:28 +0200 [thread overview]
Message-ID: <87msjyv2xb.fsf@gnu.org> (raw)
In-Reply-To: <8634lqh9bt.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Sep 2024 14:56:54 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Manuel Giraud <manuel@ledu-giraud.fr>
>> Cc: Morgan Willcock <morgan@ice9.digital>, emacs-devel@gnu.org, Eli
>> Zaretskii <eliz@gnu.org>, visuweshm@gmail.com
>> Date: Mon, 23 Sep 2024 10:34:57 +0200
>>
>> When I introduced doc-view-svg-face to inherit from the default face, I
>> thought it was right for reading long papers to match the user's
>> preference. Now, for invoices or other more complex documents, it may
>> be better to default to "black on white".
>>
>> But I think we should explain that one could inherit from the default
>> face to have its theme used into the doc-view-svg-face's docstring.
>
> Should we perhaps define suitable settings for this face in the themes
> that come with Emacs?
I think the problem is much more likely when using a dark theme, so
those could define black foreground and white background for
doc-view-svg-face. But since there are so many popular dark themes
outside of emacs, I doubt that's a good idea.
In the end, if the theming of the PDF/SVG gives suitable results depends
on the PDF and we have no way to test if it does for the one at hand.
So I'd rather apply something like that to the emacs-30 branch:
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 15352630d25..667b0e12986 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -238,10 +238,21 @@ doc-view-imenu-flatten
:type 'boolean
:version "29.1")
-(defface doc-view-svg-face '((t :inherit default))
+(defface doc-view-svg-face '((t :inherit default
+ :background "white"
+ :foreground "black"))
"Face used for SVG images.
Only background and foreground colors are used.
-See `doc-view-mupdf-use-svg'."
+See `doc-view-mupdf-use-svg'.
+
+If foreground and background color are not specified explicitly and
+therefore inherit from the `default' face, the default
+foreground/background color values are passed to `create-image' when
+preparing the SVG for display in the doc-view buffer. The effect is
+that the current theme's foreground/background values are applied to the
+SVG display. Note that this doesn't work for documents which are not
+simply black-on-white where it can lead to unreadable documents due to
+foreground and background color being equal or similar."
:version "30.1")
(make-obsolete 'doc-view-svg-background 'doc-view-svg-face "30.1")
--8<---------------cut here---------------end--------------->8---
Plus a corresponding NEWS entry telling that unsetting the
foreground/background of doc-view-svg-face will try to apply the current
theme's fg/bg colors also for the display in doc-view (in case of
mupdf+svg).
Bye,
Tassilo
next prev parent reply other threads:[~2024-09-23 14:51 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 17:53 No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback) Morgan Willcock
2024-09-20 18:53 ` Eli Zaretskii
2024-09-20 19:34 ` Visuwesh
2024-09-20 19:39 ` Morgan Willcock
2024-09-20 22:29 ` chad
2024-09-20 22:46 ` Morgan Willcock
2024-09-21 8:09 ` Eli Zaretskii
2024-09-21 9:27 ` Morgan Willcock
2024-09-21 17:35 ` Tassilo Horn
2024-09-22 20:57 ` Morgan Willcock
2024-09-23 6:44 ` Tassilo Horn
2024-09-23 8:34 ` Manuel Giraud via Emacs development discussions.
2024-09-23 8:45 ` Tassilo Horn
2024-09-23 11:34 ` Manuel Giraud via Emacs development discussions.
2024-09-23 11:56 ` Eli Zaretskii
2024-09-23 14:51 ` Tassilo Horn [this message]
2024-09-23 15:35 ` Eli Zaretskii
2024-09-23 15:50 ` Morgan Willcock
2024-09-23 16:10 ` Tassilo Horn
2024-09-23 16:27 ` Eli Zaretskii
2024-09-23 16:54 ` Tassilo Horn
2024-09-24 11:17 ` Eli Zaretskii
2024-09-24 11:22 ` Tassilo Horn
2024-09-23 17:56 ` Manuel Giraud via Emacs development discussions.
2024-09-23 18:35 ` Tassilo Horn
2024-09-23 19:06 ` Manuel Giraud via Emacs development discussions.
2024-09-23 9:36 ` Visuwesh
2024-09-23 11:55 ` Eli Zaretskii
2024-09-23 12:05 ` Tassilo Horn
2024-09-23 15:32 ` Eli Zaretskii
2024-09-21 7:28 ` Tassilo Horn
2024-09-21 9:27 ` Morgan Willcock
2024-09-21 11:04 ` Visuwesh
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87msjyv2xb.fsf@gnu.org \
--to=tsdh@gnu.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=manuel@ledu-giraud.fr \
--cc=morgan@ice9.digital \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.