unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Setting color themes specific to a frame
@ 2012-02-20  4:57 Adam
  2012-02-20  7:52 ` Thorsten
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Adam @ 2012-02-20  4:57 UTC (permalink / raw)
  To: help-gnu-emacs

I am using emacs 24, and really enjoy the new color theme feature.  I
have one little issue, though.  I am using one emacs daemon instance,
and lots of instances.  Some using X11-Frames, some on plain terminals.
Is there any method to get the color theme just enabled on X11-frames,
but fall back to the default color theme on terminals - or, more
general - is there a method to set a color theme only for one specific
frame, without affecting the other frames?



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Setting color themes specific to a frame
  2012-02-20  4:57 Setting color themes specific to a frame Adam
@ 2012-02-20  7:52 ` Thorsten
  2012-02-20  9:00   ` Adam
  2012-02-20  8:23 ` suvayu ali
  2012-02-20 21:48 ` Maik Beckmann
  2 siblings, 1 reply; 8+ messages in thread
From: Thorsten @ 2012-02-20  7:52 UTC (permalink / raw)
  To: help-gnu-emacs

Adam <adam_w67@yahoo.com> writes:

> I am using emacs 24, and really enjoy the new color theme feature.  I
> have one little issue, though.  I am using one emacs daemon instance,
> and lots of instances.  Some using X11-Frames, some on plain terminals.
> Is there any method to get the color theme just enabled on X11-frames,
> but fall back to the default color theme on terminals - or, more
> general - is there a method to set a color theme only for one specific
> frame, without affecting the other frames?

I just had a similar problem, and solved it with some help from this
newsgroup:

I use the same setup like you - one daemon an lots of instances on plain
terminals and X, and use the following code to have different colors on
X:

,-------------------------------------------------------------------
| (defun tj-set-window-type-dependend-emacsclient-colors ()
|     "Sets emacsclient colors for X.
| Background-color is set to black and foreground-color to wheat for
| emacsclient on X"
|     (if (display-graphic-p)
|         (progn
|           (set-background-color "black")
|           (set-foreground-color "wheat"))))
| 
| (add-hook 'server-visit-hook
|           'tj-set-window-type-dependend-emacsclient-colors)
`-------------------------------------------------------------------

Instead of setting background-colors you might be able to change the
color-theme? 

This only works, when visiting a file when calling emacsclient, i.e.

,---------------------------------------
| exec emacsclient -c "/path/to/file.el"
`---------------------------------------

When using only the -c flag without a file argument, the *scratch*
buffer is visited, but the server-visit-hook is not called apparently. 

cheers
--
Thorsten




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Setting color themes specific to a frame
  2012-02-20  4:57 Setting color themes specific to a frame Adam
  2012-02-20  7:52 ` Thorsten
@ 2012-02-20  8:23 ` suvayu ali
  2012-02-20  8:52   ` Adam
  2012-02-20 21:48 ` Maik Beckmann
  2 siblings, 1 reply; 8+ messages in thread
From: suvayu ali @ 2012-02-20  8:23 UTC (permalink / raw)
  To: help-gnu-emacs

Hi Adam,

On Mon, Feb 20, 2012 at 05:57, Adam <adam_w67@yahoo.com> wrote:
> I am using emacs 24, and really enjoy the new color theme feature.  I
> have one little issue, though.  I am using one emacs daemon instance,
> and lots of instances.  Some using X11-Frames, some on plain terminals.
> Is there any method to get the color theme just enabled on X11-frames,
> but fall back to the default color theme on terminals - or, more
> general - is there a method to set a color theme only for one specific
> frame, without affecting the other frames?

If you are not using emacs --daemon, then I believe the solution lies
in the color-theme library. Setting color-theme-is-global to nil
should give you the behaviour you are looking for. For some hint you
can look here:

<https://github.com/suvayu/.emacs.d/blob/master/init.el#L113>

GL

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Setting color themes specific to a frame
  2012-02-20  8:23 ` suvayu ali
@ 2012-02-20  8:52   ` Adam
  2012-02-20 13:37     ` suvayu ali
  0 siblings, 1 reply; 8+ messages in thread
From: Adam @ 2012-02-20  8:52 UTC (permalink / raw)
  To: help-gnu-emacs

suvayu ali <fatkasuvayu+linux@gmail.com> writes:

> Hi Adam,
>
> On Mon, Feb 20, 2012 at 05:57, Adam <adam_w67@yahoo.com> wrote:
>> I am using emacs 24, and really enjoy the new color theme feature.  I
>> have one little issue, though.  I am using one emacs daemon instance,
>> and lots of instances.  Some using X11-Frames, some on plain terminals.
>> Is there any method to get the color theme just enabled on X11-frames,
>> but fall back to the default color theme on terminals - or, more
>> general - is there a method to set a color theme only for one specific
>> frame, without affecting the other frames?
>
> If you are not using emacs --daemon, then I believe the solution lies
> in the color-theme library. Setting color-theme-is-global to nil
> should give you the behaviour you are looking for. For some hint you
> can look here:
>
> <https://github.com/suvayu/.emacs.d/blob/master/init.el#L113>

