Fixing colors in XCygwin emacs - emacs

I am using Emacs 23 in Cygwin with X, and the colours are nothing like they should be...e.g. in color-theme-gray30, the background is chocolate brown rather than gray30. I suspect I might have to export some setting in the Cygwin BAT file, but can't find out what it should be...any ideas? Thanks!

I doubt this is a problem with Emacs or Cygwin. I think it may be a problem with how your monitor is adjusted (or even the angle your are viewing it from if it is an LCD).
Emacs uses the same color references as X11 (found in rgb.txt). I did a quick check with a reference page (enter link description here) vs. my Emacs 23 in X11 under Cygwin, and the colors do match. It isn't "chocolate brown" with my normal monitor setup, but I can change its tint by playing with the color controls on the monitor.

Related

Make emacs gui use only terminal colours

Since xterm supports only 16 colours, when you run emacs inside xterm, it automatically maps the myriad colours defined by the various syntax colouring modes to one of the 16 terminal colours. That's the behaviour I want to have on the emacs gui.
Is there a way to make the emacs gui believe that only the 16 terminal colours are available?
Also, can I disable mouse support in the emacs gui? What I want is the gui to behave exactly like emacs inside xterm.
Thank you in advance!
(If you wonder why I want this: After nearly 15 years running emacs inside xterm, I'm sure that's what suits me best.
However, my new employer is forcing me to work on a Windows workstation and now I'm compelled to use the native emacs gui because I haven't managed to get ecb to run with cygwin's emacs. I've already spent a lot of time trying to get the emacs gui to behave like emacs inside xterm, but I still have too many colours.)
Your best chance may be to just use a color theme that just uses 16 colors for all faces. The Solarized theme for example uses just about 16 colors even in a GUI Emacs. It still makes use of bold and italic fonts, though, and occasionally (and very rarely) uses some lighter color variants to emphasize text, which might already be too much for you.
You could also compile your personal set of 16 colours, and customize the faces of your Emacs to use only these colors.

Emacs on Windows 7: How to get color theme »solarized-light« working?

I'm using Emacs 24 on Windows 7. I installed the solarized theme, see here: https://github.com/sellout/emacs-color-theme-solarized
It is easy to switch to the color-theme, e.g. by doing M-x load-theme and then pick solarized-light.
But especially the colors of solarized-light are nearly unreadable. The colors are not even close to the colors of the pictures. I guess there is something wrong with a thing called »color palette«, see here: console2 colors solarized
Any ideas?
Edit: I made a screenshot of Emacs which shows the pretty low contrast.
So, I installed it now, and I see the lack of contrast. But the difference seems to be cause by the difference in font rendering across operating systems.
The screenshots on the github page have most likely been done on Mac OS, which renders the fonts the thickest. The theme looks reasonable on Linux with the default font, although, depending on the settings, it renders the text a bit or more thinner. And Windows renders text with the smallest amount of "ink", so to speak. While it's considered sharper my some users, it also makes things worse when a theme uses low-contrast colors, such as the light version of Solarized.
Another thing to note is that the screenshots are done in Vim, which has a different syntax highlighting mechanism from Emacs, so the colors on keywords, etc, are bound to be different.
But I took two screenshots, on Ubuntu and Windows, opened them in Gimp, zoomed in, used the color picker, and the value of the blue color was approximately the same as on the reference screenshot: 2690db.
In my view, i don't feel the theme work improperly.
The following is my screenshot, os x, Emacs 24.3
Have you tried to change another font or theme (if that is not your only love)

How do I fix this random behavior with my Emacs mode line?

