* bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local?
@ 2012-04-10 20:07 Jambunathan K
2012-04-10 20:24 ` Drew Adams
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Jambunathan K @ 2012-04-10 20:07 UTC (permalink / raw)
To: 11213
24.0.95; (Maybe/Wish): Should color-themes be buffer local?
The impression I get is that color themes are session-specific and I am
wondering whether it is possible to load a theme just for a particular
buffer (or a mode). [1]
Context:
ODT exporter uses htmlfontify.el to export source blocks with some fancy
colors.[2] The implication is that an ODT file created out of an Org
file (with src blocks) will look and feel differently based on
individual user's font lock settings. If there was/were a way to
activate a theme on per-buffer basis, then I would like to use it within
the ODT exporter.
Not a bug per-se. Just a wish.
Footnotes:
[1] http://lists.gnu.org/archive/html/help-gnu-emacs/2011-10/msg00329.html
Same request as this bug report. But from an independent source. It
went unanswered.
[2] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9914
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local?
2012-04-10 20:07 bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local? Jambunathan K
@ 2012-04-10 20:24 ` Drew Adams
2012-04-10 20:32 ` Jambunathan K
2012-04-11 6:58 ` Chong Yidong
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2012-04-10 20:24 UTC (permalink / raw)
To: 'Jambunathan K', 11213
color-themes.el is not part of Emacs.
http://www.emacswiki.org/emacs/ColorTheme
Perhaps you mean custom themes instead?
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local?
2012-04-10 20:07 bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local? Jambunathan K
2012-04-10 20:24 ` Drew Adams
@ 2012-04-11 6:58 ` Chong Yidong
2012-04-11 10:32 ` Jambunathan K
2012-04-21 16:01 ` Victor Borja
2013-11-15 5:05 ` Jambunathan K
3 siblings, 1 reply; 9+ messages in thread
From: Chong Yidong @ 2012-04-11 6:58 UTC (permalink / raw)
To: Jambunathan K; +Cc: 11213
Jambunathan K <kjambunathan@gmail.com> writes:
> ODT exporter uses htmlfontify.el to export source blocks with some
> fancy colors.[2] The implication is that an ODT file created out of an
> Org file (with src blocks) will look and feel differently based on
> individual user's font lock settings. If there was/were a way to
> activate a theme on per-buffer basis, then I would like to use it
> within the ODT exporter.
Your description is not too clear, but I guess what you're trying to say
is that you want the htmlfontified output to use some standard set of
faces, independent of the user's face settings. Probably the best way
to do that is to set up face remappings in the to-be-exported buffer.
See the Face Remapping node in the Lisp manual for details.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local?
2012-04-11 6:58 ` Chong Yidong
@ 2012-04-11 10:32 ` Jambunathan K
2012-04-21 6:28 ` Chong Yidong
0 siblings, 1 reply; 9+ messages in thread
From: Jambunathan K @ 2012-04-11 10:32 UTC (permalink / raw)
To: Chong Yidong; +Cc: 11213
Hello Chong
> Jambunathan K <kjambunathan@gmail.com> writes:
>
>> ODT exporter uses htmlfontify.el to export source blocks with some
>> fancy colors.[2] The implication is that an ODT file created out of an
>> Org file (with src blocks) will look and feel differently based on
>> individual user's font lock settings. If there was/were a way to
>> activate a theme on per-buffer basis, then I would like to use it
>> within the ODT exporter.
>
> Your description is not too clear, but I guess what you're trying to say
> is that you want the htmlfontified output to use some standard set of
> faces, independent of the user's face settings.
You have understood me correctly.
> Probably the best way to do that is to set up face remappings in the
> to-be-exported buffer. See the Face Remapping node in the Lisp manual
> for details.
Given a(ny) theme, let's say "adwaita-theme.el", can someone give me a
recipe which runs through all the face definitions defined in that theme
file and hand it off to `face-remapping-alist'.
I don't see any references to remap in cus-face.el and I think it will
take sometime for me to "massage" face definitions in a theme file in to
a form that is understood by `face-remapping-alist'. I hope such a
massaging is possible.
Again, any ready to use recipe is most welcome.
Jambunathan K.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local?
2012-04-11 10:32 ` Jambunathan K
@ 2012-04-21 6:28 ` Chong Yidong
2012-04-25 19:07 ` Jambunathan K
0 siblings, 1 reply; 9+ messages in thread
From: Chong Yidong @ 2012-04-21 6:28 UTC (permalink / raw)
To: Jambunathan K; +Cc: 11213
Jambunathan K <kjambunathan@gmail.com> writes:
>> Probably the best way to do that is to set up face remappings in the
>> to-be-exported buffer. See the Face Remapping node in the Lisp manual
>> for details.
>
> Given a(ny) theme, let's say "adwaita-theme.el", can someone give me a
> recipe which runs through all the face definitions defined in that theme
> file and hand it off to `face-remapping-alist'.
Do
(get 'adwaita 'theme-settings)
and collect all the face settings in the resulting list. Each list
element should have the form
(theme-face FACE adwaita SPEC)
where FACE is a face which is customized by the theme, and SPEC is the
face spec specified. Once you know FACE, you probably want to
(face-spec-choose (face-default-spec FACE)
to get the face attributes for the face's default (uncustomized,
unthemed) face spec, on the selected frame. Then you can put that
attribute in face-remapping-alist.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local?
2012-04-21 6:28 ` Chong Yidong
@ 2012-04-25 19:07 ` Jambunathan K
0 siblings, 0 replies; 9+ messages in thread
From: Jambunathan K @ 2012-04-25 19:07 UTC (permalink / raw)
To: Chong Yidong; +Cc: 11213
[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]
Chong Yidong <cyd@gnu.org> writes:
> Jambunathan K <kjambunathan@gmail.com> writes:
>
>>> Probably the best way to do that is to set up face remappings in the
>>> to-be-exported buffer. See the Face Remapping node in the Lisp manual
>>> for details.
>>
>> Given a(ny) theme, let's say "adwaita-theme.el", can someone give me a
>> recipe which runs through all the face definitions defined in that theme
>> file and hand it off to `face-remapping-alist'.
>
> Do
>
> (get 'adwaita 'theme-settings)
>
> and collect all the face settings in the resulting list. Each list
> element should have the form
>
> (theme-face FACE adwaita SPEC)
>
> where FACE is a face which is customized by the theme, and SPEC is the
> face spec specified. Once you know FACE, you probably want to
>
> (face-spec-choose (face-default-spec FACE)
>
> to get the face attributes for the face's default (uncustomized,
> unthemed) face spec, on the selected frame. Then you can put that
> attribute in face-remapping-alist.
Based on your suggestion this is what I have cooked up. I am recording
what I see as problems and invite your comments.
1. Copy the attached form to color-theme.el
2. emacs -q, C-x C-f color-theme.el
3. M-x load-theme-buffer-local RET tango-dark RET
4. Look at the attached png image for a screenshot of the image.
5. Place your cursor on `load-theme-buffer-local' and C-u C-x =. Follow
the link to `font-lock-function-name-face'.
6. You will see that foreground color is reported as "Blue1" while /in
fact/ the face is yellowish.
7. Now M-x htmlfontify-buffer. I am attaching the .html file created
by this command. You will see that the buffer is colorized based on
uncustomized face settings.
I believe the problems in 5-7 are related.
I think C-u C-x = and whatever the underlying APIs that htmlfontify uses
for retrieving face properties should act on effective value and not
global values.
[-- Attachment #2: color-theme.el --]
[-- Type: application/emacs-lisp, Size: 923 bytes --]
[-- Attachment #3: load-theme-buffer-local.png --]
[-- Type: image/png, Size: 47269 bytes --]
[-- Attachment #4: color-theme.el.html --]
[-- Type: text/html, Size: 8204 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local?
2012-04-10 20:07 bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local? Jambunathan K
2012-04-10 20:24 ` Drew Adams
2012-04-11 6:58 ` Chong Yidong
@ 2012-04-21 16:01 ` Victor Borja
2013-11-15 5:05 ` Jambunathan K
3 siblings, 0 replies; 9+ messages in thread
From: Victor Borja @ 2012-04-21 16:01 UTC (permalink / raw)
To: 11213
Hi, i just created a couple of el files (one for color-theme.el
and other for emacs24 custom themes) for installing a theme
buffer-locally
https://github.com/vic/color-theme-buffer-local
these rely on face remapping as some replys here say.
^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local?
2012-04-10 20:07 bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local? Jambunathan K
` (2 preceding siblings ...)
2012-04-21 16:01 ` Victor Borja
@ 2013-11-15 5:05 ` Jambunathan K
3 siblings, 0 replies; 9+ messages in thread
From: Jambunathan K @ 2013-11-15 5:05 UTC (permalink / raw)
To: 11213-done
OP here. Closed.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-11-15 5:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 20:07 bug#11213: 24.0.95; (Maybe/Wish): Should color-themes be buffer local? Jambunathan K
2012-04-10 20:24 ` Drew Adams
2012-04-10 20:32 ` Jambunathan K
2012-04-11 6:58 ` Chong Yidong
2012-04-11 10:32 ` Jambunathan K
2012-04-21 6:28 ` Chong Yidong
2012-04-25 19:07 ` Jambunathan K
2012-04-21 16:01 ` Victor Borja
2013-11-15 5:05 ` Jambunathan K
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).