From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Face differences between emacs-nox & windows-nt Date: Sat, 09 Oct 2010 09:18:28 +1100 Organization: Unlimited download news at news.astraweb.com Message-ID: <87vd5cpbuz.fsf@puma.rapttech.com.au> References: <87k4ltivfv.fsf@mail.tbulka.de> <83wrptrtjk.fsf@garydjones.name> <83hbgxnjzh.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291871674 17878 80.91.229.12 (9 Dec 2010 05:14:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 05:14:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 06:14:28 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 1PQYpo-000238-57 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 06:14:28 +0100 Original-Received: from localhost ([127.0.0.1]:36760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQYpn-0001h5-B4 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 00:14:27 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!news-xfer.nntp.sonic.net!news.astraweb.com!border2.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:WmDSTt9C8CfuKmkDwk387+2ndAA= Original-Lines: 94 Original-NNTP-Posting-Host: 835827b9.news.astraweb.com Original-X-Trace: DXC=0:Q>I`DWePM?9YCQO^`6:EL?0kYOcDh@JW\:Hm@YlDbJR8J33anb9@O<00JYPB7b:J5H5AaC>G6>K Original-Xref: usenet.stanford.edu gnu.emacs.help:181690 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:76721 Archived-At: "Gary" 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