Emacs Color Problem

I’ve installed the Cogent version of Emacs 21.2.1 on my QNX6.2.1 NC
system. It seems to run fine under Photon but it’s slow that way. I
normally access this system using Phindows and prefer just to run my
emacs in a terminal window so I start it as “emacs -nw”. That works
fine but the foreground/background colors are not what I expected for
either normal text (ala text-mode) or color syntax highlighting in,
for example, my C/C++ source and header files.

I have a copy of the same .emacs configuration file that I use on all
my Windows and Linux systems saved in my home directory. I make color
assignments in there like…

(cond ((fboundp 'global-font-lock-mode)
(setq font-lock-face-attributes
'((font-lock-comment-face “Red” “Black”)
(font-lock-string-face “Green” “Black”)
(font-lock-keyword-face “Cyan” “Black”)
(font-lock-function-name-face “Yellow” “Black”)
(font-lock-variable-name-face “Yellow” “Black”)
(font-lock-type-face “Yellow” “Black”)
(font-lock-reference-face “Purple” “Black”)

I think emacs is running my configuration file on startup because
keybindings and other things I’ve defined seem to be working. Not the
colors though. They’re messed up. That’s not to say I don’t get
color syntax highlighting colors. I do! Just not the ones I was
expecting.

Any ideas? I’m hardly an emacs expert so it’s quite possible I’m
doing something stupid or missing something simple. For completeness,
here is my complete .emacs file (it’s not a big one).

(setq fill-column 75)
(setq indent-tabs-mode nil)
(setq scroll-conservatively 1)
(setq default-major-mode 'text-mode)
(setq display-time-day-and-date 1)
(setq display-time-24hr-format 1)
(setq buffer-file-type nil)

(display-time-mode 1)
(column-number-mode 1)
(transient-mark-mode 1)
(hscroll-global-mode 1)
(set-background-color “Black”)
(set-foreground-color “Yellow”)
(set-cursor-color “White”)

(add-hook 'text-mode-hook '(lambda () (auto-fill-mode 1)))

(add-hook 'c-mode-common-hook
'(lambda ()
(setq c-basic-offset 4)
(define-key c+±mode-map [C-tab] 'indent-relative)
(define-key c-mode-map [C-tab] 'indent-relative)
))

(global-set-key [home] 'beginning-of-line)
(global-set-key [C-home] 'beginning-of-buffer)
(global-set-key [end] 'end-of-line)
(global-set-key [C-end] 'end-of-buffer)
(global-set-key [f12] 'call-last-kbd-macro)

(cond ((fboundp 'global-font-lock-mode)
(setq font-lock-face-attributes
'((font-lock-comment-face “Red” “Black”)
(font-lock-string-face “Green” “Black”)
(font-lock-keyword-face “Cyan” “Black”)
(font-lock-function-name-face “Yellow” “Black”)
(font-lock-variable-name-face “Yellow” “Black”)
(font-lock-type-face “Yellow” “Black”)
(font-lock-reference-face “Purple” “Black”)
))
(require 'font-lock)
(setq font-lock-maximum-decoration t)
(global-font-lock-mode t)))

I don’t think Emacs supports colors in terminal mode (-nw).

Correct me if I am wrong.

Jens


<charles.hubbard@pnl.gov> wrote in message
news:bl2fdvop1uqolh2t8lt4bpq2341cttd3f0@4ax.com

I’ve installed the Cogent version of Emacs 21.2.1 on my QNX6.2.1 NC
system. It seems to run fine under Photon but it’s slow that way. I
normally access this system using Phindows and prefer just to run my
emacs in a terminal window so I start it as “emacs -nw”. That works
fine but the foreground/background colors are not what I expected for
either normal text (ala text-mode) or color syntax highlighting in,
for example, my C/C++ source and header files.

I have a copy of the same .emacs configuration file that I use on all
my Windows and Linux systems saved in my home directory. I make color
assignments in there like…

(cond ((fboundp 'global-font-lock-mode)
(setq font-lock-face-attributes
'((font-lock-comment-face “Red” “Black”)
(font-lock-string-face “Green” “Black”)
(font-lock-keyword-face “Cyan” “Black”)
(font-lock-function-name-face “Yellow” “Black”)
(font-lock-variable-name-face “Yellow” “Black”)
(font-lock-type-face “Yellow” “Black”)
(font-lock-reference-face “Purple” “Black”)

I think emacs is running my configuration file on startup because
keybindings and other things I’ve defined seem to be working. Not the
colors though. They’re messed up. That’s not to say I don’t get
color syntax highlighting colors. I do! Just not the ones I was
expecting.

Any ideas? I’m hardly an emacs expert so it’s quite possible I’m
doing something stupid or missing something simple. For completeness,
here is my complete .emacs file (it’s not a big one).

(setq fill-column 75)
(setq indent-tabs-mode nil)
(setq scroll-conservatively 1)
(setq default-major-mode 'text-mode)
(setq display-time-day-and-date 1)
(setq display-time-24hr-format 1)
(setq buffer-file-type nil)

(display-time-mode 1)
(column-number-mode 1)
(transient-mark-mode 1)
(hscroll-global-mode 1)
(set-background-color “Black”)
(set-foreground-color “Yellow”)
(set-cursor-color “White”)

(add-hook 'text-mode-hook '(lambda () (auto-fill-mode 1)))

(add-hook 'c-mode-common-hook
'(lambda ()
(setq c-basic-offset 4)
(define-key c+±mode-map [C-tab] 'indent-relative)
(define-key c-mode-map [C-tab] 'indent-relative)
))

(global-set-key [home] 'beginning-of-line)
(global-set-key [C-home] 'beginning-of-buffer)
(global-set-key [end] 'end-of-line)
(global-set-key [C-end] 'end-of-buffer)
(global-set-key [f12] 'call-last-kbd-macro)

(cond ((fboundp 'global-font-lock-mode)
(setq font-lock-face-attributes
'((font-lock-comment-face “Red” “Black”)
(font-lock-string-face “Green” “Black”)
(font-lock-keyword-face “Cyan” “Black”)
(font-lock-function-name-face “Yellow” “Black”)
(font-lock-variable-name-face “Yellow” “Black”)
(font-lock-type-face “Yellow” “Black”)
(font-lock-reference-face “Purple” “Black”)
))
(require 'font-lock)
(setq font-lock-maximum-decoration t)
(global-font-lock-mode t)))