Trying to figure out how to force Aquamacs (or any windowed Emacs) to use the xterm 256-colors - emacs

This question is in regards to forcing emacs to use a 256 color xterm color scheme.
When you open emacs in a terminal that supports xterm-256, it defaults to the xterm-256 color scheme, where default emacs font face colors like 'Firebrick' turns into something the xterm color scheme can display, which in this case is 'Red', so on and so forth. I really like this. I do not like the default emacs colors in a non-terminal setting; I think they are too faded and washed out-- I much prefer the brightness of the terminal colors.
(In fact I find myself programming in the terminal most often simply because I vastly prefer the typeface and the colors-- but I'd like to start using Aquamacs more for various reasons.)
For the life of me, I cannot figure out how to force Emacs (or in my case, Aquamacs) to force itself to downgrade the default color scheme to the xterm 256 color scheme like it does in my terminal. There has to be an easier way than making a new, ridiculously detailed color theme, but beyond the "TERM= " command you can set in your bashrc file (which obviously Aquamacs doesn't care about or use) I can't find anything equivalent in Emacs/Aquamacs that tells it to adopt a 256 color range so that it does things like turns Firebrick into the closest 'available' color, in this case, red.
I've attached screenshots. The first is how I want it to look like. (jpeg ruins the cripsness/brightness of the colors, but you get the idea.)
Second shot here is the default 'washed out' colors in aquamacs. See how the comments are in Firebrick (correctly displayed), versus the bright red of the comments in the above pic.
Variable names show up as more yellow in the top pic, but as more 'brown' in the bottom. Strings in the above file show up as more 'light brown' whereas in the bottom, it's more a dark brown. You can see they are definitely the same color scheme-- it's just that the terminal doesn't know about some of the colors and so it converts them to their baser, brighter forms.
Anybody know how to force this in Aquamacs? I've spent far too many hours researching this. :-)
Thanks!
Nick

Related

Hide/change Emacs fringe bent arrows due to word wrapping?

I would like to change (or hide entirely) the "bent arrow" character that appears in the Emacs fringe (both on the left and right hand side). I'm using Emacs 24 on a Mac, installed via homebrew. I find it to be visually distracting. A smaller character, like a center dot, might work well.
For context, this is an official description of the small bent arrows (from http://www.gnu.org/software/emacs/manual/html_node/emacs/Continuation-Lines.html):
Sometimes, a line of text in the buffer—a logical line—is too long to fit in the window, and Emacs displays it as two or more screen lines. This is called line wrapping or continuation, and the long logical line is called a continued line. On a graphical display, Emacs indicates line wrapping with small bent arrows in the left and right window fringes. On a text terminal, Emacs indicates line wrapping by displaying a ‘\’ character at the right margin.
The Emacs LineWrap Wiki page does not address my question.
The best information I've found so far is contained in this StackOverflow answer:
When word-wrap is set to nil in a text terminal (-nw) Emacs, the backslash character appears on the right margin.
When word-wrap is set to t in a text terminal Emacs, the backslash character is not shown. Setting visual-line-mode also sets word-wrap to true.
This does not apply when Emacs is running as a GUI window: the small bent arrow appears on the right margin regardless of the value of word-wrap.
Is hiding or changing the bent arrows possible? If not, an answer that says, more or less, "I've looked at X and concluded that it is impossible" is ok too.
Update: Although it is not a terrible work-around, changing the fringes is not what I'm looking for: I want to customize the "bent arrow" character or bitmap.
First, some quick context. From Emacs Fringe Bitmaps: "Fringe indicators are tiny icons displayed in the window fringe to indicate truncated or continued lines, buffer boundaries, etc."
You cannot replace the curly arrow with arbitrary text. According to lunaryorn's answer to "Is It Possible To Replace Fringe Bitmaps With Text in Emacs?":
No, it is not. Fringe “bitmaps” are really bitmaps, that is vectors of 0/1 bits, overlayed over the fringe. There is no way to directly render arbitrary unicode characters onto the fringe. [...] What you can do, is to render a unicode character into a 0/1 bitmap yourself.
Like it says, you can change the bitmap. Fringe Bitmaps contains a list of fringe bitmaps; left-curly-arrow and right-curly-arrow are the ones relevant for this question.
Here is what I drew up. Adjust to your liking. Put this in your Emacs init file.
(define-fringe-bitmap 'right-curly-arrow
[#b00000000
#b00000000
#b00000000
#b00000000
#b01110000
#b00010000
#b00010000
#b00000000])
(define-fringe-bitmap 'left-curly-arrow
[#b00000000
#b00001000
#b00001000
#b00001110
#b00000000
#b00000000
#b00000000
#b00000000])
More documentation is available at Customizing Bitmaps, including set-fringe-bitmap-face which "sets the face for the fringe. If face is nil, it selects the fringe face. The bitmap's face controls the color to draw it in".

How can I write colored text to an IRC channel with Irssi?

I'm searching for a method to write a text with different colors like I always saw on other IRC channels. I want to achieve this with Irssi which is CLI based. I have found multiple methods which didn't work as expected. How can I for example write
WHAT
with green color for example?
I would like to achieve the same effect from a simple Bash script too.
First, make sure to enable text colors with
/set hide_colors OFF
Within Irssi, to answer your concrete question, type
Ctrl+C 3 WHAT
and then Enter. The text will show up in green. This convention is known as mIRC colour codes. To make it more comfortable, download the colour_popup script, place it in your ~/.irssi/scripts/autorun folder and run this command:
/statusbar prompt add -after input -alignment right colours
Then it will show you the available colours once you type Ctrl + C.
On the other hand with Bash, you need to use ANSI colour codes. To output green text, try this command:
printf "\e[%dm%s\e[m\n" 32 hallo
\e[ is a CSI (terminal control sequence start) and m is the command; it means character graphics attributes like colour, bold, ...
3 refers to the dull foreground colour table, 2 is green; valid colours go from 0-7. Bright colours are 90-97; background colours are 40-47 and 100-107. There are even more colours possible with other encodings, such as 256 colour table "38;5;<idx>" where <idx> is from 0-255, or 24 bit RGB colours "38;2;12;34;56" (12/255 red, 34/255 green, 56/255 blue); this is not supported by all terminals.

emacs customize-face color

I tried to customize my emacs color by changing font-lock faces' color (M-x customize-face).
But I found that the amount of color is not as many as all the values #xxxxxx.
For example, when changing a color value from #000000 to #FF0000, I just got only two color, 'red' and a 'lighter red'.
Is this the limit of emacs or I need to use another way to express color value?
Apparently a Windows shell doesn't support colors. Either get a modern shell or run in Window mode.

How to darken postscript text produced by emacs

I'm using emacs command ps-spool-buffer-with-faces command to make some postscript files of code I'm working on. The problem is that the font color seems to be light gray instead of black. I've poked around the postscript file & googled a bit, but have not found any solution. Does anyone know how to turn my gray font black?
Assuming you just want to print in black and white, try:
(setq ps-print-color-p nil)
Otherwise, you might take a look at other values for ps-print-color-p:
ps-print-color-p is a variable defined in `ps-print.el'.
Its value is t
Documentation:
Specify how buffer's text color is printed.
Valid values are:
nil Do not print colors.
t Print colors.
black-white Print colors on black/white printer.
See also `ps-black-white-faces'.
Any other value is treated as t.
You can customize this variable.
You can customize using M-xcustomize-variableRETps-print-color-pRET

How to change the background color for the line number column in eclipse?

I am using Eclipse 3.6.1 classic and trying to tweak the color syntax to my desire. The one thing I haven't been able to change is the background color for the line number column. If this is not possible because Eclipse doesn't have an option for it, I will be satisfied even with a hack/plugin if any of you know of any.
Thanks.
There is not an explicit setting for changing the background color of the line number column (Eclipse Helios, SR2, Build id: 20110218-0911). However, there are work-arounds and here is one:
The line number background changes color according to any changes you make in the Text Editors "Background color" - so the two are the same. Between these two is the column holding the debugging breakpoints (not sure what that column is called) and it's background color is not affected when changing the general background.
I run Eclipse on Linux (Oracle's version) and access it with XMing X-server from a PC. Setting this background color to a very pale yellow makes the narrow column holding the debugging breakpoints standout - and that column is between the text and the line number column. So the effect is to make the boundaries of the line number column more clear.
The very pale yellow is #FCFFC8 = RGB 252,255,200 = HSV 63,22,100
Eclipse often behaves a little differently when I run it straight from my PC so this behavior may be one of those cases.
Hope this helps.
Go to Preferences -> General -> Editors -> Text Editors -> Appearance color options and you will see that you can set the color of the line numbers using Line number foreground option and you can set the background of the line numbers column using Background color option.