my emacs (GNU Emacs 24.0.93.1 (x86_64-unknown-linux-gnu, GTK+ Version
2.20.1)) does not have color-theme-is-global.  It is pretty much what I
want, though.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Setting color themes specific to a frame
  2012-02-20  7:52 ` Thorsten
@ 2012-02-20  9:00   ` Adam
  0 siblings, 0 replies; 8+ messages in thread
From: Adam @ 2012-02-20  9:00 UTC (permalink / raw)
  To: help-gnu-emacs

Thorsten <quintfall@googlemail.com> writes:

Hi Thorsten,

> Adam <adam_w67@yahoo.com> writes:
>
>> I am using emacs 24, and really enjoy the new color theme feature.  I
>> have one little issue, though.  I am using one emacs daemon instance,
>> and lots of instances.  Some using X11-Frames, some on plain terminals.
>> Is there any method to get the color theme just enabled on X11-frames,
>> but fall back to the default color theme on terminals - or, more
>> general - is there a method to set a color theme only for one specific
>> frame, without affecting the other frames?
>
> I just had a similar problem, and solved it with some help from this
> newsgroup:
>
> I use the same setup like you - one daemon an lots of instances on plain
> terminals and X, and use the following code to have different colors on
> X:
>
> ,-------------------------------------------------------------------
> | (defun tj-set-window-type-dependend-emacsclient-colors ()
> |     "Sets emacsclient colors for X.
> | Background-color is set to black and foreground-color to wheat for
> | emacsclient on X"
> |     (if (display-graphic-p)
> |         (progn
> |           (set-background-color "black")
> |           (set-foreground-color "wheat"))))
> |
> | (add-hook 'server-visit-hook
> |           'tj-set-window-type-dependend-emacsclient-colors)
> `-------------------------------------------------------------------
>
> Instead of setting background-colors you might be able to change the
> color-theme?

This does not work here.  This does not overwrite my color theme
settings.

BTW. changing the variables which store my color theme properties does not
work.  Emacs's load-theme, which is called in my init.el, examines the
theme variable and sets all the properties globally.  I need a method to
make load-theme set the theme properties frame-local, so I can call it
in my after-make-frame-functions.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Setting color themes specific to a frame
  2012-02-20  8:52   ` Adam
@ 2012-02-20 13:37     ` suvayu ali
  2012-02-20 15:40       ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: suvayu ali @ 2012-02-20 13:37 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Feb 20, 2012 at 09:52, Adam <adam_w67@yahoo.com> wrote:
> I believe the solution lies
>> in the color-theme library. Setting color-theme-is-global to nil
>> should give you the behaviour you are looking for. For some hint you
>> can look here:
>>
>> <https://github.com/suvayu/.emacs.d/blob/master/init.el#L113>
>
> my emacs (GNU Emacs 24.0.93.1 (x86_64-unknown-linux-gnu, GTK+ Version
> 2.20.1)) does not have color-theme-is-global.  It is pretty much what I
> want, though.

Of course it doesn't. As I mentioned earlier, you have to use the
color-theme elisp library to get that working. :)

<http://www.nongnu.org/color-theme/>

GL

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Setting color themes specific to a frame
  2012-02-20 13:37     ` suvayu ali
@ 2012-02-20 15:40       ` Drew Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2012-02-20 15:40 UTC (permalink / raw)
  To: 'suvayu ali', help-gnu-emacs

> Of course it doesn't. As I mentioned earlier, you have to use the
> color-theme elisp library to get that working. :)
> <http://www.nongnu.org/color-theme/>

To clarify a bit more:

Emacs 24 does _not_ include color-theme.el or color themes, at all.  Emacs
instead created a similar feature that it calls "custom" themes.  The two are
_not_ the same.

Why Emacs did not incorporate color-theme.el or make its similar "custom" theme
feature be compatible with color themes, I cannot tell you.  But you need to
keep the two straight if you want to follow help offered by others on this list.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Setting color themes specific to a frame
  2012-02-20  4:57 Setting color themes specific to a frame Adam
  2012-02-20  7:52 ` Thorsten
  2012-02-20  8:23 ` suvayu ali
@ 2012-02-20 21:48 ` Maik Beckmann
  2 siblings, 0 replies; 8+ messages in thread
From: Maik Beckmann @ 2012-02-20 21:48 UTC (permalink / raw)
  To: help-gnu-emacs

Heh, for some reason I misjudged from the subject that you're message
is about color-theme.el rather than emacs24 deftheme themes (or
whatever it is called). I consider my thread to be closed and will
participate in this one instead.

Here it link to my message:
 - http://lists.gnu.org/archive/html/help-gnu-emacs/2012-02/msg00237.html

It contains code for color-theme.el and deftheme themes and screenshots
of its effect.

What I like to archive is:
 1. determine whether deftheme themes support having frame specific
    settings.
 2. if not, if it is planned to support that.


Best,
Maik



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-20 21:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20  4:57 Setting color themes specific to a frame Adam
2012-02-20  7:52 ` Thorsten
2012-02-20  9:00   ` Adam
2012-02-20  8:23 ` suvayu ali
2012-02-20  8:52   ` Adam
2012-02-20 13:37     ` suvayu ali
2012-02-20 15:40       ` Drew Adams
2012-02-20 21:48 ` Maik Beckmann

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).