On Sat, Mar 30, 2013 at 5:21 PM, Jai Dayal <dayals...@gmail.com> wrote:
> Okay, I have no idea what these mean or what to do.

The value of the TERM environment variable has an effect on the colors
that Emacs ends up using. Outside tmux you are probably using a
xterm-like value (e.g. xterm-256color); inside tmux you are probably
using a screen-like value (e.g. screen, or whatever you set tmux's
default-terminal option to supply (e.g. screen-256color)). These
different values of TERM cause Emacs to use different effective color
configurations.

Newer versions of Emacs include configuration files that arrange for
screen-like terminals to define the same Emacs-internal colors as
xterm-like terminals. This helps eliminate color differences, but
there are still other defaults that also affect which colors are
ultimately used (e.g. the "background mode").

# term/screen

If your version of Emacs has a term/screen.el, then it is probably a
version that already defines xterm-like colors. You can check for a
loadable term/screen file by typing this at Emacs:

    M-x find-library RET term/screen RET

(M-x is the letter x key while holding the Meta modifier key, or the
Escape key then the letter x key; RET is the Return or Enter key)

If it opens a file, then you are probably okay for this part (if you
want to be sure, you can check for a call to
xterm-register-default-colors). If it just shows a message like "Can't
find library term/screen", then you will need to arrange to use a
version of the file that defines the same colors as term/xterm.el. You
can get such a version of term/screen.el from the this page (the last
link in my previous message):

    https://gist.github.com/ChrisJohnsen/03101250a0c5bcc05f00

There are two "files" on that page. The first file shows a line that
you should add to your ~/.emacs file (so that ~/.emacs.d/lisp is added
to Emacs's load-path). The second file can then be installed as
~/.emacs.d/lisp/term/screen.el; it includes code that defines the same
colors as would have been defined for an xterm-like TERM.

# background mode

Additionally, you will need to adjust the default "background mode"
since xterm-like TERMs default to "light" while others (including
screen-like TERMs) effectively default to "dark". Type this at Emacs:

    M-x customize-variable RET frame-background-mode RET

then pick "light" from the value menu and save the customization.
Depending on your particular terminal configuration, you may want to
use "dark" instead. The point is to give it a specific value (not the
default "automatic" value), so that xterm-like and screen-like TERMs
are treated the same.

If you are not comfortable with the customization mechanism, then you
might be able to just put the following line in your ~/.emacs file:

    (setq default-frame-background-mode 'dark)

As I said before there may be other areas where Emacs treats
xterm-like and screen-like TERMs differently; the above two areas
(term/screen and the background mode) are just two that I have
previously tracked down.

--
Chris

------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to