[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs -nw conflicts with (set-foreground-color "xxx")

From: Peter Dyballa
Subject: Re: emacs -nw conflicts with (set-foreground-color "xxx")
Date: Tue, 9 Oct 2007 11:09:57 +0200

Am 09.10.2007 um 06:27 schrieb sigma.sullivan:

Does this make any sense?  How can I get rid of the color

I don't know ... One thing that I can imagine being the cause is, that all these extra colours in your console application come from the X server. When GNU Emacs or some other ncurses based programme runs in this terminal emulation, it has no access to X11 and is restricted to the use of ANSI defined colours ("ESC [ 3 7 m ESC [ 4 0 m" or such codes). It might be possible that an extended "termcap entry" describes capabilities to access much more colours, but then this entry's name would be needed to be defined as the environment variable TERM. An auxiliary environment variable TERMCAP or TERMPATH might point to that powerful entry.

Please check what your console application really offers "simple" ncurses based non-graphic or alpha-numeric programmes!

I'd make tests with GNU Emacs launched with -Q, i.e. to get an Emacs running that has none of your system's or your own customisation loaded. On the command line you can try -fg and -bg to set foreground or background colour, you can also make GNU Emacs load an ELisp file with the two simple statements, or you can make it to execute the same statements on the command line.

If the colours are still different from those that list-colors- display shows, than you've probably found something like a bug and should report it via Help menu -> Send Bug Report... Then describe the original cause and what you've did and found when testing GNU Emacs launched with -Q. You can start the bug report when still in emacs -Q ...

(Personally I don't see any reason why GNU Emacs, when running without windows inside a terminal emulation, should use other colours then those I've chosen for the host, i.e. the terminal emulation. Its colours are already chosen for ergonomic reasons and personal preferences. Nevertheless, I had problems that the default colours and faces from font-lock were far away from readable. For this purpose I positioned the cursor in some major-mode in such an unreadable text and typed C-u C-x =. In another window this text was described – and also its face was mentioned, offering a direct way to the customisation interface. This way I re-customised some colours and saved them in a file that gets loaded when GNU Emacs is running with window-system "nil." To prepare this work just remove this original section from your user init file, ~/.emacs for example, starting with

          ;; custom-set-faces was added by Custom.
          ;; If you edit it by hand, you could mess it up, so be careful.
          ;; Your init file should contain only one such instance.
          ;; If there is more than one, they won't work right.

and set right whatever you think needs correction. Then save your new customisation and put the section in another file. Load your customisation via, for example

      (setq custom-file (format "~/.emacs-Abrichtung-%d.el" ETyp))
      (load custom-file)
      (load (format "~/.emacs_%s" mWS))

where ETyp corresponds to something like emacs-major-version [I have a few Emacsen] and mWS corresponds to the window-system in which it runs.)


             ~  O
  Pete       ~~_\\_/%
             ~  O  o

reply via email to

[Prev in Thread] Current Thread [Next in Thread]