From: Tim Visher <tim.visher@gmail.com>
To: Suvayu Ali <fatkasuvayu+linux@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: conditional font faces
Date: Sun, 28 Feb 2010 21:28:34 -0500 [thread overview]
Message-ID: <c115fd3c1002281828g2c95971en37ad054660c6895f@mail.gmail.com> (raw)
In-Reply-To: <4B8AE9D2.1070702@gmail.com>
On Sun, Feb 28, 2010 at 5:10 PM, Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:
> On 28/02/10 03:00 AM, Tim Visher wrote:
>>
>> On Sat, Feb 27, 2010 at 7:55 PM, Suvayu Ali<fatkasuvayu+linux@gmail.com>
>> 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")))
That's interesting. The file I got from I not where returned strings.
If you don't mind doing the conversion then you're more than welcome
to but you could download the version I use from my [GitHub
page](http://github.com/timvisher/.emacs/blob/master/site-lisp/emacs-type.el)
if you so desired. Again, I had to override it like
[so](http://github.com/timvisher/.emacs/blob/master/lisp/platform-detection.el)
in order to correctly detect Macs.
> 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). :(
If I were you I'd put it in my .emacs file. That way it gets
evaluated for everything in the life of that emacs process. This
works for me at least. Here's a [very simple example of how I use
it](http://github.com/timvisher/.emacs/blob/master/lisp/my-config.el#L33).
--
In Christ,
Timmy V.
http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail
next prev parent reply other threads:[~2010-03-01 2:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-28 0:55 conditional font faces Suvayu Ali
2010-02-28 2:00 ` Tim Visher
2010-02-28 22:10 ` Suvayu Ali
2010-03-01 2:28 ` Tim Visher [this message]
2010-03-01 13:17 ` Suvayu Ali
2010-03-01 9:50 ` Thamer Mahmoud
2010-03-01 13:21 ` Suvayu Ali
2010-03-01 21:58 ` Suvayu Ali
2010-03-02 1:25 ` Tim Visher
2010-03-02 2:51 ` Suvayu Ali
2010-03-04 16:57 ` zwz
2010-03-04 20:50 ` Suvayu Ali
2010-03-05 16:02 ` zwz
2010-03-05 16:37 ` Suvayu Ali
2010-03-05 17:03 ` zwz
2010-03-05 20:33 ` Suvayu Ali
[not found] <mailman.2015.1267318522.14305.help-gnu-emacs@gnu.org>
2010-02-28 5:30 ` Stefan Monnier
2010-02-28 22:11 ` Suvayu Ali
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c115fd3c1002281828g2c95971en37ad054660c6895f@mail.gmail.com \
--to=tim.visher@gmail.com \
--cc=fatkasuvayu+linux@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).