From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: conditional font faces Date: Sun, 28 Feb 2010 23:10:26 +0100 Message-ID: <4B8AE9D2.1070702@gmail.com> References: <4B89BF15.1070605@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1267395024 20478 80.91.229.12 (28 Feb 2010 22:10:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Feb 2010 22:10:24 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Tim Visher Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 28 23:10:19 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NlrL9-0001K0-DJ for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Feb 2010 23:10:19 +0100 Original-Received: from localhost ([127.0.0.1]:36685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NlrL8-0001Lh-Mf for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Feb 2010 17:10:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NlrKi-0001LM-Gk for help-gnu-emacs@gnu.org; Sun, 28 Feb 2010 17:09:52 -0500 Original-Received: from [140.186.70.92] (port=45951 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NlrKg-0001JL-MD for help-gnu-emacs@gnu.org; Sun, 28 Feb 2010 17:09:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NlrKf-0006no-CO for help-gnu-emacs@gnu.org; Sun, 28 Feb 2010 17:09:50 -0500 Original-Received: from ey-out-1920.google.com ([74.125.78.150]:32526) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NlrKf-0006nk-6C for help-gnu-emacs@gnu.org; Sun, 28 Feb 2010 17:09:49 -0500 Original-Received: by ey-out-1920.google.com with SMTP id 5so524404eyb.34 for ; Sun, 28 Feb 2010 14:09:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=vcJeTx7v8dZF7lM1sJaECcsooFeCDnH0UUH5l4kcn40=; b=iyJAjGaonoYFAuN//2V7JOJD6O0CFuH5bCKG1x0ELhqfQeVt0bE7ivzMYZEifxGAJO wnzuANdzoMs7yL/8jPJ75t4jrJxoWmzEOSSoRp7xewljj02W3sdSwyjPC5J7ojX2dw3Q huVribt9O4o3XjuKbzqrbhFTTWoqNvj8A/gmw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=wRz+M4gbChS7XVlTnRI3eLtUOByEmCWXqcP7Y3GtLsxt6PswE8+GgSYRa0f94a/eDu pVKvcpFmWhsRjyTst1VV/uFQkrZ56k7kbHnXkm0MW8drpPwbaCdQGLfcuN5MPBrKu2gy GbLUzevm/cvKuTv2RM644PlUslaw3NHwawBoQ= Original-Received: by 10.213.97.17 with SMTP id j17mr2329369ebn.24.1267394988101; Sun, 28 Feb 2010 14:09:48 -0800 (PST) Original-Received: from localhost.localdomain (pb-d-128-141-226-25.cern.ch [128.141.226.25]) by mx.google.com with ESMTPS id 16sm1837530ewy.7.2010.02.28.14.09.46 (version=SSLv3 cipher=RC4-MD5); Sun, 28 Feb 2010 14:09:47 -0800 (PST) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72241 Archived-At: On 28/02/10 03:00 AM, Tim Visher wrote: > On Sat, Feb 27, 2010 at 7:55 PM, Suvayu Ali wrote: >> I was trying to customise the font face to make everything more >> visible. Usually I use Emacs with a GUI but quite often I need to use >> no-window. The default face for the minibuffer-prompt is medium blue >> in no-window which makes it very difficult for me to see. I however >> like the defaults when using the GUI. >> >> Is there some way I could keep the defaults when using GUI and set it >> to something more readable when using no-window? > > I can't remember if it's built in or not but `C-h f emacs-type RET`. Its not. But I found the library: http://malsyned.net/repos/dotemacs/site-lisp/emacs-type.el > You can then key off of that like so: > > (defun emacs-is-windowed () > "Returns non-nil if Emacs is running in Windowed mode." > (string-match "window" (emacs-type))) It returns a symbol, so I had to modify it like this: (require 'emacs-type) (defun emacs-is-windowed () "Returns non-nil if Emacs is running in Windowed mode." (string-match "window" (symbol-name (emacs-type)))) (if (emacs-is-windowed) (progn (set-face-background 'default "black") (set-face-foreground 'default "white"))) Now should I be putting above block in a hook? Or is there a better way to implement this? If using a hook is the proper solution, which should I be using? Something like find-file-hook is definitely inappropriate as we can easily have buffers associated with no files (my lisp abilities are limited at best). :( > Hope that helps. > Thanks a lot. That was very helpful. -- Suvayu Open source is the future. It sets us free.