I am running Emacs 23.3 on Windows XP. When Emacs is started, the mode line will assume one of these two appearances at random. Needless to say, I prefer the first one. How do I figure out what is going on and how do I make the first one stick?
The images don't show it, but the first one has a GUI type appearance. If I hover over the various bits of text with a mouse, e.g. Help then the text Help turns into a button with shadows etc.
The black mode line appears to be a text mode widget. The only thing that the mouse will change on it is the highlighting.
PS: Thanks JSON!
I vaguely remember this happening years ago depending on whether or not I started Emacs from Remote Desktop. Perhaps there's an issue with color depth?
See if anything has changed your settings to
(set-face-background 'modeline "#000000")
(set-face-foreground 'modeline "#FFFFFF")
(EDIT: Color codes corrected) in any of your .el files.

What are some good emacs font faces to manually set?

There is alllll kinds of information out there about emacs color schemes, font locks, etc but I am having trouble getting where I want to be. Basically I would like to know what are some of the best font faces to set in order to have a nice solid color theme which is a good cross language solution. I am ending up with lots of language syntax (parens, brackets, operators, etc) not highlighted in some places when I expect them to be.
Below are the faces I am currently setting:
font-lock-builtin-face
font-lock-comment-face
font-lock-comment-delimiter-face
font-lock-doc-face
font-lock-doc-string-face
font-lock-function-name
font-lock-keyword-face
font-lock-negation-char-face
font-lock-preprocessor-face
font-lock-string-face
font-lock-type-face
font-lock-variable-name-face
What if any major faces am I missing here?
Don't do it like this. Choose a colour-theme that looks "okay" and when you're doing some work and find something unsatisfactory, customise that face to suite your taste.
I once knew someone who actually did an xlsfonts and opened an xterm for each one to decide which one he wanted to use while coding. Not thing kind of way I'd like to spend my time. :)
zenburn is a beautiful color theme. I use the terminus font on debian.
anyhow, I give up trying to use best font in GUI system. I revert to Raster Font, use in DOS Prompt / if it is in Linux, a TTY. Now that is so simple :)
My main workstation is Windows. There is (off course) native Win32 GUI version of Emacs, but I prefer to run it in DOS Command Prompt, using I am using emacs -nw. Using a few trick (write app that draw black border around screen edges), a found it able to make an illusion that it is in a console mode.
I love console mode :)

How do I get my Emacs to *always* use 6x13 on X11

I recently declared .emacs bankrupcy and reorganized my init stuff. In
the process, I ripped out all the hacky font selection stuff I had
accrued over the years, figuring there are probably easier ways to
accomplish what I want in the most modern version of emacs.
GNU Emacs 23.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.14.4)
on a GNU/Linux System (Ubuntu 8.10).
Let's
ignore, for the moment, the fact that I also run emacs under Mac OS X
(GUI+Terminal) and occasionally on Windows and just focus on the X11
case:
(Background: The font 6x13 has been part of X11 for as long as I can remember. (a.k.a
misc-fixed semi-condensed ...). It's a bitmap font.)
I want emacs to always use the X11 bitmap font 6x13. (This gives me two buffers next to eachother on my netbook.)
I don't want to see DejaVu Sans Mono 16pt or whatever the heck comes up by default on my netbook (it's huge!)
I want every new frame and window to use this font.
I want derived faces (like org-mode-column) to use 6x13 font and not mysteriously switch back to DejaVu Sans Mono
I don't care what GNOME and X11 think the logical DPI of my screen is. I want 6x13.
When I remote into my netbook (NX Machine) I don't want to see 6x10. I want 6x13.
In case there's any doubt: I want 6x13.
What's the canonical way to do to make this happen?
And before some smart-aleck tells me about menu: Options>>Set Default
Font: the resulting dialog box doesn't even offer bitmap fonts, so
there's no way to choose 6x13. Furthermore, it doesn't solve the
problem with org-mode: table-views still come up with the wrong font.
I control this stuff from my .Xresources file.
Personally I have
emacs.reverseVideo: true
emacs.font: 7x13bold
(And I quite agree... long live the bitmap fonts! I'll take my xterm with
XTerm*foreground: green
XTerm*background: black
XTerm*font: 7x13bold
...
over the Gnome terminal any day).
If you're playing with .Xresources from within a session, xrdb command is useful to reload them.
You want to set the default frame parameters in your .emacs.
find out the name of the font you want to use
add the needed value to the default-frame-alist.
The easiest way, actually, is to use customize and customize default-frame-alist, but can also use elisp and write
(setq default-frame-alist
'(font . "-*-*-medium-r-normal--16-*-*-*-*-*-fontset-hiramin_w6"))
That's stolen from my emacs, you'll need to find the full font name (xfontsel?) for the font you want.
See also the EmacsWiki on setting fonts and faces.
For anyone reading this with a recent Linux distribution you will have to install 6x13 first (yes, sounds obvious..). There are instructions here for Ubuntu/Debian which should work on other distros too if you skip the apt-getting of random fonts. Install the "FixedSC" .tgz from there (it unpacks to /usr/local/share/fonts) then follow the instructions to add it to the font cache so it will appear in the Gnome Font selection dialog.