[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback)
From: |
Tassilo Horn |
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 |
User-agent: |
mu4e 1.12.6; emacs 31.0.50 |
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
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), (continued)
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Morgan Willcock, 2024/09/20
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Eli Zaretskii, 2024/09/21
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Morgan Willcock, 2024/09/21
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Tassilo Horn, 2024/09/21
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Morgan Willcock, 2024/09/22
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Tassilo Horn, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Manuel Giraud, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Tassilo Horn, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Manuel Giraud, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Eli Zaretskii, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback),
Tassilo Horn <=
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Eli Zaretskii, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Morgan Willcock, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Tassilo Horn, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Eli Zaretskii, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Tassilo Horn, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Eli Zaretskii, 2024/09/24
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Tassilo Horn, 2024/09/24
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Manuel Giraud, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Tassilo Horn, 2024/09/23
- Re: No NEWS entry for doc-view-mupdf-use-svg (Emacs 30.0.91 feedback), Manuel Giraud, 2024/09/23