[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Face differences between emacs-nox & windows-nt
From: |
Tim X |
Subject: |
Re: Face differences between emacs-nox & windows-nt |
Date: |
Wed, 08 Dec 2010 15:31:15 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
"Gary" <help-gnu-emacs@garydjones.name> writes:
> Eli Zaretskii wrote:
>>> From: "Gary"
>>> Date: Fri, 08 Oct 2010 10:13:35 +0200
>>>
>>> Basically I have two versions - one the standard Windows emacs from
>>> ftp.gnu.org/gnu/emacs/windows/ and the other the Cygwin emacs - one
>>> "graphical" and one console. I have got most of my configuration
>> working
>>> with both, only the faces (particularly the colours) aren't happily
>>> working with both.
>>
>> What exactly are the problems? Your original question was about the
>> default faces,
>
> Yeah. I thought that was a good starting point.
>
>> but now you seem to say that you have the faces
>> customized,
>
> I hae *some* faces customised. Not the ones I initially posted about
> though.
>
>> and the results of those customizations are somehow
>> unsatisfactory.
>
> They're fine in one (console, where I actually did the customisation),
> less so in the other (graphical). A couple of examples:
>
> 1. The background colour of the console and "graphics" windows are very
> different - black vs. white (note: I'm not referring to the effect of
> M-x set-background-color here, but rather the bg colour of the
> window/console "behind" emacs). I happen to prefer a black bg for
> working with text, but other windows lighter in colour (i.e. I would
> also like my graphical emacs to have a black bg). That means face colour
> contrasts are wrong when faces are customized in (say) console
> emacs. Some text is simple invisible in the graphical version as a
> result.
>
> 2. Because of differences in the default faces, the colouring of some
> modes' syntactical elements is different between the two (i.e. when the
> used face is the default face I started the thread about). In fact,
> since a lot of faces use inherited values, won't that potentially affect
> more than just those specific faces?
>
> I'm wondering if the best way is just to
> (setq custom-file "~/.emacs.d/.emacs-custom.el")
> because where emacs thinks "~" is depends on whether it is Cygwin or
> Windows, so I can customize them independently. Not exactly DRY though.
>
> Note: calling set-background-color in the console version, where I did
> all my customisation, can have the pretty unpleasant effect of changing
> foreground text colours as well (I guess there is some built-in contrast
> calculation going on somewhere). For example the content of gnus'
> "Newsgroup" header line is shown in dark blue or bright yellow depending
> on whether set-background-color is called with black or white. So many
> my lovingly declared colours and contrasts vanish because emacs now
> "knows" I have a black bg, even though, actually, the colour of the bg
> does *not* change (it is set in the console, remember). That's not a
> total disaster, since I can customise them again to something that
> contrasts okay - at least then the bg could be the same in both emacsen
> - but I don't know how much that would help and it's a rather large
> project if I don't know it will work. Any thoughts on that?
>
>
The way I solved this was to put my face customizations in a file and
have that loaded by .emacs. For example
(cond ((and (eq window-system 'x)
(not noninteractive))
(set-face-attribute 'default nil :foreground "wheat" :background "black")
(set-face-attribute 'bold nil :foreground "white" :weight 'bold)
(set-face-attribute 'italic nil :foreground "yellow")
(set-face-attribute 'bold-italic nil :foreground "gold" :weight 'bold)
...)
((and (not window-system)
(not noninteractive))
(set-face-attribute 'comint-highlight-prompt nil :foreground "cyan"
:weight 'bold)
(set-face-attribute 'mode-line nil :background "blue"
:foreground "white" :inverse-video nil)
(set-face-attribute 'font-lock-builtin-face nil :foreground "yellow"
:weight 'bold)
(set-face-attribute 'font-lock-comment-face nil :foreground "green"
:inherit 'font-lock-string-face)
....))
Tim
--
tcross (at) rapttech dot com dot au
- Re: Face differences between emacs-nox & windows-nt,
Tim X <=