From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Maik Beckmann Newsgroups: gmane.emacs.help Subject: Different emacs24 deftheme for emacsclient -t/-c frames Date: Mon, 20 Feb 2012 16:42:19 +0100 Message-ID: <877gzha4v8.wl%beckmann.maik@googlemail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1329763984 17735 80.91.229.3 (20 Feb 2012 18:53:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 20 Feb 2012 18:53:04 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 20 19:53:00 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RzYM5-0002Z0-4C for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Feb 2012 19:52:57 +0100 Original-Received: from localhost ([::1]:60633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzYM4-0000ot-KQ for geh-help-gnu-emacs@m.gmane.org; Mon, 20 Feb 2012 13:52:56 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:60681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzVNr-00004u-4O for help-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:42:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzVNe-0002V3-Pu for help-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:42:35 -0500 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:54568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzVNe-0002Uf-J1 for help-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:42:22 -0500 Original-Received: by wgbdt13 with SMTP id dt13so3806022wgb.30 for ; Mon, 20 Feb 2012 07:42:21 -0800 (PST) Received-SPF: pass (google.com: domain of beckmann.maik@googlemail.com designates 10.181.13.113 as permitted sender) client-ip=10.181.13.113; Authentication-Results: mr.google.com; spf=pass (google.com: domain of beckmann.maik@googlemail.com designates 10.181.13.113 as permitted sender) smtp.mail=beckmann.maik@googlemail.com; dkim=pass header.i=beckmann.maik@googlemail.com Original-Received: from mr.google.com ([10.181.13.113]) by 10.181.13.113 with SMTP id ex17mr18192403wid.15.1329752541106 (num_hops = 1); Mon, 20 Feb 2012 07:42:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=date:message-id:from:to:subject:user-agent:mime-version :content-type; bh=H+Fy+9r+rMC3yCNqAiXpV1pCK8+omAoon+ctbgOH7dM=; b=aGSiUlB3F2qTJ7+4RMDaErz7yWCI6yF6hV2OrHQ+epGGomOEpXfT3Q40v6RkhCgqH9 S6rZ8ujAnSxXTG4CI01Ar+s4v9uYS903yl3ykkloJ1YDYj9gU62FD8glKiB4NCIchTBS R+ASAt6D+6fSLJZQQizNB6idvmg/lgvXecs8o= Original-Received: by 10.181.13.113 with SMTP id ex17mr15111444wid.15.1329752541041; Mon, 20 Feb 2012 07:42:21 -0800 (PST) Original-Received: from myhost.googlemail.com (cable-81-173-164-222.netcologne.de. [81.173.164.222]) by mx.google.com with ESMTPS id fw5sm16516335wib.0.2012.02.20.07.42.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Feb 2012 07:42:20 -0800 (PST) User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.0.93 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.49 X-Mailman-Approved-At: Mon, 20 Feb 2012 13:52:51 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83814 Archived-At: Hello I like to use a different theme depending on whether I connect to the running server with a terminal frame % emacsclient -t or with a gtk frame % emacsclient -c The code I've used for color-theme.el looks like this (require 'color-theme) (setq color-theme-is-cumulative nil) (defun mb/pick-color-theme (frame) (select-frame frame) (let ((color-theme-is-global nil)) (if (window-system frame) (color-theme-vim-colors) (color-theme-pok-wob)))) (add-hook 'after-make-frame-functions 'mb/pick-color-theme) ;; For when started with emacs or emacs -nw rather than emacs --daemon (let ((color-theme-is-global nil)) (color-theme-initialize) (if window-system (eval-after-load "color-theme" '(color-theme-vim-colors)) (color-theme-pok-wob))) Here the result - [http://i.imgur.com/2nD17.png] My question: How does the code look like that does the same for emacs24 deftheme themes? Here a try ;; last t is for NO-ENABLE (load-theme 'tango t t) (load-theme 'tango-dark t t) (defun mb/pick-color-theme (frame) (select-frame frame) (if (window-system frame) (progn (disable-theme 'tango-dark) ; in case it was active (enable-theme 'tango)) (progn (disable-theme 'tango) ; in case it was active (enable-theme 'tango-dark)))) (add-hook 'after-make-frame-functions 'mb/pick-color-theme) ;; For when started with emacs or emacs -nw rather than emacs --daemon (if window-system (enable-theme 'tango) (enable-theme 'tango-dark)) The result - [http://i.imgur.com/FocGA.png] shows when happens if a terminal client is connected after a gtk frame client. The exisiting gtk frame got affected by (enable-theme 'tango-dark). Comparing the two code snippets brings up the question: Is there an equivalent to color-theme-is-global for deftheme themes? If not, how is the proper way of doing it? Thanks, Maik